-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.ytt.yaml
773 lines (732 loc) · 25.9 KB
/
docker-compose.ytt.yaml
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
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
#@ load("@ytt:data", "data")
#@ load("@ytt:template", "template")
---
#@ def skill_image_name(skill):
#@ return "ukpsquare/skill-" + skill.name + ":" + data.values.tag
#@ end
#@ def skill_build(skill):
#@ return {"context": "./skills", "args": { "skill": skill.name}}
#@ end
#@ def skill_environment(skill):
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
SQUARE_API_URL: #@ data.values.square_api_url[data.values.environment]
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
REALM: #@ data.values.realm
CLIENT_ID: #@ skill.author + "-" + skill.name
#@ end
#@ def skill_env_file(skill):
#@ return ["./skills/" + skill.name + "/.env"]
#@ end
#@ def frontend_traefik_redirect():
#@ if data.values.environment == "production":
#@ return [
#@ "traefik.http.routers.frontend.rule=Host(`" + data.values.frontend_url[data.values.environment] + "`) || Host(`square.ukp.informatik.tu-darmstadt.de`)",
#@ "traefik.http.routers.frontend.middlewares=tuda-redirect",
#@ "traefik.http.middlewares.tuda-redirect.redirectregex.regex=^https://square.ukp.informatik.tu-darmstadt.de/(.*)",
#@ "traefik.http.middlewares.tuda-redirect.redirectregex.replacement=https://" + data.values.frontend_url[data.values.environment] + "/$${1}",
#@ "traefik.http.middlewares.tuda-redirect.redirectregex.permanent=true"
#@ ]
#@ else:
#@ return [
#@ "traefik.http.routers.frontend.rule=Host(`" + data.values.frontend_url[data.values.environment] + "`)"
#@ ]
#@ end
#@ end
#@ def traefik_tls(service):
#@ return [
#@ "traefik.http.routers." + service + ".entrypoints=websecure",
#@ "traefik.http.routers." + service + ".tls=true",
#@ "traefik.http.routers." + service + ".tls.certresolver=le"
#@ ]
#@ end
#@ def traefik_prefix(service):
#@ return [
#@ "traefik.http.routers." + service + ".rule=PathPrefix(`/api/" + service + "`)",
#@ "traefik.http.routers." + service + ".middlewares=" + service + "-stripprefix," + service + "-addprefix",
#@ "traefik.http.middlewares." + service + "-stripprefix.stripprefix.prefixes=/api/" + service,
#@ "traefik.http.middlewares." + service + "-addprefix.addPrefix.prefix=/api"
#@ ]
#@ end
version: "3.4"
services:
traefik:
image: traefik:v2.8.7
container_name: traefik
command:
- --api.insecure=true
- --api.dashboard=true
- --log.level=DEBUG
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --accesslog=true
- --accesslog.format=json
- --accesslog.filepath=/var/log/traefik/access.log.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --certificatesresolvers.le.acme.storage=/certificates/acme.json
- #@ "--certificatesresolvers.le.acme.email=" + data.values.email
#@ if/end data.values.environment == "local":
- --certificatesresolvers.le.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --ping
labels:
- "traefik.enable=true"
#! Global redirect to https
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=https-redirect"
#! Middleware redirect from HTTP to HTTPS
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
- traefik.http.routers.traefik.service=api@internal
- traefik.http.routers.traefik.middlewares=auth
- traefik.http.middlewares.auth.basicauth.users=admin:${SQUARE_ADMIN_PASSWORD}
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-public-certificates:/certificates
healthcheck:
test: traefik healthcheck --ping
interval: 20s
timeout: 10s
retries: 10
keycloak:
image: sihebi/keycloak:16.1.1
environment:
DB_VENDOR: postgres
DB_ADDR: db
DB_PORT: 5432
DB_USER: square
DB_SCHEMA: public
DB_DATABASE: keycloak
PROXY_ADDRESS_FORWARDING: "true"
KEYCLOAK_HOSTNAME: #@ data.values.keycloak_base_url[data.values.environment]
KEYCLOAK_FRONTEND_URL: #@ data.values.keycloak_base_url[data.values.environment] + "/auth"
env_file:
- ./keycloak/.env
depends_on:
- db
labels:
- "traefik.enable=true"
- #@ "traefik.http.routers.keycloak.rule=Host(`" + data.values.keycloak_base_url[data.values.environment] + "`) && PathPrefix(`/auth`)"
- #@ template.replace(traefik_tls("keycloak"))
volumes:
- ./keycloak/themes/terms.ftl:/opt/jboss/keycloak/themes/base/login/terms.ftl
- ./keycloak/themes/register.ftl:/opt/jboss/keycloak/themes/base/login/register.ftl
db:
image: postgres:14
restart: always
ports:
- 5432:5432
environment:
POSTGRES_DB: square
env_file:
- ./postgres/.env
volumes:
- db-data:/var/lib/postgresql/data
- ./postgres/init:/docker-entrypoint-initdb.d/
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 20s
timeout: 10s
retries: 10
virtuoso:
image: tenforce/virtuoso:virtuoso7.2.5
environment:
VIRT_Database_DatabaseFile: /data/virtuoso_db/virtuoso.db
VIRT_Database_ErrorLogFile: /data/virtuoso_db/virtuoso.log
VIRT_Database_LockFile: /data/virtuoso_db/virtuoso.lck
VIRT_TransactionFile_LockFile: /data/virtuoso_db/virtuoso.trx
VIRT_xa_persistent_file: /data/virtuoso_db/virtuoso.pxa
VIRT_Database_ErrorLogLevel: 7
VIRT_Database_FileExtend: 200
VIRT_Database_MaxCheckpointRemap: 2000
VIRT_Database_Striping: 0
VIRT_Database_TempStorage: TempDatabase
VIRT_TempDatabase_DatabaseFile: /data/virtuoso_db/virtuoso-temp.db
VIRT_TempDatabase_TransactionFile: /data/virtuoso_db/virtuoso-temp.trx
VIRT_Parameters_O_DIRECT: 1
VIRT_Parameters_ServerThreads: 100
VIRT_Parameters_CheckpointInterval: 0
VIRT_Parameters_NumberOfBuffers: 340000
VIRT_Parameters_MaxDirtyBuffers: 250000
VIRT_HTTPServer_ServerThreads: 100
VIRT_HTTPServer_MaxKeepAlives: 50
VIRT_SPARQL_MaxQueryCostEstimationTime: 600
VIRT_SPARQL_MaxQueryExecutionTime: 180
volumes:
- virtuoso-db:/data/
ports:
- 8890:8890
labels:
- "traefik.enable=true"
- #@ template.replace(traefik_tls("virtuoso"))
- "traefik.http.routers.virtuoso.rule=PathPrefix(`/virtuoso`)"
- "traefik.http.routers.virtuoso.middlewares=virtuoso-stripprefix"
- "traefik.http.middlewares.virtuoso-stripprefix.stripprefix.prefixes=/virtuoso"
- "traefik.http.services.virtuoso.loadbalancer.server.port=8890"
frontend:
build:
context: ./frontend
args:
mode: #@ "" + data.values.environment
image: #@ "ukpsquare/frontend:" + data.values.tag
restart: always
expose:
- 80
- 443
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.priority=1"
- #@ template.replace(traefik_tls("frontend"))
- #@ template.replace(frontend_traefik_redirect())
docs:
image: #@ "ukpsquare/docs:" + data.values.tag
build: ./docs
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
labels:
- "traefik.enable=true"
- "traefik.http.routers.docs.rule=PathPrefix(`/docs/`)"
- #@ template.replace(traefik_tls("docs"))
skill-manager:
image: #@ "ukpsquare/skill-manager:" + data.values.tag
build:
context: ./skill-manager
target: build
ports:
- 8000:8000
expose:
- 8000
env_file:
- ./mongodb/.env
- ./redis/.env
- ./skill-manager/.env
environment:
API_PREFIX: skill-manager
WEB_CONCURRENCY: 8
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
REALM: #@ data.values.realm
MONGO_HOST: mongodb
MONGO_PORT: 27017
VERIFY_ISSUER: #@ str(data.values.verify_issuer[data.values.environment])
REDIS_HOST: redis
REDIS_PORT: 6379
SQUARE_URL: #@ data.values.square_url[data.values.environment]
SQUARE_API_URL: #@ data.values.square_api_url[data.values.environment]
depends_on:
- mongodb
- redis
labels:
- "traefik.enable=true"
- #@ template.replace(traefik_tls("skill-manager"))
- #@ template.replace(traefik_prefix("skill-manager"))
evaluator:
image: #@ "ukpsquare/evaluator:" + data.values.tag
build:
context: ./evaluator
target: build
ports:
- 8081:8081
expose:
- 8081
env_file:
- ./redis/.env
- ./mongodb/.env
- ./evaluator/.env
- ./rabbitmq/.env
environment:
API_PREFIX: evaluator
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
REALM: #@ data.values.realm
MONGO_HOST: mongodb
MONGO_PORT: 27017
REDIS_HOST: redis
REDIS_PORT: 6379
MODEL_API_URL: #@ data.values.model_url[data.values.environment]
VERIFY_ISSUER: #@ str(data.values.verify_issuer[data.values.environment])
DATASET_DIR: /app/datasets/
SKILL_MANAGER_API_URL: #@ data.values.square_api_url[data.values.environment] + "/skill-manager"
depends_on:
- mongodb
labels:
- "traefik.enable=true"
- #@ template.replace(traefik_tls("evaluator"))
- #@ template.replace(traefik_prefix("evaluator"))
volumes:
- evaluation-datasets:/app/datasets/
mongodb:
image: mongo:5.0.4
restart: always
volumes:
- mongo-data:/data/db
- mongo-dumps:/dumps
expose:
- 27017
env_file:
- ./mongodb/.env
rabbit:
hostname: rabbit
image: rabbitmq:3-management
ports:
- 5672:5672
- 15672:15672
env_file:
- ./rabbitmq/.env
redis:
image: redis:latest
ports:
- 6379:6379
env_file:
- .env
- ./redis/.env
command: [ "redis-server", "--requirepass ${REDIS_PASSWORD}" ]
evaluation_worker:
image: #@ "ukpsquare/evaluator:" + data.values.tag
build:
context: ./evaluator
target: build
command: celery -A evaluator.tasks worker -Q evaluation --loglevel=info
volumes:
- ./:/usr/src/app
- /var/run/docker.sock:/var/run/docker.sock
- evaluation-datasets:/app/datasets/
env_file:
- ./evaluator/.env
- ./mongodb/.env
- ./rabbitmq/.env
- ./redis/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
REALM: #@ data.values.realm
MONGO_HOST: mongodb
MONGO_PORT: 27017
REDIS_HOST: redis
REDIS_PORT: 6379
DATASET_DIR: /app/datasets/
QUEUE: evaluation
depends_on:
- mongodb
- redis
- rabbit
maintaining_worker:
image: #@ "ukpsquare/model-manager:" + data.values.tag
build:
context: ./model-manager
target: build
command: celery -A tasks worker --loglevel=info
volumes:
- ./:/usr/src/app
- /var/run/docker.sock:/var/run/docker.sock
env_file:
- ./mongodb/.env
- ./rabbitmq/.env
- ./redis/.env
- ./model-manager/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
ONNX_VOLUME: model-inference_onnx-models
REALM: #@ data.values.realm
MONGO_HOST: mongodb
MONGO_PORT: 27017
CONFIG_VOLUME: square-core_model_configs
MODEL_API_IMAGE: ukpsquare/model-inference
MODEL_API_IMAGE_TAG: #@ data.values.tag
depends_on:
- maintaining
- rabbit
- redis
maintaining:
image: #@ "ukpsquare/model-manager:" + data.values.tag
command: uvicorn model_manager.main:app --host 0.0.0.0 --port 9001 --log-config logging.conf
build:
context: ./model-manager
target: build
ports:
- 9001:9001
volumes:
- /var/run/docker.sock:/var/run/docker.sock
env_file:
- ./mongodb/.env
- ./rabbitmq/.env
- ./redis/.env
- ./model-manager/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
ONNX_VOLUME: model-inference_onnx-models
REALM: #@ data.values.realm
CONFIG_PATH: /model_configs
MONGO_HOST: mongodb
MONGO_PORT: 27017
MODEL_API_IMAGE: ukpsquare/model-inference
MODEL_API_IMAGE_TAG: #@ data.values.tag
labels:
- "traefik.enable=true"
- #@ template.replace(traefik_tls("maintaining"))
- "traefik.http.routers.maintaining.rule=PathPrefix(`/api/models`)"
- "traefik.http.routers.maintaining.middlewares=maintaining-stripprefix,maintaining-addprefix"
- "traefik.http.middlewares.maintaining-stripprefix.stripPrefixRegex.regex=/api/[a-zA-Z0-9_-]+"
- "traefik.http.middlewares.maintaining-addprefix.addPrefix.prefix=/api"
main_model:
image: #@ "ukpsquare/model-inference-transformer:" + data.values.tag
build:
context: ./model-inference
target: build
args:
- MODEL_TYPE=transformer
command: uvicorn model_inference.main:app --host 0.0.0.0 --port 8000 --log-config logging.conf
env_file:
- ./model-inference/model_configurations/.env.dpr
- ./rabbitmq/.env
- ./redis/.env
- ./mongodb/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
CONFIG_PATH: /model_configs
QUEUE: facebook-dpr-question_encoder-single-nq-base
CONFIG_VOLUME: square-core_model_configs
volumes:
- ./.cache/:/etc/huggingface/.cache/
- model_configs:/model_configs
- onnx_models:/onnx_models
labels:
- "traefik.enable=true"
- "traefik.http.routers.model-dpr.rule=PathPrefix(`/api/main`)"
- "traefik.http.routers.model-dpr.entrypoints=websecure"
- "traefik.http.routers.model-dpr.tls=true"
- "traefik.http.routers.model-dpr.tls.certresolver=le"
- "traefik.http.routers.model-dpr.middlewares=model-dpr-stripprefix,model-dpr-addprefix"
- "traefik.http.middlewares.model-dpr-stripprefix.stripprefix.prefixes=/api/main"
- "traefik.http.middlewares.model-dpr-addprefix.addPrefix.prefix=/api"
sensitivity:
image: #@ "ukpsquare/sensitivity:" + data.values.tag
build:
context: ./sensitivity
volumes:
- hf_models:/root/.cache/huggingface
labels:
- "traefik.enable=true"
- "traefik.http.routers.sensitivity.rule=PathPrefix(`/api/sensitivity`)"
- "traefik.http.routers.sensitivity.entrypoints=websecure"
- "traefik.http.routers.sensitivity.tls=true"
- "traefik.http.routers.sensitivity.tls.certresolver=le"
- "traefik.http.routers.sensitivity.middlewares=sensitivity-stripprefix,sensitivity-addprefix"
- "traefik.http.middlewares.sensitivity-stripprefix.stripPrefixRegex.regex=/api/[a-zA-Z0-9_-]+"
- "traefik.http.middlewares.sensitivity-addprefix.addPrefix.prefix=/api"
replicate:
image: #@ "ukpsquare/replicate:" + data.values.tag
build:
context: ./replicate
labels:
- "traefik.enable=true"
- "traefik.http.routers.replicate.rule=PathPrefix(`/api/replicate`)"
- "traefik.http.routers.replicate.entrypoints=websecure"
- "traefik.http.routers.replicate.tls=true"
- "traefik.http.routers.replicate.tls.certresolver=le"
- "traefik.http.routers.replicate.middlewares=replicate-stripprefix,replicate-addprefix"
- "traefik.http.middlewares.replicate-stripprefix.stripPrefixRegex.regex=/api/[a-zA-Z0-9_-]+"
- "traefik.http.middlewares.replicate-addprefix.addPrefix.prefix=/api"
dpr_worker:
image: #@ "ukpsquare/model-inference-transformer:" + data.values.tag
build:
context: ./model-inference
target: build
args:
- MODEL_TYPE=transformer
container_name: facebook-dpr-question_encoder-single-nq-base
command: celery -A tasks worker -Q facebook-dpr-question_encoder-single-nq-base --loglevel=info
volumes:
- ./:/usr/src/app
- /var/run/docker.sock:/var/run/docker.sock
- model_configs:/model_configs
env_file:
- ./model-inference/model_configurations/.env.dpr
- ./rabbitmq/.env
- ./redis/.env
- ./mongodb/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
ONNX_VOLUME: onnx_models
REALM: #@ data.values.realm
CONFIG_PATH: /model_configs
QUEUE: facebook-dpr-question_encoder-single-nq-base
depends_on:
- maintaining
- rabbit
- redis
bert_worker:
image: #@ "ukpsquare/model-inference-transformer:" + data.values.tag
build:
context: ./model-inference
target: build
args:
- MODEL_TYPE=transformer
container_name: bert-base-uncased
command: celery -A tasks worker -Q bert-base-uncased --loglevel=info
volumes:
- ./:/usr/src/app
- /var/run/docker.sock:/var/run/docker.sock
- model_configs:/model_configs
env_file:
- ./model-inference/model_configurations/.env.bert_adapter
- ./rabbitmq/.env
- ./redis/.env
- ./mongodb/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
ONNX_VOLUME: onnx_models
REALM: #@ data.values.realm
CONFIG_PATH: /model_configs
QUEUE: bert-base-uncased
depends_on:
- maintaining
- rabbit
- redis
metaqa_worker:
image: #@ "ukpsquare/model-inference-transformer:" + data.values.tag
build:
context: ./model-inference
target: build
args:
- MODEL_TYPE=transformer
container_name: metaqa
command: celery -A tasks worker -Q metaqa --loglevel=info
volumes:
- ./:/usr/src/app
- /var/run/docker.sock:/var/run/docker.sock
- model_configs:/model_configs
env_file:
- ./model-inference/model_configurations/.env.metaqa
- ./rabbitmq/.env
- ./redis/.env
- ./mongodb/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
ONNX_VOLUME: onnx_models
REALM: #@ data.values.realm
CONFIG_PATH: /model_configs
QUEUE: metaqa
depends_on:
- maintaining
- rabbit
- redis
roberta_worker:
image: #@ "ukpsquare/model-inference-transformer:" + data.values.tag
build:
context: ./model-inference
target: build
args:
- MODEL_TYPE=transformer
container_name: roberta-base
command: celery -A tasks worker -Q roberta-base --loglevel=info
volumes:
- ./:/usr/src/app
- /var/run/docker.sock:/var/run/docker.sock
- model_configs:/model_configs
env_file:
- ./model-inference/model_configurations/.env.roberta_adapter
- ./rabbitmq/.env
- ./redis/.env
- ./mongodb/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
ONNX_VOLUME: onnx_models
REALM: #@ data.values.realm
CONFIG_PATH: /model_configs
QUEUE: roberta-base
depends_on:
- maintaining
- rabbit
- redis
qagnn_worker:
image: #@ "ukpsquare/model-inference-graph-transformer:" + data.values.tag
build:
context: ./model-inference
target: build
args:
- MODEL_TYPE=graph_transformer
container_name: qagnn
command: celery -A tasks worker -Q qagnn --loglevel=info --concurrency=1
volumes:
- ./:/usr/src/app
- /var/run/docker.sock:/var/run/docker.sock
- model_configs:/model_configs
- model_storage:/model_storage
env_file:
- ./model-inference/model_configurations/.env.qagnn
- ./rabbitmq/.env
- ./redis/.env
- ./mongodb/.env
environment:
WEB_CONCURRENCY: "1"
VERIFY_SSL: #@ str(data.values.verify_ssl[data.values.environment])
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
DOCKER_HOST_URL: #@ data.values.docker_host_url[data.values.os]
ONNX_VOLUME: onnx_models
REALM: #@ data.values.realm
CONFIG_PATH: /model_configs
QUEUE: qagnn
depends_on:
- maintaining
- rabbit
- redis
datastore_api:
privileged: true
image: #@ "ukpsquare/datastore:" + data.values.tag
build:
context: ./datastore-api
target: build
depends_on:
- datastore_es
- mongodb
ports:
- "7000:7000"
env_file:
- ./mongodb/.env
- ./datastore-api/.env
environment:
WEB_CONCURRENCY: #@ str(data.values.web_concurrency)
FAISS_PORT: 5000
MODEL_API_URL: #@ data.values.model_url[data.values.environment]
ES_URL: http://datastore_es:9200
KEYCLOAK_BASE_URL: #@ data.values.keycloak_base_url_https[data.values.environment]
REALM: #@ data.values.realm
VERIFY_ISSUER: #@ str(data.values.verify_issuer[data.values.environment])
MONGO_HOST: mongodb
MONGO_PORT: 27017
labels:
- "traefik.enable=true"
- #@ template.replace(traefik_tls("datastores"))
- "traefik.http.routers.datastores.rule=PathPrefix(`/api/datastores`)"
- "traefik.http.routers.datastores.middlewares=datastores-stripprefix,datastores-addprefix"
- "traefik.http.middlewares.datastores-stripprefix.stripPrefixRegex.regex=/api/[a-zA-Z0-9_-]+"
- "traefik.http.middlewares.datastores-addprefix.addPrefix.prefix=/datastores"
datastore_es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.1
environment:
- discovery.type=single-node
volumes:
- datastore-api-es:/usr/share/elasticsearch/data
ports:
- 7200:9200
faiss_nq_dpr:
container_name: faiss_nq_dpr
image: kwang2049/faiss-instant:latest
volumes:
- datastore-api-faiss-nq-dpr:/opt/faiss-instant/resources
faiss_msmarco_distilbert:
container_name: faiss_msmarco_distilbert
image: kwang2049/faiss-instant:latest
volumes:
- datastore-api-faiss-msmarco-distilbert:/opt/faiss-instant/resources
faiss_bioasq_distilbert:
container_name: faiss_bioasq_distilbert
image: kwang2049/faiss-instant:latest
volumes:
- datastore-api-faiss-bioasq-distilbert:/opt/faiss-instant/resources
#@yaml/text-templated-strings
#@ for skill in data.values.skills:
(@= skill.name @):
image: #@ skill_image_name(skill)
build: #@ skill_build(skill)
env_file: #@ skill_env_file(skill)
environment: #@ skill_environment(skill)
#@ end
dozzle:
image: amir20/dozzle:v4.0.1
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
DOZZLE_NO_ANALYTICS: "true"
DOZZLE_LEVEL: DEBUG
DOZZLE_BASE: /admin/logs
labels:
- traefik.enable=true
- #@ template.replace(traefik_tls("dozzle"))
- traefik.http.routers.dozzle.rule=PathPrefix(`/admin/logs`)
- traefik.http.routers.dozzle.middlewares=auth
healthcheck:
test: ["CMD", "/dozzle", "healthcheck"]
interval: 20s
timeout: 10s
retries: 10
portainer:
image: portainer/portainer-ce:latest
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer-data:/data
labels:
#! Frontend
- traefik.enable=true
- #@ template.replace(traefik_tls("portainer"))
- traefik.http.routers.portainer.rule=PathPrefix(`/admin/portainer`)
- traefik.http.services.portainer.loadbalancer.server.port=9000
- traefik.http.routers.portainer.service=portainer
- traefik.http.routers.portainer.middlewares=portainer-stripprefix
- traefik.http.middlewares.portainer-stripprefix.stripprefix.prefixes=/admin/portainer
volumes:
traefik-public-certificates:
db-data:
driver: local
migrations-data:
driver: local
mongo-data:
driver: local
mongo-dumps:
driver: local
square-redis-data:
driver: local
datastore-api-es:
driver: local
datastore-api-faiss-nq-dpr:
driver: local
datastore-api-faiss-msmarco-distilbert:
driver: local
datastore-api-faiss-bioasq-distilbert:
driver: local
model_configs:
driver: local
model_storage:
driver: local
onnx_models:
driver: local
evaluation-datasets:
driver: local
virtuoso-db:
driver: local
hf_models:
portainer-data:
driver: local