This is a step by step guide to install and run a dockerized demo installation of MatchMiner using simulated data.
-
Move genomic.bson, clinical.bson, trial.bson, and synonyms.txt to
./demo/matchminer/data/mongo
-
Start the Docker Engine
Check if the matchminer-demo-api:1.0.0 and matchminer-demo-ui:1.0.0 docker images are available. If not do step 2 - 5
> docker images
If they are present you should see:
REPOSITORY TAG IMAGE ID CREATED SIZE matchminer-demo-ui 1.0.0 5c520c30478c 10 hours ago 1.04 GB matchminer-demo-api 1.0.0 938ea08d802c 10 hours ago 1.06 GB ...
Navigate to matchminer-ui repository
-
> cd /matchminer-ui
-
> docker build -t matchminer-demo-ui:1.0.0 .
Navigate to matchminer-api repository
-
> cd /matchminer-api/
-
> docker build -t matchminer-demo-api:1.0.0 .
NOTE: All mentioned paths are relative to the matchminer-api repository root.
-
> cd ./demo/matchminer
-
> docker-compose up -d
-
> docker ps
You should see something like the following:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ca04363b2487 matchminer-demo-ui:1.0.0 "/entrypoint.sh" 9 hours ago Up 9 hours 0.0.0.0:8001->8001/tcp matchminer_ui_1 cf7f2fb67265 matchminer-demo-kibana-sense:1.0.0 "/docker-entrypoin..." 9 hours ago Up 9 hours 0.0.0.0:5601->5601/tcp matchminer_kibana_1 326aa84fbf9b matchminer-demo-mongo-connector:1.0.0 "/tmp/startup.sh" 9 hours ago Up 9 hours matchminer_connector_1 8a75218f7fca matchminer-demo-api:1.0.0 "/entrypoint.sh dev" 9 hours ago Up 9 hours 80/tcp, 443/tcp, 8443/tcp, 0.0.0.0:5555->5000/tcp matchminer_api_1 5b66b3b1c2c7 elasticsearch:2.4.0 "/docker-entrypoin..." 9 hours ago Up 9 hours 0.0.0.0:9200->9200/tcp, 9300/tcp matchminer_elastic_1 896379773ce9 mongo:latest "docker-entrypoint..." 9 hours ago Up 9 hours 27017/tcp matchminer_mongo_1
-
> docker exec -it matchminer_mongo_1 sh
-
# mongo
You should see the following prompt presented:
rs0:PRIMARY>
If this is the case then the replicateset has been initialized.
If this has not been done correctly you would see rs0:OTHER>
as a prompt. To initialize the replicateset run the following command:
`> rs.initiate();`
- Exit the mongo shell (> exit or ctrl-c)
> cd /storage
> mongorestore --db matchminer genomic.bson
-
> mongorestore --db matchminer clinical.bson
The clinical trials will be added later. We will have to correctly add the mapping to Elasticsearch first.
-
> cat /storage/user.txt
Copy the first json object into the clipboard and insert it into the mongo database
-
> mongo
-
# use matchminer;
-
db.user.insert(PASTE JSON OBJECT HERE)
Find the _id of the user just inserted
-
db.user.find()
Copy the _id of the user to the clipboard
-
Exit the mongo shell and exit the container (> exit (2x))
-
> docker exec -it matchminer_ui_1 sh
NOTE: You might have to install a text editor if its not present in the container
-
> apt-get update
-
> apt-get install vim
-
> cd properties
-
> vim config.json
Replace the user_id under the following path: dev.ENV.devUser.user_id
-
Exit the UI container
-
> cd ./demo/matchminer
-
> docker-compose restart ui
Bring down the mongo-connector
-
> docker-compose stop connector
In browser navigate to: localhost:5601
-
Set Elasticsearch URL in kibana to: http://elasticsearch:9200
Drop the matchminer Elasticsearch index
-
In the large text field on the left enter:
DELETE matchminer
-
Click the green play icon on the top right of the text box
Copy the mapping JSON structure that came with this installation guide (./demo/data/mongo/elasticsearch_settings.txt)
-
In the same text box add
POST matchminer { PASTE JSON MAPPING HERE }
-
Click the green play button to execute the command
-
> docker exec -it matchminer_mongo_1 sh
-
# cd /storage
-
# mongorestore --db matchminer trial.json
-
Exit the mongo container (
# exit
) -
> docker-compose start connector
http://localhost:8001