-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
178 lines (173 loc) · 5.5 KB
/
docker-compose.yml
File metadata and controls
178 lines (173 loc) · 5.5 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
# voice-assistant/docker-compose.yml
services:
asr:
build:
context: ./backend/asr
dockerfile: Dockerfile
container_name: voice-assistant-asr
ports:
- "${ASR_PORT}:${ASR_PORT}"
volumes:
- ./shared/config.yaml:/app/config.yaml:ro
- ./shared/logs:/app/logs
- model_cache:${CACHE_DIR:-/cache}
environment:
- ASR_PORT=${ASR_PORT}
- CACHE_DIR=${CACHE_DIR:-/cache}
- USE_GPU=${USE_GPU}
- LOG_LEVEL=${LOG_LEVEL:-info}
- PYTHONUNBUFFERED=${PYTHONUNBUFFERED:-1}
- CONFIG_PATH=/app/config.yaml
- LOG_FILE_BASE=/app/logs/service
- HUGGING_FACE_TOKEN=${HUGGING_FACE_TOKEN}
- NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all}
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
count: 1
runtime: nvidia
networks:
- voice-assistant-net
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:${ASR_PORT}/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 120s
llm:
build:
context: ./backend/llm
dockerfile: Dockerfile
container_name: voice-assistant-llm
ports:
- "${LLM_PORT}:${LLM_PORT}"
volumes:
- ./shared/config.yaml:/app/config.yaml:ro
- ./shared/logs:/app/logs
- model_cache:${CACHE_DIR:-/cache}
environment:
- LLM_PORT=${LLM_PORT}
- CACHE_DIR=${CACHE_DIR:-/cache}
- USE_GPU=${USE_GPU}
- LOG_LEVEL=${LOG_LEVEL:-info}
- PYTHONUNBUFFERED=${PYTHONUNBUFFERED:-1}
- CONFIG_PATH=/app/config.yaml
- LOG_FILE_BASE=/app/logs/service
- HUGGING_FACE_TOKEN=${HUGGING_FACE_TOKEN}
- NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all}
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- CMAKE_ARGS=${CMAKE_ARGS:--DLLAMA_CUBLAS=on}
- FORCE_CMAKE=${FORCE_CMAKE:-1}
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
count: 1
runtime: nvidia
networks:
- voice-assistant-net
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:${LLM_PORT}/health"]
interval: 30s
timeout: 15s
retries: 5
start_period: 180s
tts:
build:
context: ./backend/tts
# Ensure the Dockerfile includes websocat installation
dockerfile: Dockerfile
container_name: voice-assistant-tts
ports:
- "${TTS_PORT}:${TTS_PORT}"
volumes:
- ./shared/config.yaml:/app/config.yaml:ro
- ./shared/logs:/app/logs
- model_cache:${CACHE_DIR:-/cache}
environment:
- TTS_PORT=${TTS_PORT}
- CACHE_DIR=${CACHE_DIR:-/cache}
- USE_GPU=${USE_GPU} # Should be true or auto for CSM
- LOG_LEVEL=${LOG_LEVEL:-info}
- PYTHONUNBUFFERED=${PYTHONUNBUFFERED:-1}
- CONFIG_PATH=/app/config.yaml
- LOG_FILE_BASE=/app/logs/service
- HUGGING_FACE_TOKEN=${HUGGING_FACE_TOKEN} # REQUIRED
- TTS_SPEAKER_ID=${TTS_SPEAKER_ID:-4} # Default to 4 for expressiva model
- NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all}
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- HF_HOME=${CACHE_DIR:-/cache}/huggingface # Explicitly set HF_HOME
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
count: 1 # CSM requires GPU
runtime: nvidia
networks:
- voice-assistant-net
restart: unless-stopped
# --- UPDATED HEALTHCHECK SECTION for TTS using /ws_health ---
healthcheck:
test: >
sh -c '
curl --fail -s http://localhost:${TTS_PORT}/health &&
websocat -q --one-message ws://localhost:${TTS_PORT}/ws_health
'
# -q: quiet mode
# --one-message: waits for exactly one message OR EOF (which /ws_health sends immediately after accept)
interval: 15s # Check slightly more often
timeout: 10s # Overall timeout for the sh -c command
retries: 6 # Increase retries slightly
start_period: 300s # Keep long start period for model loading
# --- END OF UPDATED HEALTHCHECK ---
orchestrator:
build:
context: ./backend/orchestrator
dockerfile: Dockerfile
container_name: voice-assistant-orchestrator
ports:
- "${ORCHESTRATOR_PORT}:${ORCHESTRATOR_PORT}"
volumes:
- ./shared/config.yaml:/app/config.yaml:ro
- ./shared/logs:/app/logs
environment:
- ORCHESTRATOR_PORT=${ORCHESTRATOR_PORT}
- ASR_SERVICE_URL=http://asr:${ASR_PORT}
- LLM_SERVICE_URL=http://llm:${LLM_PORT}
- TTS_SERVICE_URL=http://tts:${TTS_PORT}
- LOG_LEVEL=${LOG_LEVEL:-info}
- PYTHONUNBUFFERED=${PYTHONUNBUFFERED:-1}
- CONFIG_PATH=/app/config.yaml
- LOG_FILE_BASE=/app/logs/service
depends_on: # This correctly waits for the updated healthcheck now
asr:
condition: service_healthy
llm:
condition: service_healthy
tts:
condition: service_healthy
networks:
- voice-assistant-net
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:${ORCHESTRATOR_PORT}/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s # Orchestrator itself starts fast
networks:
voice-assistant-net:
driver: bridge
volumes:
model_cache:
driver: local