3. Deploy COmanage

With our services stack (compose) file all set, we are ready to spin up the services!

Deploy the services

Deploy the services using the following command.

docker stack deploy --compose-file comanage-registry-stack.yml comanage
Hands on time!

Creating network comanage_default
Creating service comanage_database
Creating service comanage_registry
Creating service comanage_ldap

The three services defined in our file have been created.

The virtual machine you are using during the workshop is deployed “behind” an Amazon AWS application load balancer (ALB) and it may take about a minute for the ALB to “see” that the COmanage Registry service is healthy and to route traffic to it. In the meantime, let’s check on the service:

Review what Docker stacks are available

docker stack ls
NAME                SERVICES            ORCHESTRATOR
comanage            3                   Swarm

Review what Docker services are running

docker service ls
ID                  NAME                MODE                REPLICAS            IMAGE                                                              PORTS
ypl33s0036a1        comanage_database   replicated          1/1                 mariadb:10.4.8                                                     
95316c0h0x5s        comanage_ldap       replicated          1/1                 sphericalcowgroup/comanage-registry-slapd:2                        *:389->389/tcp
wniftw1nguw1        comanage_registry   replicated          1/1                 sphericalcowgroup/comanage-registry:hotfix-3.2.x-shibboleth-sp-4   *:80->80/tcp

Review the tasks for the COmanage Registry service

docker service ps comanage_registry
ID                  NAME                  IMAGE                                                              NODE                                           DESIRED STATE       CURRENT STATE           ERROR               PORTS
ibnk0b81b05q        comanage_registry.1   sphericalcowgroup/comanage-registry:hotfix-3.2.x-shibboleth-sp-4   registry1-private.comanage.incommon.training   Running             Running 8 minutes ago 

Review the logs for the COmanage Registry services

docker service logs comanage_registry
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | 2019-11-10 22:11:31,903 CRIT Set uid to user 0
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | 2019-11-10 22:11:31,905 INFO supervisord started with pid 1
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | 2019-11-10 22:11:32,908 INFO spawned: 'shibd' with pid 8
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | 2019-11-10 22:11:32,909 INFO spawned: 'apache2' with pid 9
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | Created directory /srv/comanage-registry/local/Config
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | Created directory /srv/comanage-registry/local/Plugin
...

You may continuously follow the log files for the service by adding the -f flag to the previous command:

docker service logs -f comanage_registry
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | [Mon Nov 11 15:06:45.621935 2019] [core:notice] [pid 9] AH00094: Command line: 'apache2 -D FOREGROUND'
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | 10.255.0.2 - "" [11/Nov/2019:15:06:53 +0000] "GET /registry/ HTTP/1.1" 200 4108 "-" "ELB-HealthChecker/2.0"
comanage_registry.1.ibnk0b81b05q@registry1-private.comanage.incommon.training    | 10.255.0.2 - "" [11/Nov/2019:15:06:55 +0000] "GET /registry/ HTTP/1.1" 200 4108 "-" "ELB-HealthChecker/2.0"
...