-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
556 lines (526 loc) · 19.4 KB
/
Copy pathdocker-compose.yml
File metadata and controls
556 lines (526 loc) · 19.4 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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# define some macros for use later in the file
x-definitions:
build-args: &build-args
VERSION: ${VERSION}
GITHUB_SHA_FULL: ${GITHUB_SHA_FULL}
BUILD_DATE: ${BUILD_DATE}
DESCRIPTION: ${DESCRIPTION}
SOURCE_URL: ${SOURCE_URL}
WORKFLOW_VERSION: ${VERSION}
common-env: &common-env
DB_HOST: ${DB_HOST:-}
DB_PASS: ${DB_PASS:-}
DB_PORT: ${DB_PORT:-}
APERTUREDB_KEY: ${APERTUREDB_KEY:-}
CA_CERT: ${CA_CERT:-/ca/ca.crt}
build-labels: &build-labels
org.opencontainers.image.vendor: "Aperture Data"
org.opencontainers.image.version: "${VERSION}"
org.opencontainers.image.revision: "${GITHUB_SHA_FULL}"
org.opencontainers.image.created: "${BUILD_DATE}"
org.opencontainers.image.description: "${DESCRIPTION}"
org.opencontainers.image.source: "${SOURCE_URL}"
services:
ca:
image: nginx
restart: on-failure
command: |
bash -c "
openssl genpkey -algorithm RSA -out /ca/ca.key -aes256 -pass pass:1234
openssl req -x509 -new -nodes -key /ca/ca.key -sha256 -days 3650 -out /ca/ca.crt -subj \"/C=US/ST=CA/L=Los Gatos/O=ApertureData/OU=ApertureDataCA/CN=ApertureDataCA\" -passin pass:1234
openssl genrsa -out /cert/tls.key 4096
openssl req -new -key /cert/tls.key -out /ca/tcp.csr -days 3650 -subj \"/C=US/ST=NY/L=NYC/O=instance/OU=instanceDB/CN=${DB_TCP_CN:-localhost}\"
openssl x509 -req -CA /ca/ca.crt -CAkey /ca/ca.key -in /ca/tcp.csr -out /cert/tcp.crt -passin pass:1234
openssl req -new -key /cert/tls.key -out /ca/http.csr -days 3650 -subj \"/C=US/ST=NY/L=NYC/O=instance/OU=instanceDB/CN=${DB_HTTP_CN:-localhost}\"
openssl x509 -req -CA /ca/ca.crt -CAkey /ca/ca.key -in /ca/http.csr -out /cert/http.crt -passin pass:1234"
volumes:
- ./aperturedb/certificate:/cert
- ./ca:/ca
lenz:
depends_on:
ca:
condition: service_completed_successfully
aperturedb:
condition: service_healthy
image: aperturedata/lenz:latest
# ports:
# - 55555:55551
restart: always
healthcheck:
test:
- CMD-SHELL
- "bash -lc 'echo > /dev/tcp/127.0.0.1/$${LNZ_TCP_PORT}'"
interval: 2s
timeout: 1s
retries: 60
environment:
LNZ_HEALTH_PORT: 58085
LNZ_TCP_PORT: 55551
LNZ_HTTP_PORT: 8080
LNZ_ADB_BACKENDS: '["aperturedb:55553"]'
LNZ_REPLICAS: 1
LNZ_ADB_MAX_CONCURRENCY: 48
LNZ_FORCE_SSL: false
LNZ_CERTIFICATE_PATH: /etc/lenz/certificate/tcp.crt
LNZ_PRIVATE_KEY_PATH: /etc/lenz/certificate/tls.key
volumes:
- ./aperturedb/certificate:/etc/lenz/certificate
# not a workflow, but provided for convenience; used in tests
aperturedb:
healthcheck:
test:
- CMD-SHELL
- "bash -lc 'echo > /dev/tcp/127.0.0.1/55553'"
interval: 2s
timeout: 1s
retries: 60
image: aperturedata/aperturedb-community:latest
restart: always
environment:
ADB_MASTER_KEY: "admin"
ADB_PORT: 55553
ADB_KVGD_DB_SIZE: 204800
ADB_FORCE_SSL: false
ADB_ENABLE_DEBUG: 1
ADB_LOG_PATH: "logs"
webui:
image: aperturedata/aperturedata-platform-web-private:latest
restart: always
nginx:
depends_on:
ca:
condition: service_completed_successfully
image: nginx
restart: always
ports:
- 8087:80
- 8443:443
configs:
- source: nginx.conf
target: /etc/nginx/conf.d/default.conf
volumes:
- ./aperturedb/certificate:/etc/nginx/certificate
# base image for all workflows; intended for build only
base:
build:
context: ./base/docker
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-base:${VERSION}"
image: aperturedata/workflows-base:${VERSION}
crawl-website:
build:
context: ./apps/crawl-website
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-crawl-website:${VERSION}"
image: aperturedata/workflows-crawl-website:${VERSION}
depends_on:
lenz:
condition: service_healthy
environment:
<<: *common-env
WF_CLEAN: "${WF_CLEAN:-true}"
WF_START_URLS: "${WF_START_URLS:-https://docs.aperturedata.io/}"
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
WF_MAX_DOCUMENTS: "${WF_MAX_DOCUMENTS:-20}"
WF_OUTPUT: "${WF_OUTPUT:-crawl-to-rag}"
volumes:
- ./ca:/ca
embeddings-extraction:
build:
context: ./apps/embeddings-extraction
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-embeddings-extraction:${VERSION}"
image: aperturedata/workflows-embeddings-extraction:${VERSION}
depends_on:
lenz:
condition: service_healthy
# Don't let this service kill your dev box
# It's OK, but lets' not over compensate for it.
deploy:
resources:
limits:
cpus: '4.0'
memory: 4G
environment:
<<: *common-env
MODEL_NAME: "${MODEL_NAME:-ViT-B/16}"
NUMTHREADS: "${NUMTHREADS:-4}"
CLEAN: "${CLEAN:-true}"
RUN_ONCE: "${RUN_ONCE:-true}"
SLEEPING_TIME: "${SLEEPING_TIME:-30}"
WF_EXTRACT_IMAGES: "${WF_EXTRACT_IMAGES:-true}"
WF_EXTRACT_PDFS: "${WF_EXTRACT_PDFS:-true}"
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
ocr-extraction:
build:
context: ./apps/ocr-extraction
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-ocr-extraction:${VERSION}"
image: aperturedata/workflows-ocr-extraction:${VERSION}
# Don't let this service kill your dev box
deploy:
resources:
limits:
cpus: '2.0'
environment:
<<: *common-env
WF_EXTRACT_IMAGE_TEXT: "${WF_EXTRACT_IMAGE_TEXT:-true}"
WF_EXTRACT_PDF_TEXT: "${WF_EXTRACT_PDF_TEXT:-true}"
WF_GENERATE_EMBEDDINGS: "${WF_GENERATE_EMBEDDINGS:-true}"
WF_OCR_METHOD: "${WF_OCR_METHOD:-tesseract}"
CLEAN: "${CLEAN:-true}"
RUN_ONCE: "${RUN_ONCE:-true}"
SLEEPING_TIME: "${SLEEPING_TIME:-30}"
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
NUMTHREADS: "${NUMTHREADS:-4}"
jupyterlab:
build:
context: ./apps/jupyterlab
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-jupyterlab:${VERSION}"
image: aperturedata/workflows-jupyterlab:${VERSION}
depends_on:
lenz:
condition: service_healthy
ports:
- "8888:8888"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8888/login"]
interval: 3s
timeout: 3s
retries: 10
start_period: 20s
environment:
<<: *common-env
JUPYTER_TOKEN: "${JUPYTER_TOKEN:-test}"
PASSWORD: "${PASSWORD:-test}"
DB_HOST: blah
HAS_DB_INFO: false
volumes:
- ./ca:/ca
label-studio:
build:
context: ./apps/label-studio
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-label-studio:${VERSION}"
image: aperturedata/workflows-label-studio:${VERSION}
ports:
- "8888:8888"
environment:
<<: *common-env
WF_LOG_LEVEL: "info"
WF_LABEL_STUDIO_USER: "aperturedb@localhost"
WF_LABEL_STUDIO_PASSWORD: "41apertureDB3"
WF_LABEL_STUDIO_TOKEN: "PXq08K1kCwg9eTmhFPdwOgE5DEVvy5MejfW26p13EQvkse6w"
WF_LABEL_STUDIO_URL_PATH: "http://localhost:9000/labelstudio"
WF_LABEL_STUDIO_HANDLE_UNTAGGED: "TRUE"
# Not a workflow, but useful for debugging mcp-server
mcp-inspector:
image: allfunc/mcp-inspector:0.14.0
ports:
- "6274:6274"
- "6277:6277"
mcp-server:
build:
context: ./apps/mcp-server
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-mcp-server:${VERSION}"
image: aperturedata/workflows-mcp-server:${VERSION}
ports:
- "8001:8000"
environment:
<<: *common-env
WF_AUTH_TOKEN: "${WF_AUTH_TOKEN:-test}"
WF_INPUT: "${WF_INPUT:-crawl-to-rag}"
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
rag:
build:
context: ./apps/rag
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-rag:${VERSION}"
image: aperturedata/workflows-rag:${VERSION}
ports:
- "8002:8000"
depends_on:
text-embeddings:
condition: service_completed_successfully
environment:
<<: *common-env
WF_INPUT: "${WF_INPUT:-crawl-to-rag}"
WF_TOKEN: "${WF_TOKEN:-test}"
# WF_LLM_PROVIDER: "${WF_LLM_PROVIDER:-}"
# WF_LLM_API_KEY: "${WF_LLM_API_KEY:-}"
# WF_N_DOCUMENTS: "${WF_N_DOCUMENTS:-5}"
volumes:
- ./ca:/ca
sql-server:
build:
context: ./apps/sql-server
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-sql-server:${VERSION}"
image: aperturedata/workflows-sql-server:${VERSION}
ports:
- "5432:5432"
- "8005:80"
environment:
<<: *common-env
WF_AUTH_TOKEN: "${WF_AUTH_TOKEN:-test}"
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
text-embeddings:
build:
context: ./apps/text-embeddings
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-text-embeddings:${VERSION}"
image: aperturedata/workflows-text-embeddings:${VERSION}
depends_on:
text-extraction:
condition: service_completed_successfully
environment:
<<: *common-env
WF_INPUT: "${WF_INPUT:-crawl-to-rag}"
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
WF_OUTPUT: "${WF_OUTPUT:-crawl-to-rag}"
WF_MODEL: "${WF_MODEL:-openclip ViT-B-32 laion2b_s34b_b79k}"
WF_ENGINE: "${WF_ENGINE:-HNSW}"
WF_CLEAN: "${WF_CLEAN:-true}"
volumes:
- ./ca:/ca
text-extraction:
build:
context: ./apps/text-extraction
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-text-extraction:${VERSION}"
image: aperturedata/workflows-text-extraction:${VERSION}
depends_on:
crawl-website:
condition: service_completed_successfully
environment:
<<: *common-env
WF_INPUT: "${WF_INPUT:-crawl-to-rag}"
WF_OUTPUT: "${WF_OUTPUT:-crawl-to-rag}"
WF_CLEAN: "${WF_CLEAN:-true}"
WF_CSS_SELECTOR: "${WF_CSS_SELECTOR}"
volumes:
- ./ca:/ca
# Put this last because it depends on the others
crawl-to-rag:
build:
context: ./apps/crawl-to-rag
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-crawl-to-rag:${VERSION}"
image: aperturedata/workflows-crawl-to-rag:${VERSION}
ports:
- "8000:8000"
environment:
<<: *common-env
WF_LLM_PROVIDER: "${WF_LLM_PROVIDER:-openai}"
WF_LLM_API_KEY: "${WF_LLM_API_KEY:-}"
WF_TOKEN: "${WF_TOKEN:-test}"
WF_OUTPUT: "${WF_OUTPUT:-crawl-to-rag}"
WF_CLEAN: "${WF_CLEAN:-true}"
WF_START_URLS: "${WF_START_URLS:-https://docs.aperturedata.io/}"
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
WF_MAX_DOCUMENTS: "${WF_MAX_DOCUMENTS:-20}"
ingest-croissant:
build:
context: ./apps/ingest-croissant
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-ingest-croissant:${VERSION}"
image: aperturedata/workflows-ingest-croissant:${VERSION}
depends_on:
lenz:
condition: service_healthy
volumes:
- ./ca:/ca
- ./apps/ingest-croissant/test_data:/test_data
environment:
<<: *common-env
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
WF_CROISSANT_URL: "${WF_CROISSANT_URL:-https://huggingface.co/api/datasets/suyc21/MedicalConverter/croissant}"
WF_SAMPLE_COUNT: "${WF_SAMPLE_COUNT:--1}"
WF_FLATTEN_JSON: "${WF_FLATTEN_JSON:-false}"
dataset-ingestion:
build:
context: ./apps/dataset-ingestion
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-dataset-ingestion:${VERSION}"
image: aperturedata/workflows-dataset-ingestion:${VERSION}
depends_on:
lenz:
condition: service_healthy
volumes:
- ./ca:/ca
environment:
<<: *common-env
BATCH_SIZE: "${BATCH_SIZE:-100}"
NUM_WORKERS: "${NUM_WORKERS:-8}"
SAMPLE_COUNT: "${SAMPLE_COUNT:--1}"
DATASET: "${DATASET:-coco}"
INCLUDE_TRAIN: "${INCLUDE_TRAIN:-false}"
LOAD_CELEBAHQ: "${LOAD_CELEBAHQ:-false}"
WF_DATA_SOURCE_GCP_BUCKET: "${WF_DATA_SOURCE_GCP_BUCKET:-ad-demos-datasets}"
dataset-ingestion-movies:
build:
context: ./apps/dataset-ingestion-movies
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-dataset-ingestion-movies:${VERSION}"
image: aperturedata/workflows-dataset-ingestion-movies:${VERSION}
depends_on:
lenz:
condition: service_healthy
volumes:
- ./ca:/ca
environment:
<<: *common-env
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-DEBUG}"
SAMPLE_COUNT: "${SAMPLE_COUNT:--1}"
add-image:
image: aperturedata/wf-add-image:latest
depends_on:
lenz:
condition: service_healthy
volumes:
- ./ca:/ca
environment:
<<: *common-env
TOTAL_IMAGES: "${TOTAL_IMAGES:-100}"
face-detection:
build:
context: ./apps/face-detection
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-face-detection:${VERSION}"
image: aperturedata/workflows-face-detection:${VERSION}
depends_on:
lenz:
condition: service_healthy
add-image:
condition: service_completed_successfully
volumes:
- ./ca:/ca
environment:
<<: *common-env
RUN_ONCE: "${RUN_ONCE:-true}"
COLLECT_EMBEDDINGS: "${COLLECT_EMBEDDINGS:-true}"
object-detection:
build:
context: ./apps/object-detection
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-object-detection:${VERSION}"
image: aperturedata/workflows-object-detection:${VERSION}
depends_on:
lenz:
condition: service_healthy
add-image:
condition: service_completed_successfully
volumes:
- ./ca:/ca
environment:
<<: *common-env
RUN_ONCE: "${RUN_ONCE:-true}"
MODEL_NAME: "${MODEL_NAME:-frcnn-mobilenet}"
caption-image:
build:
context: ./apps/caption-image
args:
<<: *build-args
PRELOAD_MODEL: "${PRELOAD_MODEL:-false}"
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-caption-image:${VERSION}"
image: aperturedata/workflows-caption-image:${VERSION}
depends_on:
lenz:
condition: service_healthy
volumes:
- ./ca:/ca
environment:
<<: *common-env
RUN_ONCE: "${RUN_ONCE:-true}"
NUM_WORKERS: "${NUM_WORKERS:-1}"
BATCH_SIZE: "${BATCH_SIZE:-1}"
WF_LOG_LEVEL: "${WF_LOG_LEVEL:-WARNING}"
ingest-from-sql:
image: aperturedata/workflows-ingest-from-sql:${VERSION}
build:
context: ./apps/ingest-from-sql
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-ingest-from-sql:${VERSION}"
ingest-from-bucket:
image: aperturedata/workflows-ingest-from-bucket:${VERSION}
build:
context: ./apps/ingest-from-bucket
args:
<<: *build-args
labels:
<<: *build-labels
org.opencontainers.image.ref.name: "docker.io/aperturedata/workflows-ingest-from-bucket:${VERSION}"
configs:
nginx.conf:
content: |
server {
listen 80;
listen 443 ssl;
client_max_body_size 256m;
ssl_certificate /etc/nginx/certificate/http.crt;
ssl_certificate_key /etc/nginx/certificate/tls.key;
location / {
proxy_pass http://webui;
}
location /api/ {
proxy_pass http://lenz:8080;
}
}