-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-local.yaml
More file actions
197 lines (187 loc) · 5.27 KB
/
Copy pathdocker-compose-local.yaml
File metadata and controls
197 lines (187 loc) · 5.27 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
services:
admin:
image: ${DOCKER_IMAGE:-video-processor:latest}
restart: unless-stopped
volumes:
- .:/code
- ${STORAGE_MOUNT:-.}:/output
- ${BULK_VIDEO_DIR:-/dev/null}:/bulk-videos:ro
env_file:
- path: .env
required: false
environment:
STORAGE_MOUNT: /output
command: ['python3', 'manage.py', 'runserver', '0.0.0.0:8000']
ports:
- "8000:8000"
chunk_video:
image: ${DOCKER_IMAGE:-video-processor:latest}
restart: unless-stopped
volumes:
- .:/code
- ${STORAGE_MOUNT:-.}:/output
env_file:
- path: .env
required: false
environment:
STORAGE_MOUNT: /output
HEALTHCHECK_MAX_AGE: 10
command: ['celery', '-A', 'video_processor', 'worker', '-n', 'chunk@%h', '-l', 'INFO', '-Q', 'chunk_video', '--concurrency', '1']
healthcheck:
test: ['CMD', 'bash', '/code/healthcheck.sh']
interval: 60s
timeout: 10s
retries: 3
start_period: 60s
labels:
- "autoheal=true"
deploy:
replicas: 1
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
extract:
image: ${DOCKER_IMAGE:-video-processor:latest}
restart: unless-stopped
volumes:
- .:/code
- ${STORAGE_MOUNT:-.}:/output
env_file:
- path: .env
required: false
environment:
STORAGE_MOUNT: /output
HEALTHCHECK_MAX_AGE: 5
command: ['celery', '-A', 'video_processor', 'worker', '-n', 'extract@%h', '-l', 'INFO', '-Q', 'extract', '--concurrency', '1', '--pool', 'solo']
healthcheck:
test: ['CMD', 'bash', '/code/healthcheck.sh']
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
labels:
- "autoheal=true"
deploy:
replicas: ${EXTRACT_WORKERS_PER_HOST:-1}
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
detect:
image: ${DOCKER_IMAGE:-video-processor:latest}
restart: unless-stopped
volumes:
- .:/code
- ${STORAGE_MOUNT:-.}:/output
env_file:
- path: .env
required: false
environment:
STORAGE_MOUNT: /output
HEALTHCHECK_MAX_AGE: 2
command: ['celery', '-A', 'video_processor', 'worker', '-n', 'detect@%h', '-l', 'ERROR', '-Q', 'detect', '--concurrency', '1', '--pool', 'solo']
healthcheck:
test: ['CMD', 'bash', '/code/healthcheck.sh']
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
labels:
- "autoheal=true"
deploy:
replicas: ${DETECT_WORKERS_PER_HOST:-1}
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
create_output:
image: ${DOCKER_IMAGE:-video-processor:latest}
restart: unless-stopped
volumes:
- .:/code
- ${STORAGE_MOUNT:-.}:/output
env_file:
- path: .env
required: false
environment:
STORAGE_MOUNT: /output
HEALTHCHECK_MAX_AGE: 10
command: ['celery', '-A', 'video_processor', 'worker', '-n', 'output@%h', '-B', '-l', 'INFO', '-Q', 'create_output', '--concurrency', '1']
healthcheck:
test: ['CMD', 'bash', '/code/healthcheck.sh']
interval: 60s
timeout: 10s
retries: 3
start_period: 60s
labels:
- "autoheal=true"
deploy:
replicas: 1
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
# If you just want to process things on a single machine, you can use these
# containers for your DB and Celery Broker, respectively. Just make sure you
# change your .env file to match.
db:
image: 'postgres:15'
restart: unless-stopped
env_file:
- path: .env
required: false
environment:
POSTGRES_PASSWORD: ${DB_PASS:-processor-password}
POSTGRES_USER: ${DB_USER:-processor}
POSTGRES_DB: ${DB_NAME:-processor}
volumes:
- postgresql:/var/lib/postgresql
- postgresql_data:/var/lib/postgresql/data
ports:
- "${DB_PORT:-5432}:${DB_PORT:-5432}"
redis:
image: 'redis:latest'
restart: unless-stopped
ports:
- '6379:6379'
autoscaler:
build: ./autoscaler
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- .:/home/eric/code/video-processor:ro
- ${STORAGE_MOUNT:-.}:/output
working_dir: /home/eric/code/video-processor
environment:
REDIS_HOST: redis
COMPOSE_FILE: /home/eric/code/video-processor/docker-compose-local.yaml
COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME:-video-processor}
COMPOSE_PROJECT_DIR: ${COMPOSE_PROJECT_DIR:-/home/eric/code/video-processor}
STORAGE_MOUNT: /output
CHECK_INTERVAL: 30
QUEUE_THRESHOLD: 100000
DISK_THRESHOLD: 90
EXTRACT_HIGH: 2
EXTRACT_LOW: 1
autoheal:
image: willfarrell/autoheal
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
AUTOHEAL_CONTAINER_LABEL: autoheal
AUTOHEAL_INTERVAL: 60
AUTOHEAL_START_PERIOD: 120
AUTOHEAL_DEFAULT_STOP_TIMEOUT: 10
volumes:
postgresql:
postgresql_data: