Tool structure and available commands

Tool structure and available commands

For local Eureka development, a Go tool is used that applies shared approaches to create a Eureka environment on Rancher environments.

Additionally, this new Go Eureka tool was enspired by the Busybee tool, which was used to run Okapi-based environments locally: BusyBee Developer Env Setup

Analysis of requirements before creating the tool:

  • Need to run Eureka app locally to speed up development and have an ability to debug

  • Run should be made using single command and hide an internal complexity

  • The method of creating resources/modules should be declarative, specifying what needs to be done rather than how it should be done

  • The solution should be cross-platform, to accommodate developers who use different operating systems 

  • The tool should be opened for extension, such as providing support of private image registries

  • Logging and exception handling should be at a sufficient level

Tool structure

  • Go code to perform HTTP requests and use Docker/Vault/AWS clients

  • docker-compose.yaml that configures the system components (e.g. PG, Kafka, Keycloak, Kong, Vault etc)

  • config.*.yaml to allows for fine tuning of the environment

Tool benefits

  • Automates the deployment of backend and frontend components

  • Performs automatic Git cloning and pulling of the latest changes in Kong, Keycloak and Platform-Complete projects

  • Abstract the developers away from platform complexities such as HTTP calls, clients, sidecars etc.

  • Guarantees the correctness by stopping deployment on a particular exception

  • Creates roles, users and attaches capability sets to roles and roles to users

  • Builds and deploys the UI from a snapshot branch

  • Supports both Public and Private container registries

  • Extendible for addition of new commands to be used in daily developer work to automate tasks

List of availalbe commands

  • attachCapabilitySets            Attach capability sets

  • checkPorts                             Check ports

  • createRoles                            Create roles

  • createTenantEntitlements  Create tenant entitlements

  • createTenants                       Create tenants

  • createUsers                           Create users

  • deployApplication         Deploy application

  • deployManagement            Deploy mananagement

  • deployModule                      Deploy module

  • deployModules                    Deploy modules

  • deploySystem                       Undeploy system

  • deployUi                               Deploy UI

  • detachCapabilitySets           Detach capability sets

  • getAccessToken                    Get access token

  • getVaultRootToken              Get vault root token

  • help                                       Help about any command

  • listModules                            List modules

  • listSystem                               List system containers

  • redirect                              Redirect modules

  • removeRoles                          Remove roles

  • removeTenantEntitlements  Remove tenant entitlements

  • removeTenants                       Remove tenants

  • removeUsers                          Create users

  • setup                                       Setup CLI

  • undeployApplication      Undeploy application

  • undeployManagement          Undeploy management

  • undeployModule                   Undeploy module

  • undeployModules                 Undeploy modules

  • undeploySystem                    Undeploy system

  • undeployUi                            Undeploy UI

In bold are the most useful commands for deploying and undeploying applications, creating a full local infrastructure, or setting up redirects to debug a specific local module. Most other commands listed here are invoked within the two main ones: deployApplication or undeployApplication. These commands can be invoked separately, for example, to recreate users, assign them certain capabilities, or retry after a failed operation when invoked within the main deployApplication command.

Dividing into applications

  • Eureka platform offers a collections of modules to be grouped into applications

  • An application can also depend on some parent application for its deployment and successful tenant entitlement

  • The CLI has 2 config files demonstrating this dependency: config.minimal.yaml & config.acquisitions.yaml

  • The CLI also offers a simplified approach to deploy a combined Acquisitions-only application: config.combined.yaml

These YAML files can be used as-is or as templates to configure custom combinations of modules into new applications. In this case, separate applications for Data Import, Circulation, Search, Linked Data, and FQM can be created with only the necessary modules. Different configurations in the YAML file allow us to specify whether we need to deploy the UI, configure memory settings for modules, or set specific environment variables for both the modules and their sidecars.