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.
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.
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.
Follow the instructions from Keycloak Configuration to be able to use Glowing Bear.
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 Keycloak Configuration. If you are new to Glowing Bear you can watch the Glowing Bear user interface walkthrough video.
By default MedCo loads a specific test data, refer to Description of the default test data for expected results to queries. To load a dataset, follow the guide Loading Data. For reference, the database address (host) to use during loading is localhost:5432
and the databases i2b2medcosrv0
, i2b2medcosrv1
and i2b2medcosrv2
.
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 medco-deployment 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 Local Test Deployment guide.
… and want to create or join a MedCo network, you should follow the Network Test Deployment guide.
… and want to develop around MedCo, you should follow the Local Development Deployment guide.
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 (Local Test Deployment)
for test on a single machine (used by the MedCo live demo)
3 nodes on any host
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
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.
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 demo.
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 HTTPS Configuration 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: Disabling HTTPS requirement for external connections.
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.
Follow the instructions from Keycloak Configuration to be able to use Glowing Bear.
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 Keycloak Configuration. If you are new to Glowing Bear you can watch the Glowing Bear user interface walkthrough video.
By default MedCo loads a specific test data, refer to Description of the default test data for expected results to queries. To load a dataset, follow the guide Loading Data. For reference, the database address (host) to use during loading is <domain name>:5432
and the databases i2b2medcosrv0
, i2b2medcosrv1
and i2b2medcosrv2
.
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.
First step is to get the MedCo Deployment latest release at each node.
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.
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.
Follow the instructions from Keycloak Configuration and then you should be able to login in Glowing Bear.
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 Loading Data) 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
.
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 Keycloak Configuration. If you are new to Glowing Bear you can watch the Glowing Bear user interface walkthrough 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 HTTPS Configuration.