Skip to content

Commit a55be7b

Browse files
authored
feat: Drop container names and set project names (#9)
* Remove hardcoded container names from all services in the docker-compose files to allow multiple instances of the same service to run in parallel without conflicts. This is important to allow both scaling individual services as well as running multiple instances of the CMS stack locally for testing purposes. * Set the top-level project name in the docker-compose files so that it can be used as the default prefix for container names. Use 'cms' for all stacks apart from the load tests (i.e. 'cms-load') and the dev deployment (i.e. 'dev-cms'). The project name can be overridden on deployment through the '-p' command line flag or by setting the 'COMPOSE_PROJECT_NAME' environment variable. Signed-off-by: Phoevos Kalemkeris <[email protected]>
1 parent ac0a8c1 commit a55be7b

9 files changed

+25
-31
lines changed

docker-compose-auth.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
version: "3.6"
22

3+
name: cms
4+
35
services:
46

57
auth-db:
68
image: postgres:14
7-
container_name: cms_auth-db
89
restart: always
910
networks:
1011
- cogstack-model-serve_cms

docker-compose-celery.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
version: "3.6"
22

3+
name: cms
4+
35
services:
46
worker:
57
build:
@@ -12,7 +14,6 @@ services:
1214
- HTTP_PROXY=$HTTP_PROXY
1315
- HTTPS_PROXY=$HTTPS_PROXY
1416
- NO_PROXY=$NO_PROXY
15-
container_name: cms_worker
1617
networks:
1718
- cms
1819
volumes:
@@ -32,7 +33,6 @@ services:
3233
build:
3334
context: ./
3435
dockerfile: ./docker/celery/Dockerfile-Dashboard
35-
container_name: cms_worker_dashboard
3636
networks:
3737
- cms
3838
ports:
@@ -45,7 +45,6 @@ services:
4545

4646
redis:
4747
image: redis:7
48-
container_name: cms_redis
4948
networks:
5049
- cms
5150
ports:

docker-compose-dev.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# This is for spinning up core services as single hosts in the DEV environment
22
version: "3.6"
33

4+
name: dev-cms
5+
46
services:
57

68
medcat-snomed:
79
extends:
810
file: ./docker-compose.yml
911
service: medcat-snomed
1012
image: cogstack-model-serve_medcat-snomed:dev
11-
container_name: dev-cms_medcat-snomed
1213
volumes:
1314
- ${MODEL_PACKAGE_FULL_PATH}:/app/model/model.zip:ro
1415
environment:
@@ -37,7 +38,6 @@ services:
3738
file: ./docker-compose.yml
3839
service: medcat-icd10
3940
image: cogstack-model-serve_medcat-icd10:dev
40-
container_name: dev-cms_medcat-icd10
4141
environment:
4242
- BASE_MODEL_FULL_PATH=$MODEL_PACKAGE_FULL_PATH
4343
- AWS_ACCESS_KEY_ID=
@@ -64,7 +64,6 @@ services:
6464
file: ./docker-compose.yml
6565
service: de-identification
6666
image: cogstack-model-serve_de-identification:dev
67-
container_name: dev-cms_trf-deid
6867
environment:
6968
- BASE_MODEL_FULL_PATH=$MODEL_PACKAGE_FULL_PATH
7069
- AWS_ACCESS_KEY_ID=
@@ -91,7 +90,6 @@ services:
9190
file: ./docker-compose.yml
9291
service: medcat-deid
9392
image: cogstack-model-serve_medcat-deid:dev
94-
container_name: dev-cms_medcat-deid
9593
environment:
9694
- BASE_MODEL_FULL_PATH=$MODEL_PACKAGE_FULL_PATH
9795
- AWS_ACCESS_KEY_ID=
@@ -118,7 +116,6 @@ services:
118116
file: ./docker-compose.yml
119117
service: medcat-umls
120118
image: cogstack-model-serve_medcat-umls:dev
121-
container_name: dev-cms_medcat-umls
122119
environment:
123120
- BASE_MODEL_FULL_PATH=$MODEL_PACKAGE_FULL_PATH
124121
- AWS_ACCESS_KEY_ID=

docker-compose-log.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
version: "3.6"
22

3+
name: cms
4+
35
services:
46

57
mongodb:
68
image: mongo:5.0
7-
container_name: cms_mongodb
89
volumes:
910
- mongodb_data:/data/db
1011
restart: always
@@ -20,7 +21,6 @@ services:
2021

2122
opensearch:
2223
image: opensearchproject/opensearch:2.4.0
23-
container_name: cms_opensearch
2424
environment:
2525
- OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g
2626
- bootstrap.memory_lock=true
@@ -47,7 +47,6 @@ services:
4747

4848
graylog:
4949
image: graylog/graylog:5.0
50-
container_name: cms_graylog
5150
depends_on:
5251
opensearch:
5352
condition: "service_healthy"

docker-compose-mlflow.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
version: "3.6"
22

3+
name: cms
4+
35
services:
46

57
mlflow-db:
68
image: postgres:14
7-
container_name: cms_mlflow-db
89
restart: always
910
networks:
1011
- cogstack-model-serve_cms
@@ -24,7 +25,6 @@ services:
2425

2526
minio:
2627
image: minio/minio:RELEASE.2022-06-30T20-58-09Z
27-
container_name: cms_minio
2828
restart: always
2929
networks:
3030
- cogstack-model-serve_cms
@@ -71,7 +71,6 @@ services:
7171
- HTTP_PROXY=$HTTP_PROXY
7272
- HTTPS_PROXY=$HTTPS_PROXY
7373
- NO_PROXY=$NO_PROXY
74-
container_name: cms_mlflow-ui
7574
restart: always
7675
networks:
7776
- cogstack-model-serve_cms
@@ -80,7 +79,7 @@ services:
8079
environment:
8180
- MLFLOW_DB_USERNAME=$MLFLOW_DB_USERNAME
8281
- MLFLOW_DB_PASSWORD=$MLFLOW_DB_PASSWORD
83-
- MLFLOW_BACKEND_STORE_URI=postgresql://$MLFLOW_DB_USERNAME:$MLFLOW_DB_PASSWORD@cms_mlflow-db:5432/mlflow-backend-store
82+
- MLFLOW_BACKEND_STORE_URI=postgresql://$MLFLOW_DB_USERNAME:$MLFLOW_DB_PASSWORD@mlflow-db:5432/mlflow-backend-store
8483
- MLFLOW_TRACKING_URI=http://localhost:5000
8584
- ARTIFACTS_DESTINATION=s3://cms-model-bucket
8685
- MLFLOW_S3_ENDPOINT_URL=http://minio:9000
@@ -121,7 +120,6 @@ services:
121120
- NO_PROXY=$NO_PROXY
122121
profiles:
123122
- wip
124-
container_name: cms_mlflow-deployments
125123
restart: always
126124
networks:
127125
- cogstack-model-serve_cms
@@ -153,7 +151,8 @@ services:
153151
- NO_PROXY=$NO_PROXY
154152
profiles:
155153
- wip
156-
container_name: cms_mlflow-${MODEL_NAME:-model}
154+
labels:
155+
- org.cogstack.model-serve.model-name=${MODEL_NAME:-model}
157156
restart: always
158157
networks:
159158
- cogstack-model-serve_cms

docker-compose-mon.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
version: "3.6"
22

3+
name: cms
4+
35
services:
46

57
prometheus:
68
image: prom/prometheus:v2.41.0
7-
container_name: cms_prometheus
89
restart: always
910
networks:
1011
- cogstack-model-serve_cms
@@ -29,7 +30,6 @@ services:
2930

3031
grafana:
3132
image: grafana/grafana:9.3.2-ubuntu
32-
container_name: cms_grafana
3333
restart: always
3434
networks:
3535
- cogstack-model-serve_cms
@@ -51,7 +51,6 @@ services:
5151

5252
alertmanager:
5353
image: prom/alertmanager:v0.25.0
54-
container_name: cms_alertmanager
5554
restart: always
5655
networks:
5756
- cogstack-model-serve_cms
@@ -73,7 +72,6 @@ services:
7372

7473
cadvisor:
7574
image: gcr.io/cadvisor/cadvisor:v0.46.0
76-
container_name: cms_cadvisor
7775
restart: always
7876
networks:
7977
- cogstack-model-serve_cms

docker-compose-proxy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
version: "3.6"
22

3+
name: cms
4+
35
services:
46

57
proxy:
@@ -10,7 +12,6 @@ services:
1012
- HTTP_PROXY=$HTTP_PROXY
1113
- HTTPS_PROXY=$HTTPS_PROXY
1214
- NO_PROXY=$NO_PROXY
13-
container_name: cms_proxy
1415
restart: always
1516
networks:
1617
- cogstack-model-serve_cms

docker-compose.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
version: "3.6"
22

3+
name: cms
4+
35
services:
46

57
medcat-snomed:
@@ -13,7 +15,6 @@ services:
1315
- HTTP_PROXY=$HTTP_PROXY
1416
- HTTPS_PROXY=$HTTPS_PROXY
1517
- NO_PROXY=$NO_PROXY
16-
container_name: cms_medcat-snomed
1718
restart: always
1819
networks:
1920
- cms
@@ -63,7 +64,6 @@ services:
6364
- HTTP_PROXY=$HTTP_PROXY
6465
- HTTPS_PROXY=$HTTPS_PROXY
6566
- NO_PROXY=$NO_PROXY
66-
container_name: cms_medcat-icd10
6767
restart: always
6868
networks:
6969
- cms
@@ -113,7 +113,6 @@ services:
113113
- HTTP_PROXY=$HTTP_PROXY
114114
- HTTPS_PROXY=$HTTPS_PROXY
115115
- NO_PROXY=$NO_PROXY
116-
container_name: cms_trf-deid
117116
restart: always
118117
networks:
119118
- cms
@@ -162,7 +161,6 @@ services:
162161
- HTTP_PROXY=$HTTP_PROXY
163162
- HTTPS_PROXY=$HTTPS_PROXY
164163
- NO_PROXY=$NO_PROXY
165-
container_name: cms_medcat-deid
166164
restart: always
167165
networks:
168166
- cms
@@ -212,7 +210,6 @@ services:
212210
- HTTP_PROXY=$HTTP_PROXY
213211
- HTTPS_PROXY=$HTTPS_PROXY
214212
- NO_PROXY=$NO_PROXY
215-
container_name: cms_medcat-umls
216213
restart: always
217214
networks:
218215
- cms
@@ -262,7 +259,6 @@ services:
262259
- HTTP_PROXY=$HTTP_PROXY
263260
- HTTPS_PROXY=$HTTPS_PROXY
264261
- NO_PROXY=$NO_PROXY
265-
container_name: cms_huggingface-ner
266262
restart: always
267263
networks:
268264
- cms

tests/load/docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
version: "3"
22

3+
name: cms-load
4+
35
services:
46
master:
57
image: locustio/locust:2.26.0
6-
container_name: cms_load_master
8+
labels:
9+
- org.cogstack.model-serve.locust=master
710
networks:
811
- cogstack-model-serve_cms
912
ports:
@@ -25,7 +28,8 @@ services:
2528

2629
worker:
2730
image: locustio/locust:2.26.0
28-
container_name: cms_load_worker
31+
labels:
32+
- org.cogstack.model-serve.locust=worker
2933
networks:
3034
- cogstack-model-serve_cms
3135
environment:

0 commit comments

Comments
 (0)