-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcompose.yml
More file actions
440 lines (428 loc) · 12.2 KB
/
Copy pathcompose.yml
File metadata and controls
440 lines (428 loc) · 12.2 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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
services:
shepherd_server:
container_name: shepherd_server
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-supersecretpassw0rd}
# The server handles every client request (sync-query status polling,
# /callback lookups) so it needs a bigger Postgres pool than the
# workers' default of 10. Budget: each container has its own pool, so
# keep (sum of pool max sizes) under Postgres max_connections below.
POSTGRES_POOL_MIN_SIZE: 10
POSTGRES_POOL_MAX_SIZE: 30
build:
context: .
dockerfile: shepherd_server/Dockerfile
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
ports:
- '5439:5439'
shepherd_db:
container_name: shepherd_db
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-supersecretpassw0rd}
# Connection budget: every container holds its own psycopg pool, so the
# fleet ceiling is (containers x pool max size). 22 workers/monitor at the
# default max of 10, plus shepherd_server at 30, is 250 -- which overran
# the old 200 and surfaced as "sorry, too many clients already" under load
# even though the comments in this file and shepherd_utils/config.py both
# say the sum must stay under it. 300 restores the headroom the docs claim.
# Adding a worker service? Re-do this arithmetic.
command: postgres -c max_connections=300
build:
context: .
dockerfile: shepherd_db/Dockerfile
ports:
- "5432:5432"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U postgres -d postgres"]
interval: 2s
timeout: 2s
retries: 5
start_period: 60s
volumes:
- ./pgdata:/var/lib/postgresql/data
shepherd_broker:
container_name: shepherd_broker
build:
context: .
dockerfile: shepherd_broker/Dockerfile
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-supersecretpassword}
ports:
- "6379:6379"
restart: unless-stopped
# The default ``redis-cli ping`` healthcheck silently passed even before
# Redis was ready, because (a) it didn't authenticate (NOAUTH error still
# exits 0) and (b) during AOF/RDB load Redis answers ``LOADING`` instead
# of ``PONG``, which redis-cli also exits 0 on. Grepping for an exact
# ``PONG`` makes the check actually wait until Redis is fully online.
# ``start_period`` gives a large RDB time to load before failures count.
healthcheck:
test:
- "CMD-SHELL"
- 'redis-cli -a "$$REDIS_PASSWORD" --no-auth-warning ping | grep -qx PONG'
interval: 5s
timeout: 5s
retries: 10
start_period: 60s
volumes:
- ./data:/data
shepherd_broker_insight:
image: redislabs/redisinsight:latest
container_name: redis-insight
restart: unless-stopped
ports:
- '5540:5540'
volumes:
- ./data/redisinsight:/db
shepherd_monitor:
container_name: shepherd_monitor
build:
context: .
dockerfile: workers/monitor/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
ports:
- "5440:5440"
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
- ./workers/monitor/monitor_alerts.yaml:/app/monitor_alerts.yaml:ro
jaeger:
image: jaegertracing/all-in-one:1.55
ports:
- "16686:16686" # UI
- "4317:4317" # OTLP gRPC
- "6381:6381/udp" # Agent UDP (Jaeger native)
environment:
- COLLECTOR_OTLP_ENABLED=true
- LOG_LEVEL=error
########## Shared Workers
merge_message:
container_name: merge_message
build:
context: .
dockerfile: workers/merge_message/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
sort_results_score:
container_name: sort_results_score
build:
context: .
dockerfile: workers/sort_results_score/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
filter_results_top_n:
container_name: filter_results_top_n
build:
context: .
dockerfile: workers/filter_results_top_n/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
filter_kgraph_orphans:
container_name: filter_kgraph_orphans
build:
context: .
dockerfile: workers/filter_kgraph_orphans/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
finish_query:
container_name: finish_query
build:
context: .
dockerfile: workers/finish_query/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
filter_analyses_top_n:
container_name: filter_analyses_top_n
build:
context: .
dockerfile: workers/filter_analyses_top_n/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
score_paths:
container_name: score_paths
build:
context: .
dockerfile: workers/score_paths/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
# First run? Set PATHFINDER_EMBEDDINGS_URL in your .env to a .tar.gz and
# the worker downloads + extracts the embeddings LMDB into this mount on
# startup (see README "Worker data (LMDB / sqlite) downloads").
- ./pathfinder_embeddings:/app/pathfinder_embeddings
######### Example ARA
example_ara:
container_name: example_ara
build:
context: .
dockerfile: workers/example_ara/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
example_lookup:
container_name: example_lookup
build:
context: .
dockerfile: workers/example_lookup/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
example_score:
container_name: example_score
build:
context: .
dockerfile: workers/example_score/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
######### ARAGORN
aragorn:
container_name: aragorn
build:
context: .
dockerfile: workers/aragorn/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
aragorn_lookup:
container_name: aragorn_lookup
build:
context: .
dockerfile: workers/aragorn_lookup/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
aragorn_pathfinder:
container_name: aragorn_pathfinder
build:
context: .
dockerfile: workers/aragorn_pathfinder/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
aragorn_omnicorp:
container_name: aragorn_omnicorp
build:
context: .
dockerfile: workers/aragorn_omnicorp/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
# First run? Set OMNICORP_LMDB_URL in your .env to a .tar.gz and the worker
# downloads + extracts curies.lmdb / shared_counts.lmdb into this mount on
# startup (see README "Worker data (LMDB / sqlite) downloads").
- ./omnicorp_lmdb:/app/omnicorp_lmdb
aragorn_score:
container_name: aragorn_score
build:
context: .
dockerfile: workers/aragorn_score/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
######### ARAX
arax:
container_name: arax
build:
context: .
dockerfile: workers/arax/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
arax_pathfinder:
container_name: arax_pathfinder
build:
context: .
dockerfile: workers/arax_pathfinder/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
# First run? The worker downloads its two sqlite dbs from
# kg2webhost.rtx.ai, plus the ARAX blocked-concept list from GitHub, on
# startup -- no credentials needed. All three live here, so they persist
# across restarts instead of being re-fetched by each new container. Set
# ARAX_PATHFINDER_TIER_VERSION in your .env if you need a tier other than
# the default (see README "Worker data (LMDB / sqlite) downloads").
# Deploying elsewhere? ARAX_PATHFINDER_DBS_DIR must point at the mount --
# it defaults to a path relative to /app, and a mismatch silently
# re-downloads everything instead of using the mounted copies.
- ./arax_pathfinder_dbs:/app/arax_pathfinder_dbs
arax_rank:
container_name: arax_rank
build:
context: .
dockerfile: workers/arax_rank/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
######### BTE
bte:
container_name: bte
build:
context: .
dockerfile: workers/bte/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
bte_lookup:
container_name: bte_lookup
build:
context: .
dockerfile: workers/bte_lookup/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env
######### SIPR
sipr:
container_name: sipr
build:
context: .
dockerfile: workers/sipr/Dockerfile
restart: unless-stopped
depends_on:
shepherd_db:
condition: service_healthy
shepherd_broker:
condition: service_healthy
volumes:
- ./logs:/app/logs
- ./.env:/app/.env