worker compose: run node-agent in host network mode
The agent now uses network_mode: host so os.hostname() and the network interface list reflect the actual host instead of a per-container random hex hostname (root cause of duplicate Zampp2 rows) and a 172.x docker bridge IP. Also passes NODE_IP and BMD_MODEL through for explicit overrides.
This commit is contained in:
parent
049beb8818
commit
40a66bae03
1 changed files with 15 additions and 18 deletions
|
|
@ -6,10 +6,12 @@
|
|||
# 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
|
||||
# NODE_IP Host LAN IP to report (set by onboard-node.sh)
|
||||
#
|
||||
# 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*)
|
||||
# BMD_COUNT Number of Blackmagic DeckLink cards (default: auto-detect from /dev/blackmagic/)
|
||||
# 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
|
||||
#
|
||||
# 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
|
||||
|
|
@ -18,40 +20,35 @@
|
|||
#
|
||||
# Profiles:
|
||||
# (default) node-agent only — cluster visibility + hardware heartbeat
|
||||
# --profile worker + CPU job worker (proxy generation, transcoding)
|
||||
# --profile worker + CPU/GPU 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
|
||||
#
|
||||
# # SDI capture node (1 DeckLink, no GPU worker):
|
||||
# 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:
|
||||
|
||||
# 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.
|
||||
node-agent:
|
||||
build: ./services/node-agent
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
environment:
|
||||
MAM_API_URL: ${MAM_API_URL}
|
||||
NODE_TOKEN: ${NODE_TOKEN:-}
|
||||
NODE_ROLE: ${NODE_ROLE:-worker}
|
||||
AGENT_PORT: 3002
|
||||
NODE_IP: ${NODE_IP:-}
|
||||
AGENT_PORT: ${AGENT_PORT:-7436}
|
||||
HEARTBEAT_MS: ${HEARTBEAT_MS:-30000}
|
||||
GPU_COUNT: ${GPU_COUNT:--1}
|
||||
BMD_COUNT: ${BMD_COUNT:--1}
|
||||
ports:
|
||||
- "${AGENT_PORT:-7436}:3002"
|
||||
networks:
|
||||
- wild-dragon-worker
|
||||
BMD_MODEL: ${BMD_MODEL:-}
|
||||
devices:
|
||||
- /dev/blackmagic:/dev/blackmagic
|
||||
volumes:
|
||||
- /dev:/dev:ro
|
||||
|
||||
worker:
|
||||
build: ./services/worker
|
||||
|
|
|
|||
Loading…
Reference in a new issue