forked from btrantruong/osome-csdl-ranking-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
105 lines (98 loc) · 2.61 KB
/
docker-compose.yml
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
services:
database:
image: postgres:15.7-alpine
ports:
- "5435:5432"
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_HOST_AUTH_METHOD: "trust"
PGPORT: "5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 14s
retries: 15
start_period: 2m
redis:
image: redis
ports:
- "6379:6379"
redis-celery-broker:
image: redis
ports:
- "6380:6380"
command: ["redis-server", "--port", "6380"]
ranker:
build:
context: .
dockerfile: Dockerfile-ranker
image: dante-ranker
depends_on:
- redis
environment:
REDIS_CONNECTION_STRING: redis://redis:6379
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
command: ["uvicorn", "--host", "0.0.0.0", "--port", "8000", "dante.app.ranking_server.ranking_server:app"]
ports:
- "8000:8000"
volumes:
- type: bind
source: ${PWD}/dante/app/config.ini
target: /app/config.ini
# - type: bind
# source: ${HOME}/.cache/dante
# target: /app/cache
worker:
build:
context: .
dockerfile: Dockerfile-worker
image: dante-worker
depends_on:
- redis-celery-broker
environment:
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
command: ["celery", "-A", "dante.app.scorer_worker.tasks", "worker", "-Q", "scorer", "--loglevel=info"]
volumes:
- type: bind
source: ${PWD}/dante/app/config.ini
target: /app/config.ini
- type: bind
source: ${HOME}/.cache/dante
target: /app/cache
profiles:
- no-gpu
celery-scorer-worker1:
build:
context: .
dockerfile: Dockerfile
depends_on:
- redis-celery-broker
environment:
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
command: ["celery", "-A", "dante.app.scorer_worker.tasks", "worker", "-Q", "scorer", "--loglevel=info", "--pool=solo"]
volumes:
- type: bind
source: ${PWD}/config.ini
target: /app/config.ini
- type: bind
source: ${HOME}/.cache/dante
target: /app/cache
profiles:
- gpu
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
postgres_data:
driver: local