-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (68 loc) · 1.73 KB
/
Copy pathdocker-compose.yml
File metadata and controls
72 lines (68 loc) · 1.73 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
version: "3.9"
volumes:
models_cache:
outputs:
storage:
services:
redis:
image: redis:7-alpine
ports:
- "6379:6379"
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
worker:
build: .
# #20 — consume all three queues; KD runs isolated from SFT so an OOM doesn't kill SFT jobs
command: celery -A workers.celery_app worker --loglevel=info --concurrency=1 --queues sft,dpo,kd
volumes:
- models_cache:/app/models_cache
- outputs:/app/outputs
- storage:/app/storage
environment:
- REDIS_URL=redis://redis:6379/0
- HF_HOME=/app/models_cache
depends_on:
redis:
condition: service_healthy
# #21 — cap memory so a runaway rank-256 LoRA job can't OOM-kill the container
mem_limit: 20g
memswap_limit: 20g
restart: on-failure
healthcheck:
test: ["CMD", "celery", "-A", "workers.celery_app", "inspect", "ping", "--timeout=5"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
reservations:
devices:
- capabilities: [gpu] # remove if no GPU
app:
build: .
command: reflex run --env prod
ports:
- "3000:3000"
- "8000:8000"
volumes:
- outputs:/app/outputs
- storage:/app/storage
environment:
- REDIS_URL=redis://redis:6379/0
depends_on:
redis:
condition: service_healthy
worker:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s