-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
392 lines (377 loc) · 10.8 KB
/
docker-compose.yaml
File metadata and controls
392 lines (377 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
services:
# broker for celery
rabbitmq:
restart: unless-stopped
image: docker.io/rabbitmq:3.11.5-alpine
container_name: nomad_oasis_rabbitmq
environment:
- RABBITMQ_ERLANG_COOKIE=SWQOKODSQALRPCLNMEQG
- RABBITMQ_DEFAULT_USER=rabbitmq
- RABBITMQ_DEFAULT_PASS=rabbitmq
- RABBITMQ_DEFAULT_VHOST=/
volumes:
- rabbitmq:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "--silent", "--quiet", "ping"]
interval: 10s
timeout: 10s
retries: 30
start_period: 10s
# the search engine
elastic:
restart: unless-stopped
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.28
container_name: nomad_oasis_elastic
environment:
- ES_JAVA_OPTS=-Xms512m -Xmx512m
- discovery.type=single-node
volumes:
- elastic:/usr/share/elasticsearch/data
healthcheck:
test:
- "CMD"
- "curl"
- "--fail"
- "--silent"
- "http://elastic:9200/_cat/health"
interval: 10s
timeout: 10s
retries: 30
start_period: 60s
# the user data db
mongo:
restart: unless-stopped
image: docker.io/mongo:5.0.6
container_name: nomad_oasis_mongo
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
volumes:
- /nomad/mongo:/data/db
- /nomad/mongo_config:/data/configdb
- /nomad/.volumes/mongo:/backup
command: mongod --logpath=/dev/null # --quiet
healthcheck:
test:
- "CMD"
- "mongo"
- "mongo:27017/test"
- "--quiet"
- "--eval"
- "'db.runCommand({ping:1}).ok'"
interval: 10s
timeout: 10s
retries: 30
start_period: 10s
postgresql:
container_name: nomad_oasis_postgresql
environment:
POSTGRES_PASSWORD: temporal
POSTGRES_USER: temporal
image: docker.io/postgres:16
volumes:
- postgresql:/var/lib/postgresql/data
temporal:
container_name: nomad_oasis_temporal
depends_on:
- postgresql
environment:
- DB=postgres12
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_SEEDS=postgresql
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CLI_ADDRESS=temporal:7233
image: docker.io/temporalio/auto-setup:1.28
healthcheck:
test: >
bash -c '
temporal operator cluster health --address $$(hostname -i):7233 |
grep -q "SERVING"
'
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
# nomad worker (processing)
worker:
restart: unless-stopped
image: ghcr.io/exciting/sol-oasis:main
platform: linux/amd64
environment:
NOMAD_SERVICE: nomad_oasis_worker
NOMAD_RABBITMQ_HOST: rabbitmq
NOMAD_ELASTIC_HOST: elastic
NOMAD_MONGO_HOST: mongo
NOMAD_LOGSTASH_HOST: logtransfer
NOMAD_TEMPORAL_HOST: temporal
env_file:
- ./.env
depends_on:
temporal:
condition: service_healthy
rabbitmq:
condition: service_healthy
elastic:
condition: service_healthy
mongo:
condition: service_healthy
volumes:
- ./configs/nomad.yaml:/app/nomad.yaml
- /nomad/.volumes/fs:/app/.volumes/fs
command: python -m nomad.cli admin run action-internal-worker
healthcheck:
# See https://keithtenzer.com/temporal/Deploying_Temporal_Worker_on_Kubernetes/#liveliness-and-readiness-probes
# for rationale on using 'ls /' as a liveness/readiness probe for Temporal workers.
test: ls /
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
deploy:
replicas: 2
resources:
limits:
cpus: "4.0" # Maximum 4 CPU cores
memory: 8G # Maximum 4GB RAM
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 15
window: 1800s
## nomad gpu worker (actions)
# gpu_worker:
# restart: unless-stopped
# image: ghcr.io/fairmat-nfdi/nomad-distro-template/gpu-action:main
# platform: linux/amd64
# container_name: nomad_oasis_gpu_worker
# env_file:
# - ./.env
# deploy:
# replicas: 1
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all # Use all available GPUs
# capabilities: [gpu]
# environment:
# NOMAD_SERVICE: nomad_oasis_gpu_worker
# NOMAD_RABBITMQ_HOST: rabbitmq
# NOMAD_ELASTIC_HOST: elastic
# NOMAD_MONGO_HOST: mongo
# NOMAD_LOGSTASH_HOST: logtransfer
# NOMAD_TEMPORAL_HOST: temporal
# depends_on:
# rabbitmq:
# condition: service_healthy
# elastic:
# condition: service_healthy
# mongo:
# condition: service_healthy
# temporal:
# condition: service_healthy
# volumes:
# # - ./configs/nomad.yaml:/app/nomad.yaml
# - ./.volumes/fs:/app/.volumes/fs
# command: python -m nomad.cli admin run action-gpu-worker
# # nomad cpu worker (actions)
# cpu_worker:
# restart: unless-stopped
# image: ghcr.io/fairmat-nfdi/nomad-distro-template/cpu-action:main
# platform: linux/amd64
# container_name: nomad_oasis_cpu_worker
# env_file:
# - ./.env
# environment:
# NOMAD_SERVICE: nomad_oasis_cpu_worker
# NOMAD_RABBITMQ_HOST: rabbitmq
# NOMAD_ELASTIC_HOST: elastic
# NOMAD_MONGO_HOST: mongo
# NOMAD_LOGSTASH_HOST: logtransfer
# NOMAD_TEMPORAL_HOST: temporal
# deploy:
# replicas: 1
# resources:
# limits:
# cpus: "2.0" # Maximum 2 CPU cores
# memory: 8G # Maximum 8GB RAM
# depends_on:
# rabbitmq:
# condition: service_healthy
# elastic:
# condition: service_healthy
# mongo:
# condition: service_healthy
# temporal:
# condition: service_healthy
# volumes:
# # - ./configs/nomad.yaml:/app/nomad.yaml
# - ./.volumes/fs:/app/.volumes/fs
# command: python -m nomad.cli admin run action-cpu-worker
# nomad app (api + proxy)
app:
restart: unless-stopped
image: ghcr.io/exciting/sol-oasis:main
platform: linux/amd64
container_name: nomad_oasis_app
environment:
NOMAD_SERVICE: nomad_oasis_app
NOMAD_SERVICES_API_PORT: 80
NOMAD_FS_EXTERNAL_WORKING_DIRECTORY: "$PWD"
NOMAD_RABBITMQ_HOST: rabbitmq
NOMAD_ELASTIC_HOST: elastic
NOMAD_MONGO_HOST: mongo
NOMAD_LOGSTASH_HOST: logtransfer
NOMAD_NORTH_HUB_HOST: north
NOMAD_TEMPORAL_HOST: temporal
env_file:
- ./.env
depends_on:
temporal:
condition: service_healthy
rabbitmq:
condition: service_healthy
elastic:
condition: service_healthy
mongo:
condition: service_healthy
north:
condition: service_started
volumes:
- ./configs/nomad.yaml:/app/nomad.yaml
- /nomad/.volumes/fs:/app/.volumes/fs
command: ./run.sh
healthcheck:
test:
- "CMD"
- "curl"
- "--fail"
- "--silent"
- "http://localhost:8000/-/health"
interval: 10s
timeout: 10s
retries: 30
start_period: 10s
# nomad remote tools hub (JupyterHUB, e.g. for AI Toolkit)
north:
restart: unless-stopped
image: ghcr.io/exciting/sol-oasis:main
platform: linux/amd64
container_name: nomad_oasis_north
environment:
NOMAD_SERVICE: nomad_oasis_north
NOMAD_NORTH_DOCKER_NETWORK: nomad_oasis_network
NOMAD_NORTH_HUB_CONNECT_IP: north
NOMAD_NORTH_HUB_IP: "0.0.0.0"
NOMAD_NORTH_HUB_HOST: north
NOMAD_SERVICES_API_HOST: app
NOMAD_FS_EXTERNAL_WORKING_DIRECTORY: "$PWD"
NOMAD_RABBITMQ_HOST: rabbitmq
NOMAD_ELASTIC_HOST: elastic
NOMAD_MONGO_HOST: mongo
env_file:
- ./.env
volumes:
- ./configs/nomad.yaml:/app/nomad.yaml
- /nomad/.volumes/fs:/app/.volumes/fs
- /var/run/docker.sock:/var/run/docker.sock
user: "1000:991"
command: python -m nomad.cli admin run hub
healthcheck:
test:
- "CMD"
- "curl"
- "--fail"
- "--silent"
- "http://localhost:8081/nomad-oasis/north/hub/health"
interval: 10s
timeout: 10s
retries: 30
start_period: 10s
# nomad logtransfer
# to enable the logtransfer service run "docker compose --profile with_logtransfer up"
logtransfer:
restart: unless-stopped
image: ghcr.io/exciting/sol-oasis:main
platform: linux/amd64
container_name: nomad_oasis_logtransfer
environment:
NOMAD_SERVICE: nomad_oasis_logtransfer
NOMAD_ELASTIC_HOST: elastic
NOMAD_MONGO_HOST: mongo
env_file:
- ./.env
depends_on:
elastic:
condition: service_healthy
mongo:
condition: service_healthy
volumes:
- ./configs/nomad.yaml:/app/nomad.yaml
- ./.volumes/fs:/app/.volumes/fs
command: python -m nomad.cli admin run logtransfer
profiles: ["with_logtransfer"]
# nomad proxy (a reverse proxy for nomad)
proxy:
restart: unless-stopped
image: docker.io/nginx:1.27.4-alpine
container_name: nomad_oasis_proxy
command: nginx -g 'daemon off;'
volumes:
- ./configs/nginx.ssl.conf:/etc/nginx/conf.d/default.conf:ro
- ./configs/nginx.full.conf:/etc/nginx/nginx.conf:ro
- ${CERT_LOCAL_PATH}:/etc/nginx/ssl/:ro
depends_on:
app:
condition: service_healthy
worker:
condition: service_started # TODO: service_healthy
north:
condition: service_healthy
ports:
- 80:80
- 443:443
- 27010:27010
# jupyterlab image: (this is only used to pull the image, no service is run for this)
jupyterlab_image:
image: ghcr.io/exciting/sol-oasis/jupyter:main
platform: linux/amd64
container_name: nomad_jupyter_image
pull_policy: always
entrypoint: ["true"]
deploy:
replicas: 0 # Ensures the service isn't started
jobflow_db:
image: mongo:8.0
container_name: jobflow_mongo
restart: unless-stopped
environment:
- MONGO_DATA_DIR=/data/db
env_file: .env
command: mongod --logpath=/dev/null --auth --wiredTigerCacheSizeGB 4 #quiet, require authentification, limit cache size to 4 GB
volumes:
- /jobflow_db/jobflow_mongo:/data/db
- /jobflow_db/jobflow_mongo_backup:/backup
- ./configs/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
- ./configs/jobflow-users.js:/jobflow/jobflow-users.js
volumes:
mongo:
name: "nomad_oasis_mongo"
mongo_config:
name: "nomad_oasis_mongo_config"
elastic:
name: "nomad_oasis_elastic"
rabbitmq:
name: "nomad_oasis_rabbitmq"
keycloak:
name: "nomad_oasis_keycloak"
postgresql:
name: "nomad_oasis_postgresql"
networks:
default:
name: nomad_oasis_network
driver_opts:
# adapt MTU for HU network
com.docker.network.driver.mtu: 1396