feat: worker compose adds capture profile (BMD DeckLink) and GPU env vars

This commit is contained in:
Zac Gaetano 2026-05-20 14:19:21 -04:00
parent a55c182be9
commit 7486539b32

View file

@ -7,14 +7,33 @@
# MAM_API_URL URL of the primary MAM API e.g. http://10.0.0.25:47432 # MAM_API_URL URL of the primary MAM API e.g. http://10.0.0.25:47432
# NODE_TOKEN Bearer token from the primary's Tokens page # NODE_TOKEN Bearer token from the primary's Tokens page
# #
# Optional env vars (needed only if starting the worker profile): # Optional hardware overrides (if Docker can't see /dev directly):
# REDIS_URL, DATABASE_URL, S3_ENDPOINT, S3_BUCKET, S3_ACCESS_KEY, S3_SECRET_KEY # GPU_COUNT Number of NVIDIA GPUs on this node (default: auto-detect from /dev/nvidia*)
# BMD_COUNT Number of Blackmagic DeckLink cards (default: auto-detect from /dev/blackmagic/)
# #
# Start node-agent only (cluster visibility + health): # Optional env vars (needed only if starting the worker or capture profiles):
# REDIS_URL, DATABASE_URL, S3_ENDPOINT, S3_BUCKET, S3_ACCESS_KEY, S3_SECRET_KEY
# BMD_DEVICE_0 DeckLink device path (default: /dev/blackmagic/dv0)
# BMD_DEVICE_1 DeckLink device path (default: /dev/blackmagic/dv1)
#
# Profiles:
# (default) node-agent only — cluster visibility + hardware heartbeat
# --profile worker + CPU job worker (proxy generation, transcoding)
# --profile capture + SDI capture service (requires Blackmagic DeckLink card)
#
# To enable GPU transcoding, also apply docker-compose.gpu.yml:
# docker compose -f docker-compose.worker.yml -f docker-compose.gpu.yml --profile worker up -d
#
# Examples:
# # Agent only (register node in cluster, report hardware):
# docker compose -f docker-compose.worker.yml up -d # docker compose -f docker-compose.worker.yml up -d
# #
# Start node-agent + job worker (full processing node): # # SDI capture node (1 DeckLink, no GPU worker):
# docker compose -f docker-compose.worker.yml --profile worker up -d # docker compose -f docker-compose.worker.yml --profile capture up -d
#
# # Full node (GPU worker + SDI capture):
# docker compose -f docker-compose.worker.yml -f docker-compose.gpu.yml \
# --profile worker --profile capture up -d
services: services:
@ -27,6 +46,8 @@ services:
NODE_ROLE: ${NODE_ROLE:-worker} NODE_ROLE: ${NODE_ROLE:-worker}
AGENT_PORT: 3002 AGENT_PORT: 3002
HEARTBEAT_MS: ${HEARTBEAT_MS:-30000} HEARTBEAT_MS: ${HEARTBEAT_MS:-30000}
GPU_COUNT: ${GPU_COUNT:--1}
BMD_COUNT: ${BMD_COUNT:--1}
ports: ports:
- "${AGENT_PORT:-7436}:3002" - "${AGENT_PORT:-7436}:3002"
networks: networks:
@ -44,6 +65,29 @@ services:
S3_ACCESS_KEY: ${S3_ACCESS_KEY} S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY} S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_REGION: ${S3_REGION:-us-east-1} S3_REGION: ${S3_REGION:-us-east-1}
NVENC_ENABLED: ${NVENC_ENABLED:-false}
networks:
- wild-dragon-worker
# SDI capture service — only start on nodes with Blackmagic DeckLink cards
# Set BMD_DEVICE_0 in .env.worker to the actual device path, e.g. /dev/blackmagic/dv0
capture:
build: ./services/capture
profiles: [capture]
restart: unless-stopped
environment:
REDIS_URL: ${REDIS_URL}
DATABASE_URL: ${DATABASE_URL}
S3_ENDPOINT: ${S3_ENDPOINT}
S3_BUCKET: ${S3_BUCKET}
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
CAPTURE_PORT: 3001
devices:
- ${BMD_DEVICE_0:-/dev/blackmagic/dv0}:/dev/blackmagic/dv0
- ${BMD_DEVICE_1:-/dev/blackmagic/dv1}:/dev/blackmagic/dv1
ports:
- "${CAPTURE_PORT:-7437}:3001"
networks: networks:
- wild-dragon-worker - wild-dragon-worker