Skip to content

Commit 6bb8796

Browse files
authored
Merge pull request #27 from EGA-archive/urgent-fix
created compose for deployment in independent servers
2 parents eeabc63 + 8f1fd7a commit 6bb8796

File tree

3 files changed

+109
-16
lines changed

3 files changed

+109
-16
lines changed

README.md

+23-15
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,36 @@ If you are using a build with all the services in the same cluster, you can use:
4444
docker compose up -d --build
4545
```
4646

47+
#### Up the containers (with services in independent servers)
48+
49+
If you wish to have each service (or some of them) in different servers, you will need to use the remote version of the docker compose file, and deploy the remote services you need by selecting them individually in the build. Example:
50+
51+
```bash
52+
docker-compose -f docker-compose.remote.yml up -d --build beaconprod
53+
```
54+
55+
After that, you will need to configure the IPs in the different conf files to make them connect. Remember to bind the IP in mongo to 0.0.0.0 in case you are making an independent deployment of the beacon and the mongodb.
56+
4757
#### Load the data
4858

49-
To load the database we execute the following commands:
59+
To load the database (mongo) just copy your files in the data folder. Then, locate yourself in the mongo folder:
5060

5161
```bash
52-
docker cp /path/to/analyses.json mongoprod:tmp/analyses.json
53-
docker cp /path/to/biosamples.json mongoprod:tmp/biosamples.json
54-
docker cp /path/to/cohorts.json mongoprod:tmp/cohorts.json
55-
docker cp /path/to/datasets.json mongoprod:tmp/datasets.json
56-
docker cp /path/to/genomicVariations.json mongoprod:tmp/genomicVariations.json
57-
docker cp /path/to/individuals.json mongoprod:tmp/individuals.json
58-
docker cp /path/to/runs.json mongoprod:tmp/runs.json
62+
cd beacon/connections/mongo
5963
```
6064

65+
And execute the next commands (only the ones you need):
66+
6167
```bash
62-
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /tmp/datasets.json --collection datasets
63-
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /tmp/analyses.json --collection analyses
64-
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /tmp/biosamples.json --collection biosamples
65-
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /tmp/cohorts.json --collection cohorts
66-
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /tmp/genomicVariations.json --collection genomicVariations
67-
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /tmp/individuals.json --collection individuals
68-
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /tmp/runs.json --collection runs
68+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/datasets.json --collection datasets
69+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/individuals.json --collection individuals
70+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/cohorts.json --collection cohorts
71+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/analyses.json --collection analyses
72+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/biosamples.json --collection biosamples
73+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/genomicVariations.json --collection genomicVariations
74+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/runs.json --collection runs
75+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/targets.json --collection targets
76+
docker exec mongoprod mongoimport --jsonArray --uri "mongodb://root:[email protected]:27017/beacon?authSource=admin" --file /data/caseLevelData.json --collection caseLevelData
6977
```
7078

7179
This loads the JSON files inside of the `data` folder into the MongoDB database container. Each time you import data you will have to create indexes for the queries to run smoothly. Please, check the next point about how to Create the indexes.

beacon/conf/api_version.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
api_version: v2.0-9f42772
1+
api_version: v2.0-eeabc63

docker-compose.remote.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
version: '3.1'
2+
3+
services:
4+
beaconprod:
5+
build:
6+
context: .
7+
container_name: beaconprod
8+
ports:
9+
- "5050:5050"
10+
entrypoint: ['python','-m','beacon']
11+
volumes:
12+
- ./beacon/logs/logs.log:/beacon/logs/logs.log
13+
- ./beacon/conf/conf.py:/beacon/conf/conf.py
14+
- ./beacon/permissions:/beacon/permissions
15+
16+
idp:
17+
#image: quay.io/keycloak/keycloak:12.0.0
18+
image: sleighzy/keycloak
19+
hostname: idp
20+
container_name: idp
21+
environment:
22+
# - KEYCLOAK_FRONTEND_URL=http://idp:8080/auth
23+
# - KEYCLOAK_LOGLEVEL=DEBUG
24+
# - ROOT_LOGLEVEL=DEBUG
25+
- KEYCLOAK_USER=admin
26+
- KEYCLOAK_PASSWORD=secret
27+
- DB_USER=admin
28+
- DB_PASSWORD=secret
29+
- DB_VENDOR=postgres
30+
- DB_ADDR=127.0.0.1
31+
- DB_PORT=5432
32+
- DB_DATABASE=keycloak
33+
#- DB_SCHEMA=public
34+
- KEYCLOAK_IMPORT=/tmp/beacon-realm.json -Dkeycloak.profile.feature.upload_scripts=enabled -Dkeycloak.profile.feature.token_exchange=enabled -Dkeycloak.profile.feature.admin_fine_grained_authz=enabled
35+
- KEYCLOAK_HOSTNAME=localhost
36+
#- KC_HOSTNAME_URL=https://beacon-network-test2.ega-archive.org
37+
#- KC_HOSTNAME_ADMIN_URL=https://beacon-network-test2.ega-archive.org
38+
#- KEYCLOAK_FRONTEND_URL=https://beacon-network-test2.ega-archive.org/auth/
39+
#- PROXY_ADDRESS_FORWARDING=true
40+
volumes:
41+
- ./beacon/auth/realms/beacon-realm.json:/tmp/beacon-realm.json
42+
ports:
43+
- "8080:8080"
44+
- "9991:8443"
45+
46+
idp-db:
47+
image: postgres
48+
hostname: idp-db
49+
container_name: idp-db
50+
ports:
51+
- 5432:5432
52+
environment:
53+
- POSTGRES_DB=keycloak
54+
- POSTGRES_USER=admin
55+
- POSTGRES_PASSWORD=secret
56+
57+
db:
58+
image: mongo:5
59+
command: --wiredTigerCacheSizeGB 4
60+
hostname: mongo
61+
container_name: mongoprod
62+
ports:
63+
- 27017:27017
64+
environment:
65+
MONGO_INITDB_ROOT_USERNAME: root
66+
MONGO_INITDB_ROOT_PASSWORD: example
67+
MONGO_INITDB_DATABASE: beacon
68+
volumes:
69+
- ./beacon/connections/mongo/mongo-init/:/docker-entrypoint-initdb.d/:ro
70+
- ./beacon/connections/mongo/data/:/data
71+
- ./beacon/connections/mongo/data/db:/data/db
72+
- ./beacon/connections/mongo/data/configdb:/data/configdb
73+
- ./beacon/connections/mongo/data/caseLevelData:/data/caseLevelData
74+
#command: --verbose
75+
76+
beacon-ri-tools:
77+
image: ghcr.io/ega-archive/beacon2-ri-tools-v2:latest
78+
hostname: beacon-ri-tools
79+
container_name: ri-tools
80+
tty: true
81+
volumes:
82+
- ./ri-tools/output_docs:/usr/src/app/output_docs
83+
- ./ri-tools/conf:/usr/src/app/conf
84+
- ./ri-tools/files/vcf/files_to_read:/usr/src/app/files/vcf/files_to_read
85+
- ./ri-tools/csv:/usr/src/app/csv

0 commit comments

Comments
 (0)