-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.gpu.yaml
More file actions
128 lines (124 loc) · 4.02 KB
/
docker-compose.gpu.yaml
File metadata and controls
128 lines (124 loc) · 4.02 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
# Docker Compose for GPU-Accelerated Worker Testing
#
# Usage:
# # NVIDIA GPU testing
# docker compose -f docker-compose.gpu.yaml --profile nvidia up --build
#
# # Intel Arc GPU testing
# docker compose -f docker-compose.gpu.yaml --profile intel up --build
#
# # CPU-only testing (with GPU image)
# docker compose -f docker-compose.gpu.yaml --profile cpu up --build
#
# Prerequisites:
# - For NVIDIA: nvidia-container-toolkit installed
# - For Intel: /dev/dri accessible
# - VLOG_WORKER_API_KEY environment variable set
services:
# NVIDIA GPU worker
worker-nvidia:
build:
context: .
dockerfile: Dockerfile.worker.gpu
environment:
- VLOG_WORKER_API_URL=${VLOG_WORKER_API_URL:-http://host.docker.internal:9002}
- VLOG_WORKER_API_KEY=${VLOG_WORKER_API_KEY}
- VLOG_WORKER_HEARTBEAT_INTERVAL=${VLOG_WORKER_HEARTBEAT_INTERVAL:-30}
- VLOG_WORKER_POLL_INTERVAL=${VLOG_WORKER_POLL_INTERVAL:-10}
- VLOG_HWACCEL_TYPE=nvidia
- VLOG_HWACCEL_PREFERRED_CODEC=${VLOG_HWACCEL_PREFERRED_CODEC:-h264}
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- worker-data-nvidia:/tmp/vlog-worker
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu, video, compute]
restart: unless-stopped
healthcheck:
# Check the worker's /ready endpoint which validates FFmpeg and API connectivity
test: ["CMD", "curl", "-f", "http://localhost:8080/ready"]
interval: 30s
timeout: 10s
retries: 3
# Allow time for worker to start and establish API connection
start_period: 30s
profiles:
- nvidia
# Intel Arc GPU worker
worker-intel:
build:
context: .
dockerfile: Dockerfile.worker.gpu
environment:
- VLOG_WORKER_API_URL=${VLOG_WORKER_API_URL:-http://host.docker.internal:9002}
- VLOG_WORKER_API_KEY=${VLOG_WORKER_API_KEY}
- VLOG_WORKER_HEARTBEAT_INTERVAL=${VLOG_WORKER_HEARTBEAT_INTERVAL:-30}
- VLOG_WORKER_POLL_INTERVAL=${VLOG_WORKER_POLL_INTERVAL:-10}
- VLOG_HWACCEL_TYPE=intel
- VLOG_HWACCEL_PREFERRED_CODEC=${VLOG_HWACCEL_PREFERRED_CODEC:-av1}
- LIBVA_DRIVER_NAME=iHD
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- worker-data-intel:/tmp/vlog-worker
devices:
- /dev/dri:/dev/dri
group_add:
- video
- render
restart: unless-stopped
healthcheck:
# Check the worker's /ready endpoint which validates FFmpeg and API connectivity
test: ["CMD", "curl", "-f", "http://localhost:8080/ready"]
interval: 30s
timeout: 10s
retries: 3
# Allow time for worker to start and establish API connection
start_period: 30s
profiles:
- intel
# CPU-only worker (using GPU image but forcing CPU encoding)
worker-cpu:
build:
context: .
dockerfile: Dockerfile.worker.gpu
environment:
- VLOG_WORKER_API_URL=${VLOG_WORKER_API_URL:-http://host.docker.internal:9002}
- VLOG_WORKER_API_KEY=${VLOG_WORKER_API_KEY}
- VLOG_WORKER_HEARTBEAT_INTERVAL=${VLOG_WORKER_HEARTBEAT_INTERVAL:-30}
- VLOG_WORKER_POLL_INTERVAL=${VLOG_WORKER_POLL_INTERVAL:-10}
- VLOG_HWACCEL_TYPE=none
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- worker-data-cpu:/tmp/vlog-worker
deploy:
resources:
limits:
cpus: '4'
memory: 8G
reservations:
cpus: '1'
memory: 2G
restart: unless-stopped
healthcheck:
# Check the worker's /ready endpoint which validates FFmpeg and API connectivity
test: ["CMD", "curl", "-f", "http://localhost:8080/ready"]
interval: 30s
timeout: 10s
retries: 3
# Allow time for worker to start and establish API connection
start_period: 30s
profiles:
- cpu
volumes:
worker-data-nvidia:
worker-data-intel:
worker-data-cpu: