Startup-order

Overview

Docker SWARM doesn’t support depends_on annotation, this means on a restart of the whole stack every modules will start in the same time. To avoid resources constriction each OnSphere module enforce some waiting on other service.

The dependencies between core modules are described there and serve as a basis to determine the wait-for-it order.

@startuml
skinparam backgroundColor transparent

node OSP_CONFIG_DISP as "OSP-CONFIGURATION-DISPATCHER"
node OSP_MYSQL as "OSP-MYSQL"
node OSP_KEY as "OSP-KEYCLOAK"
node OSP_RABBITMQ as "OSP-RABBITMQ"
node OSP_RIGHTS as "OSP-RIGHTS"
node OTHER_MODULES as "All others modules"

OSP_RABBITMQ -up-> OSP_CONFIG_DISP: Get configuration
OSP_KEY -up-> OSP_CONFIG_DISP: Get configuration
OSP_KEY -up-> OSP_MYSQL: Database
OSP_RIGHTS -up-> OSP_CONFIG_DISP: Get configuration

OTHER_MODULES -up-> OSP_CONFIG_DISP: Get configuration
OTHER_MODULES -up-> OSP_RABBITMQ: Communication bus
OSP_KEY --> OSP_RABBITMQ: Communication bus
OSP_CONFIG_DISP --> OSP_RABBITMQ: Communication bus
OSP_RIGHTS --> OSP_RABBITMQ: Communication bus

@enduml

As only the osp-configuration-dispatcher host and port is available at the startup the current start order is :

  1. Start osp-configuration-dispatcher and osp-mysql

  2. All others modules