2026-05-20 13:48:27 -04:00
|
|
|
# Wild Dragon MAM — Worker Node Stack
|
|
|
|
|
# ─────────────────────────────────────
|
|
|
|
|
# Deploy on any machine you want to join the cluster as a worker.
|
|
|
|
|
# The primary stack (mam-api, db, redis) continues running on TrueNAS.
|
|
|
|
|
#
|
|
|
|
|
# Required env vars (set in .env.worker or export before running):
|
|
|
|
|
# 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
|
2026-05-21 00:14:33 -04:00
|
|
|
# NODE_IP Host LAN IP to report (set by onboard-node.sh)
|
2026-05-20 13:48:27 -04:00
|
|
|
#
|
2026-05-20 14:19:21 -04:00
|
|
|
# Optional hardware overrides (if Docker can't see /dev directly):
|
|
|
|
|
# GPU_COUNT Number of NVIDIA GPUs on this node (default: auto-detect from /dev/nvidia*)
|
2026-05-21 00:14:33 -04:00
|
|
|
# BMD_COUNT Number of Blackmagic DeckLink cards (default: auto-detect from /dev/blackmagic/)
|
|
|
|
|
# BMD_MODEL Marketed card name (e.g. "DeckLink Duo 2") — drives the port-diagram UI
|
2026-05-20 14:19:21 -04:00
|
|
|
#
|
|
|
|
|
# Optional env vars (needed only if starting the worker or capture profiles):
|
2026-05-20 13:48:27 -04:00
|
|
|
# REDIS_URL, DATABASE_URL, S3_ENDPOINT, S3_BUCKET, S3_ACCESS_KEY, S3_SECRET_KEY
|
2026-05-20 14:19:21 -04:00
|
|
|
# BMD_DEVICE_0 DeckLink device path (default: /dev/blackmagic/dv0)
|
|
|
|
|
# BMD_DEVICE_1 DeckLink device path (default: /dev/blackmagic/dv1)
|
2026-05-21 18:51:11 -04:00
|
|
|
# LIVE_DIR Host path for HLS live segments (default: /mnt/NVME/MAM/wild-dragon-live)
|
2026-05-20 14:19:21 -04:00
|
|
|
#
|
|
|
|
|
# Profiles:
|
|
|
|
|
# (default) node-agent only — cluster visibility + hardware heartbeat
|
2026-05-21 00:14:33 -04:00
|
|
|
# --profile worker + CPU/GPU job worker (proxy generation, transcoding)
|
2026-05-20 14:19:21 -04:00
|
|
|
# --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
|
2026-05-21 18:51:11 -04:00
|
|
|
#
|
|
|
|
|
# NOTE: The node-agent mounts /var/run/docker.sock to spawn on-demand SDI
|
|
|
|
|
# capture sidecars when the primary mam-api routes a recorder to this node.
|
|
|
|
|
# Build the capture image before first use:
|
|
|
|
|
# docker compose -f docker-compose.worker.yml build capture
|
2026-05-20 13:48:27 -04:00
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
2026-05-21 00:14:33 -04:00
|
|
|
# node-agent runs in host network mode so it can see the real host
|
|
|
|
|
# interfaces, GPU devices and DeckLink cards without bridging tricks.
|
|
|
|
|
# The reported IP / hostname will be the host's, not the container's.
|
2026-05-20 13:48:27 -04:00
|
|
|
node-agent:
|
|
|
|
|
build: ./services/node-agent
|
|
|
|
|
restart: unless-stopped
|
2026-05-21 00:14:33 -04:00
|
|
|
network_mode: host
|
2026-05-20 13:48:27 -04:00
|
|
|
environment:
|
|
|
|
|
MAM_API_URL: ${MAM_API_URL}
|
|
|
|
|
NODE_TOKEN: ${NODE_TOKEN:-}
|
|
|
|
|
NODE_ROLE: ${NODE_ROLE:-worker}
|
2026-05-21 00:14:33 -04:00
|
|
|
NODE_IP: ${NODE_IP:-}
|
|
|
|
|
AGENT_PORT: ${AGENT_PORT:-7436}
|
2026-05-20 13:48:27 -04:00
|
|
|
HEARTBEAT_MS: ${HEARTBEAT_MS:-30000}
|
2026-05-20 14:19:21 -04:00
|
|
|
GPU_COUNT: ${GPU_COUNT:--1}
|
|
|
|
|
BMD_COUNT: ${BMD_COUNT:--1}
|
2026-05-21 00:14:33 -04:00
|
|
|
BMD_MODEL: ${BMD_MODEL:-}
|
2026-05-21 18:51:11 -04:00
|
|
|
LIVE_DIR: ${LIVE_DIR:-/mnt/NVME/MAM/wild-dragon-live}
|
2026-05-21 00:14:33 -04:00
|
|
|
volumes:
|
2026-05-21 18:51:11 -04:00
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
2026-05-21 00:14:33 -04:00
|
|
|
- /dev:/dev:ro
|
2026-05-21 18:51:11 -04:00
|
|
|
devices:
|
|
|
|
|
- /dev/blackmagic:/dev/blackmagic
|
2026-05-20 13:48:27 -04:00
|
|
|
|
|
|
|
|
worker:
|
|
|
|
|
build: ./services/worker
|
|
|
|
|
profiles: [worker]
|
|
|
|
|
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}
|
|
|
|
|
S3_REGION: ${S3_REGION:-us-east-1}
|
2026-05-20 14:19:21 -04:00
|
|
|
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"
|
2026-05-20 13:48:27 -04:00
|
|
|
networks:
|
|
|
|
|
- wild-dragon-worker
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
wild-dragon-worker:
|
|
|
|
|
driver: bridge
|