Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (86 loc) · 2.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
94 lines (86 loc) · 2.1 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
version: "3.9"
x-model: &model
MODEL_NAME: ${MODEL_NAME:-TinyLlama/TinyLlama-1.1B-Chat-v1.0}
TORCH_THREADS: ${TORCH_THREADS:-0}
services:
coordinator:
build: ./coordinator
ports:
- "8000:8000"
environment:
<<: *model
volumes:
- hf_cache:/root/.cache/huggingface
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8000/api/health').status==200 else 1)"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
worker-1:
build: ./worker
environment:
<<: *model
WORKER_ID: worker-1
WORKER_PORT: 8001
WORKER_HOST: worker-1
COORDINATOR_URL: http://coordinator:8000
ports:
- "8001:8001"
volumes:
- hf_cache:/root/.cache/huggingface
depends_on:
coordinator:
condition: service_healthy
command: uvicorn main:app --host 0.0.0.0 --port 8001
worker-2:
build: ./worker
environment:
<<: *model
WORKER_ID: worker-2
WORKER_PORT: 8001
WORKER_HOST: worker-2
COORDINATOR_URL: http://coordinator:8000
ports:
- "8002:8001"
volumes:
- hf_cache:/root/.cache/huggingface
depends_on:
coordinator:
condition: service_healthy
command: uvicorn main:app --host 0.0.0.0 --port 8001
worker-3:
build: ./worker
environment:
<<: *model
WORKER_ID: worker-3
WORKER_PORT: 8001
WORKER_HOST: worker-3
COORDINATOR_URL: http://coordinator:8000
ports:
- "8003:8001"
volumes:
- hf_cache:/root/.cache/huggingface
depends_on:
coordinator:
condition: service_healthy
command: uvicorn main:app --host 0.0.0.0 --port 8001
dashboard:
build: ./dashboard
ports:
- "5173:5173"
depends_on:
- coordinator
environment:
- VITE_PROXY_TARGET=http://coordinator:8000
cli:
build: ./cli
depends_on:
coordinator:
condition: service_healthy
environment:
- COORDINATOR_URL=http://coordinator:8000
profiles:
- cli
volumes:
hf_cache: