Local Test Deployment (several nodes on a single machine)

Docker Deployment

This short guide will show you how to deploy 3 nodes of the full MedCo stack on a single machine with the help of Docker and Docker-Compose, for development purpose, or test on a single machine. Any kind of not too old Linux flavor should work, but it has only be tested on the following configuration:

  • Operating System: Ubuntu 16.04 LTS or Fedora 29, assumed to be freshly installed and up to date.
  • Pre-requisite software: git, git-lfs, docker and docker-compose (the rest of the dependencies will be automatically installed with a script).

First step is to clone the medco-deployment, IRCT and glowing-bear repositories (with the correct branch).

$ cd ~
$ git clone -b v0.1a https://github.com/lca1/medco-deployment.git
$ git clone -b MedCo-v0.1a https://github.com/lca1/IRCT.git
$ git clone -b MedCo-v0.1a https://github.com/lca1/glowing-bear.git

Next step is to build or download the docker images. In this specific case (i.e. 3 nodes running on a single machine) you can use the provided compose and configuration profiles, called dev-3nodes-1host. As the name indicates, it is mainly done for development purposes and runs 3 nodes on a single host machine.

Some images are available in docker hub. To get them simply:

$ cd ~/medco-deployment/compose-profiles/dev-3nodes-1host
$ docker-compose -f docker-compose.yml pull

For the others, they need to be built by doing the following:

$ cd ~/IRCT/deployments
$ docker-compose -f docker-compose.medco.dev-3nodes-1host.yml build
$ cd ~/glowing-bear/deployment
$ docker-compose -f docker-compose.yml build gb-dev-server

Next step is to run the nodes. They will run simultaneously, and the logs of the running containers will maintain the console captive. No configuration changes are needed in this scenario before running the nodes. To run them:

$ cd ~/medco-deployment/compose-profiles/dev-3nodes-1host
$ docker-compose up

Wait a few minutes for the initialization of the containers to be done (until the logging stops). For the subsequent runs, the startup will be faster. Then, in a separate terminal run the IRCT container:

$ cd ~/IRCT/deployments
$ chmod -R a+rw ../
$ docker-compose -f docker-compose.medco.dev-3nodes-1host.yml up

Again, the initial startup takes up a few minutes. And in another separate terminal run the glowing-bear container:

$ cd ~/glowing-bear/deployment
$ docker-compose -f docker-compose.yml up gb-dev-server

The first time each of the node runs, the database will be initialized with the structure and the i2b2 demo data. It will take a few minutes so do not interrupt this loading! The next times the nodes are ran, they take 1-2 minutes to be up and running. In order to stop all the nodes, simply hit Ctrl+C in all the active windows.

If you wish to stop a single node, just manually stop each node’s containers.

$ cd ~/medco-deployment/compose-profiles/dev-3nodes-1host
$ docker-compose stop i2b2-medco-srvX nginx-srvX php-fpm-srvX medco-unlynx-srvX

All the services are now up and running, a service still needs some configuration.

Keycloak Configuration

Access in your browser the address http://localhost:8081/auth/admin and connect with the default credentials: user keycloak and password keycloak.

Add a test user: go to the configuration panel Users, click on Add user. Then fill the Username with test, toggle to ON the Email Verified button and click Save. In the next window, click on Credentials, enter twice the password test, toggle to OFF the Temporary button and click Reset Password.

Add an OpenID Connect client configuration: go to the configuration panel Clients, click on Create. There specify in Client ID the value i2b2-local and click Save. In the next window, fill Valid Redirect URIs and Web Origins with the value http://localhost:4200 and click Save.

Testing that the nodes are working

In order to test that the development deployment of MedCo is working, access Glowing Bear at localhost:4200. Use the credentials previously configured: user test and password test.

By default MedCo contains only those test data, refer to Description of the default test data for expected results to queries. To load a data set, follow the guide Loading Data. The database address to use is localhost:5432 with the databases i2b2medcosrv0, i2b2medcosrv1 and i2b2medcosrv2.