-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.yml
More file actions
320 lines (302 loc) · 9.71 KB
/
Copy pathcompose.yml
File metadata and controls
320 lines (302 loc) · 9.71 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
name: rend-local
x-rend-build-api: &rend-build-api
context: .
dockerfile: Dockerfile
target: rend-api
x-rend-build-worker: &rend-build-worker
context: .
dockerfile: Dockerfile
target: rend-media-worker
x-rend-build-edge: &rend-build-edge
context: .
dockerfile: Dockerfile
target: rend-edge
x-rend-common-env: &rend-common-env
REND_ENV: local
DATABASE_URL: postgres://rend:rend@postgres:5432/rend
REND_REDIS_URL: redis://redis:6379
CLICKHOUSE_URL: http://clickhouse:8123
CLICKHOUSE_DATABASE: rend
CLICKHOUSE_USER: rend
CLICKHOUSE_PASSWORD: rend
OBJECT_STORE_HEALTH_URL: http://minio:9000/minio/health/ready
S3_ENDPOINT: http://minio:9000
S3_REGION: us-east-1
S3_BUCKET: rend-local
AWS_ACCESS_KEY_ID: rend_minio
AWS_SECRET_ACCESS_KEY: rend_minio_password
REND_DEV_API_KEY: dev-api-key
REND_SITE_INTERNAL_TOKEN: local-site-internal-token
REND_EDGE_INTERNAL_TOKEN: dev-internal-token
REND_INTERNAL_TELEMETRY_TOKEN: dev-internal-token
REND_PLAYBACK_SIGNING_KEY_ID: local-dev-playback-key
REND_PLAYBACK_SIGNING_SECRET: local-dev-playback-signing-secret
REND_PLAYBACK_TOKEN_TTL_SECS: "900"
REND_MAX_UPLOAD_BYTES: "536870912"
REND_EXPECTED_EDGES: local-edge-001=local=http://rend-edge:4100,rend-edge-us-east=us-east=http://rend-edge-us-east:4100,rend-edge-london=london=http://rend-edge-london:4100
REND_ALLOW_INSECURE_EDGE_URLS: "false"
REND_HTTP_TIMEOUT_SECS: "120"
REND_MEDIA_PROCESS_TIMEOUT_SECS: "60"
REND_MEDIA_JOB_MAX_ATTEMPTS: "3"
REND_MEDIA_WORKER_POLL_INTERVAL_SECS: "1"
REND_MEDIA_JOB_LOCK_TIMEOUT_SECS: "300"
REND_PLAYBACK_TELEMETRY_MAX_BODY_BYTES: "262144"
REND_PLAYBACK_TELEMETRY_MAX_EVENTS_PER_BATCH: "100"
REND_PLAYBACK_ANALYTICS_DEFAULT_WINDOW_SECS: "86400"
REND_PLAYBACK_ANALYTICS_MAX_WINDOW_SECS: "604800"
REND_EDGE_WARM_MAX_ARTIFACTS: "4"
REND_EDGE_MAX_IN_FLIGHT_FILLS: "64"
REND_EDGE_MAX_ORIGIN_ARTIFACT_BYTES: "536870912"
REND_EDGE_CACHE_MIN_FREE_BYTES: "67108864"
REND_EDGE_TELEMETRY_ENABLED: "true"
REND_EDGE_TELEMETRY_QUEUE_CAPACITY: "1024"
REND_EDGE_TELEMETRY_BATCH_SIZE: "100"
REND_EDGE_TELEMETRY_FLUSH_INTERVAL_SECS: "2"
REND_EDGE_TELEMETRY_REQUEST_TIMEOUT_SECS: "2"
REND_EDGE_TELEMETRY_SPOOL_MAX_BYTES: "10485760"
RUST_LOG: info
x-rend-service-deps: &rend-service-deps
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
minio-init:
condition: service_completed_successfully
clickhouse:
condition: service_healthy
clickhouse-init:
condition: service_completed_successfully
x-edge-service: &edge-service
image: rend-edge:local
build: *rend-build-edge
restart: unless-stopped
depends_on:
minio:
condition: service_healthy
minio-init:
condition: service_completed_successfully
rend-api:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:4100/readyz"]
interval: 10s
timeout: 3s
retries: 12
start_period: 10s
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: rend
POSTGRES_USER: rend
POSTGRES_PASSWORD: rend
ports:
- "5432:5432"
volumes:
- rend-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""]
interval: 5s
timeout: 3s
retries: 20
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
volumes:
- rend-redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
clickhouse:
image: clickhouse/clickhouse-server:24.12-alpine
environment:
CLICKHOUSE_DB: rend
CLICKHOUSE_USER: rend
CLICKHOUSE_PASSWORD: rend
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: "1"
ports:
- "8123:8123"
volumes:
- rend-clickhouse-data:/var/lib/clickhouse
healthcheck:
test:
[
"CMD-SHELL",
"clickhouse-client --user \"$${CLICKHOUSE_USER}\" --password \"$${CLICKHOUSE_PASSWORD}\" --query 'SELECT 1'",
]
interval: 5s
timeout: 3s
retries: 20
clickhouse-init:
image: clickhouse/clickhouse-server:24.12-alpine
depends_on:
clickhouse:
condition: service_healthy
environment:
CLICKHOUSE_USER: rend
CLICKHOUSE_PASSWORD: rend
volumes:
- ./clickhouse:/schema:ro
entrypoint: ["/bin/sh", "-c"]
command:
- |
clickhouse-client \
--host clickhouse \
--user "$$CLICKHOUSE_USER" \
--password "$$CLICKHOUSE_PASSWORD" \
--multiquery < /schema/001_playback_events.sql
restart: "no"
minio:
image: minio/minio:latest
command: ["server", "/data", "--console-address", ":9001"]
environment:
MINIO_ROOT_USER: rend_minio
MINIO_ROOT_PASSWORD: rend_minio_password
ports:
- "9100:9000"
- "9101:9001"
volumes:
- rend-minio-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:9000/minio/health/ready"]
interval: 5s
timeout: 3s
retries: 20
minio-init:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint:
- /bin/sh
- -c
- |
mc alias set local http://minio:9000 rend_minio rend_minio_password &&
mc mb --ignore-existing local/rend-local &&
mc anonymous set none local/rend-local
restart: "no"
rend-api:
image: rend-api:local
build: *rend-build-api
restart: unless-stopped
depends_on: *rend-service-deps
environment:
<<: *rend-common-env
REND_API_BIND_ADDR: 0.0.0.0:4000
REND_API_AUTO_MIGRATE: "true"
REND_API_INLINE_MEDIA_PROCESSING: "false"
REND_PLAYBACK_BASE_URL: ${REND_PLAYBACK_BASE_URL:-http://127.0.0.1:4100}
REND_PLAYBACK_BOOTSTRAP_PREFETCH_SEGMENTS: "2"
REND_EDGE_ACTIVE_HEARTBEAT_WINDOW_SECS: "30"
REND_EDGE_WARM_URL: http://rend-edge:4100/internal/warm
REND_EDGE_PURGE_URL: http://rend-edge:4100/internal/purge
ports:
- "4000:4000"
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:4000/readyz"]
interval: 10s
timeout: 3s
retries: 18
start_period: 20s
rend-media-worker:
image: rend-media-worker:local
build: *rend-build-worker
restart: unless-stopped
depends_on:
rend-api:
condition: service_healthy
environment:
<<: *rend-common-env
REND_API_AUTO_MIGRATE: "false"
REND_API_INLINE_MEDIA_PROCESSING: "false"
REND_MEDIA_WORKER_ID: docker-media-worker-001
REND_EDGE_ACTIVE_HEARTBEAT_WINDOW_SECS: "30"
REND_EDGE_WARM_URL: http://rend-edge:4100/internal/warm
REND_EDGE_PURGE_URL: http://rend-edge:4100/internal/purge
REND_PLAYBACK_BASE_URL: ${REND_PLAYBACK_BASE_URL:-http://127.0.0.1:4100}
healthcheck:
test:
[
"CMD-SHELL",
"tr '\\0' ' ' </proc/1/cmdline | grep -q 'rend-api worker media'",
]
interval: 10s
timeout: 3s
retries: 12
start_period: 10s
rend-edge:
<<: *edge-service
environment:
<<: *rend-common-env
REND_EDGE_BIND_ADDR: 0.0.0.0:4100
REND_EDGE_ID: local-edge-001
REND_EDGE_REGION: local
REND_EDGE_BASE_URL: http://rend-edge:4100
REND_CONTROL_PLANE_URL: http://rend-api:4000
REND_EDGE_HEARTBEAT_INTERVAL_SECS: "2"
REND_EDGE_CACHE_DIR: /var/lib/rend/edge-cache
REND_EDGE_ORIGIN_HEALTH_URL: http://minio:9000/minio/health/ready
REND_EDGE_TELEMETRY_INGEST_URL: http://rend-api:4000/internal/telemetry/playback
REND_EDGE_TELEMETRY_SPOOL_DIR: /var/spool/rend/edge-telemetry
ports:
- "4100:4100"
volumes:
- rend-edge-cache:/var/lib/rend/edge-cache
- rend-edge-telemetry-spool:/var/spool/rend/edge-telemetry
rend-edge-us-east:
<<: *edge-service
profiles: ["two-edge"]
environment:
<<: *rend-common-env
REND_EDGE_BIND_ADDR: 0.0.0.0:4100
REND_EDGE_ID: rend-edge-us-east
REND_EDGE_REGION: us-east
REND_EDGE_BASE_URL: http://rend-edge-us-east:4100
REND_CONTROL_PLANE_URL: http://rend-api:4000
REND_EDGE_HEARTBEAT_INTERVAL_SECS: "2"
REND_EDGE_CACHE_DIR: /var/lib/rend/edge-cache
REND_EDGE_ORIGIN_HEALTH_URL: http://minio:9000/minio/health/ready
REND_EDGE_TELEMETRY_INGEST_URL: http://rend-api:4000/internal/telemetry/playback
REND_EDGE_TELEMETRY_SPOOL_DIR: /var/spool/rend/edge-telemetry
ports:
- "4101:4100"
volumes:
- rend-edge-us-east-cache:/var/lib/rend/edge-cache
- rend-edge-us-east-telemetry-spool:/var/spool/rend/edge-telemetry
rend-edge-london:
<<: *edge-service
profiles: ["two-edge"]
environment:
<<: *rend-common-env
REND_EDGE_BIND_ADDR: 0.0.0.0:4100
REND_EDGE_ID: rend-edge-london
REND_EDGE_REGION: london
REND_EDGE_BASE_URL: http://rend-edge-london:4100
REND_CONTROL_PLANE_URL: http://rend-api:4000
REND_EDGE_HEARTBEAT_INTERVAL_SECS: "2"
REND_EDGE_CACHE_DIR: /var/lib/rend/edge-cache
REND_EDGE_ORIGIN_HEALTH_URL: http://minio:9000/minio/health/ready
REND_EDGE_TELEMETRY_INGEST_URL: http://rend-api:4000/internal/telemetry/playback
REND_EDGE_TELEMETRY_SPOOL_DIR: /var/spool/rend/edge-telemetry
ports:
- "4102:4100"
volumes:
- rend-edge-london-cache:/var/lib/rend/edge-cache
- rend-edge-london-telemetry-spool:/var/spool/rend/edge-telemetry
volumes:
rend-postgres-data:
rend-redis-data:
rend-clickhouse-data:
rend-minio-data:
rend-edge-cache:
rend-edge-telemetry-spool:
rend-edge-us-east-cache:
rend-edge-us-east-telemetry-spool:
rend-edge-london-cache:
rend-edge-london-telemetry-spool: