arrow-left

All pages
gitbookPowered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Local Development Deployment

Profile dev-local-3nodes

This deployment profile deploys 3 MedCo nodes on a single machine for development purposes. It is meant to be used only on your local machine, i.e. localhost. The tags of the docker images used are all dev, i.e. the ones built from the development version of the different source codes. They are available either through Docker Hub, or built locally.

hashtag
MedCo Stack Deployment (except Glowing Bear)

First step is to clone the medco-deployment repository with the correct branch. This example gets the data in the home directory of the current user, but that can be changed.

Next step is to build the docker images:

Note that instead of building the dev docker images locally, it is possible to download them from Docker Hub by using docker-compose pull, but there is no guarantee on the current status of those images are they are automatically built.

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:

Wait some time for the initialization of the containers to be done (up to the message: “i2b2-medco-srv… - Started x of y services (z services are lazy, passive or on-demand)”), this can take up to 10 minutes. For the subsequent runs, the startup will be faster.

hashtag
Glowing Bear Deployment

First step is to clone the glowing-bear repository with the correct branch.

Glowing Bear is deployed separately for development, as we use its convenient live development server:

Note that the first run will take a significant time in order to build everything.

In order to stop the containers, simply hit Ctrl+C in all the active windows.

hashtag
Keycloak Configuration

Follow the instructions from to be able to use Glowing Bear.

hashtag
Test the deployment

In order to test that the development deployment of MedCo is working, access Glowing Bear in your web browser at http://localhost:4200 and use the credentials previously configured during the . If you are new to Glowing Bear you can watch the video.

By default MedCo loads a specific test data, refer to for expected results to queries. To load a dataset, follow the guide . For reference, the database address (host) to use during loading is localhost:5432 and the databases i2b2medcosrv0, i2b2medcosrv1 and i2b2medcosrv2.

Keycloak Configuration
Keycloak Configuration
Glowing Bear user interface walkthrougharrow-up-right
Description of the default test dataarrow-up-right
Loading Data
$ cd ~
$ git clone -b dev https://github.com/ldsec/medco-deployment.git
$ cd ~/medco-deployment/compose-profiles/dev-local-3nodes
$ docker-compose build
$ docker-compose up
$ cd ~
$ git clone -b dev https://github.com/ldsec/glowing-bear-medco.git
$ cd ~/glowing-bear-medco/deployment
$ docker-compose up dev-server

Local Test Deployment

Profile test-local-3nodes

This test profile deploys 3 MedCo nodes on a single machine for test purposes. It can be used either on your local machine, or any other machine to which you have access. The version of the docker images used are the latest released versions. This profile is for example used for the MedCo public demoarrow-up-right.

hashtag
MedCo Stack Deployment

First step is to get the MedCo Deployment latest release.

Next step is to download the docker images:

The default configuration of the deployment is suitable if the stack is deployed on your local host, and if you do not need to modify the default passwords. If so, edit the file ~/medco-deployment/compose-profiles/test-local-3nodes/.env to reflect your configuration. For example:

MEDCO_NODE_URL should be the fully qualified domain name of the host, HTTP_SCHEME should be http or https. The other fields control the default passwords for the various services running. Note that setting the passwords that way works only on the first deployment. If the passwords need to be updated later, you should use the specific component way of modifying password.

Follow to set up the certificates needed for HTTPS. If you are deploying on another host than the local host without HTTPS take note of the following: .

Final step is to run the nodes, all three will run simultaneously:

Wait some time for the initialization of the containers to be done (up to the message: “i2b2-medco-srv… - Started x of y services (z services are lazy, passive or on-demand)”), this can take up to 10 minutes. For the subsequent runs, the startup will be faster. In order to stop the containers, hit Ctrl+C in the active window.

You can use the command docker-compose up -d instead to run MedCo in the background and thus not keeping the console captive. In that case use docker-compose stop to stop the containers.

hashtag
Keycloak Configuration

Follow the instructions from to be able to use Glowing Bear.

hashtag
Test the deployment

In order to test that the local test deployment of MedCo is working, access Glowing Bear in your web browser at http(s)://<domain name> and use the credentials previously configured during the . If you are new to Glowing Bear you can watch the video.

By default MedCo loads a specific test data, refer to for expected results to queries. To load a dataset, follow the guide . For reference, the database address (host) to use during loading is <domain name>:5432 and the databases i2b2medcosrv0, i2b2medcosrv1 and i2b2medcosrv2.

Network Test Deployment

Profile test-network

This test profile deploys an arbitrary set of MedCo nodes independently in different machines that together form a MedCo network. This deployment assumes each node is deployed in a single dedicated machine. All the machines have to be reachable between each other. Nodes should agree on a network name and individual indexes beforehand (to be assigned a unique ID). The node with index 0 is the central node, which is the only one running Glowing Bear, PICSURE and Keycloak.

The next set of steps must be executed individually by each node of the network.

hashtag
Preliminaries

First step is to get the MedCo Deployment latest release at each node.

hashtag
Generation of the Deployment Profile

Next the compose and configuration profiles must be generated using a script, executed in two steps.

  • Step 1: each node generates its keys and certificates, and shares its public information with the other nodes

  • Step 2: each node collects the public keys and certificates of the all the other nodes

For step 1, the network name should be common to all the nodes. <node DNS name> corresponds to the machine domain name where the node is being deployed. As mentioned before the different parties should have agreed beforehand on the members of the network, and assigned an index to each different node to construct its UID (starting from 0, to n-1, n being the total number of nodes). Remember that node 0 is the central node.

This script will generate the compose profile and part of the configuration profile, including a file srv<node index>-public.tar.gz. This file should be shared with the other nodes, and all of them need to place it in their configuration profile folder (~/medco-deployment/configuration-profiles/test-network-<network name>-node<node index>).

Once all nodes have shared their srv<node index>-public.tar.gz file with all other nodes, step 2 can be executed:

At this point, it is possible to edit the default configuration generated in ~/medco-deployment/configuration-profiles/test-network-<network name>-node<node index>/.env. This is needed if you want to modify the default passwords. When editing this file, be careful to change only the passwords and not the other values. Note that setting the passwords that way works only on the first deployment. If the passwords need to be updated later, you should use the specific component way of modifying password.

The deployment profile is now ready to be used.

hashtag
MedCo Stack Deployment

Next step is to download the docker images and run the node. The process is different for the central node and for the other nodes. If you manage the central node run the following:

If you manage a node other than the central one (index > 0), run the following:

Wait some time for the initialization of the containers to be done, this can take up to 10 minutes. For the subsequent runs, the startup will be faster. You can use docker-compose -f docker-compose... stop to stop the containers.

hashtag
Keycloak Configuration

Follow the instructions from and then you should be able to login in Glowing Bear.

hashtag
Data Loading

Contrary to the other deployment profiles the default test data will not be working (the queries made will fail) since the data is not encrypted with the collective key that was generated (encryption key derived from all the nodes’ public keys). Run the MedCo loader (see ) to be able to test this deployment. For reference, the database address (host) to use during loading is <domain name>:5432 and the database i2b2medco.

hashtag
Test the deployment

In order to test that the network deployment of MedCo is working, access Glowing Bear in your web browser at http://<node domain name> and use the credentials previously configured during the . If you are new to Glowing Bear you can watch the video.

Note that by default the certificates generated by the script are self-signed and thus, when using Glowing Bear, the browser will issue a security warning. To use your own valid certificates, see .

$ cd ~
$ wget https://github.com/ldsec/medco-deployment/archive/v0.2.1-1.tar.gz
$ tar xvzf v0.2.1-1.tar.gz
$ mv medco-deployment-0.2.1-1 medco-deployment
HTTPS Configuration
Disabling HTTPS requirement for external connections
Keycloak Configuration
Keycloak Configuration
Glowing Bear user interface walkthrougharrow-up-right
Description of the default test data
Loading Data
Keycloak Configuration
Loading Data
Keycloak Configuration
Glowing Bear user interface walkthrougharrow-up-right
HTTPS Configuration
$ cd ~/medco-deployment/compose-profiles/test-local-3nodes
$ docker-compose pull
MEDCO_NODE_HOST=medco-demo.epfl.ch
HTTP_SCHEME=https
POSTGRES_PASSWORD=postgres1
PGADMIN_PASSWORD=admin
KEYCLOAK_PASSWORD=keycloak
I2B2_WILDFLY_PASSWORD=admin
I2B2_SERVICE_PASSWORD=pFjy3EjDVwLfT2rB9xkK
I2B2_USER_PASSWORD=demouser
$ docker-compose up
$ cd ~
$ wget https://github.com/ldsec/medco-deployment/archive/v0.2.1-1.tar.gz
$ tar xvzf v0.2.1-1.tar.gz
$ mv medco-deployment-0.2.1-1 medco-deployment
$ cd ~/medco-deployment/resources/profile-generation-scripts/test-network
$ bash step1.sh <network name> <node index> <node DNS name>
$ bash step2.sh <network name> <node index>
$ cd ~/medco-deployment/compose-profiles/test-network-<network name>-node0
$ docker-compose -f docker-compose.common.yml -f docker-compose.node.yml -f docker-compose.central.yml pull
$ docker-compose -f docker-compose.common.yml -f docker-compose.node.yml -f docker-compose.central.yml up -d
$ cd ~/medco-deployment/compose-profiles/test-network-<network name>-node<node index>
$ docker-compose -f docker-compose.common.yml -f docker-compose.node.yml pull
$ docker-compose -f docker-compose.common.yml -f docker-compose.node.yml up -d

Deployment

  • Local Test Deployment

    • MedCo Stack Deployment

These pages explain how to deploy MedCo in different scenarios. Each deployment scenario corresponds to a deployment profile, as described below. All these instructions use the deployment scripts from the repository.

If you are new to MedCo…

… and want to try to deploy the system on a single machine to test it, you should should follow the guide.

… and want to create or join a MedCo network, you should follow the guide.

… and want to develop around MedCo, you should follow the guide.

hashtag
Deployment Profiles

A deployment profile is composed of two things:

  • a compose profile in ~/medco-deployment/compose-profiles/<profile name>/: docker-compose file and parameters like ports to expose, log level, etc.

  • a configuration profile in ~/medco-deployment/configuration-profiles/<profile name>/: files mounted in the docker containers, containing the cryptographic keys, the certificates, etc.

Some profiles are provided by default, for development or testing purposes. Those should not be used in a production scenario with real data, as the private keys are set by default, thus not private. Other types of profiles must generated using the scripts in ~/medco-deployment/resources/profile-generation-scripts/<profile name>/.

The different profiles are the following:

  • test-local-3nodes ()

    • for test on a single machine (used by the )

    • 3 nodes on any host

The database is pre-loaded with some encrypted test data using a key that is pre-generated from the combination of all the participating nodes’ public keys. For the test-network deployment profile this data will not be correctly encrypted, since the public key of each node is generated independently, and, as such, the data must be re-loaded.

MedCo Stack Deployment

  • Keycloak Configuration

  • Data Loading

  • Test the deployment

  • Keycloak Configuration

  • Test the deployment

  • using the latest release of the source codes

  • no debug logging

  • profile pre-generated

  • test-network (Network Test Deployment)

    • for test on several different hosts

    • a single node on a host part of a MedCo network

    • using the latest release of the source codes

    • no debug logging

    • profile must be generated prior to use with the provided scripts

  • dev-local-3nodes (Local Development Deployment)

    • for software development

    • 3 nodes on the local host

    • using development version of source codes

    • debug logging enabled

    • profile pre-generated

  • Keycloak Configuration
    Test the deployment
    Network Test Deployment
    Preliminaries
    Generation of the Deployment Profile
    Local Development Deployment
    MedCo Stack Deployment (except Glowing Bear)
    Glowing Bear Deployment
    medco-deploymentarrow-up-right
    Local Test Deployment
    Network Test Deployment
    Local Development Deployment
    Local Test Deployment
    MedCo live demoarrow-up-right