Files
cuframes-composer/docker/docker-compose.example.yml
gx 804cadda08 Phase 6 prep: production Dockerfile + docker-compose пример
docker/Dockerfile — multi-stage build:
  builder: nvidia/cuda:12.6.0-devel-ubuntu24.04 + apt build-deps + cmake
  runtime: nvidia/cuda:12.6.0-runtime-ubuntu24.04 + apt runtime-deps
           + grid_record/simple_record + libcuframes.so.0 + libcuframes_composer.so.0

NVIDIA_DRIVER_CAPABILITIES=compute,utility,video в env image'а — обязательно
для NVENC dlopen libnvidia-encode.so.1.

docker/docker-compose.example.yml — образец для интеграции в
localhost-infra/hosts/R9-88.23/docker/cctv/. Два сервиса:
  cfc-grid          — композитор + control plane + MQTT health
  cfc-grid-ffmpeg   — pipe→RTSP push (использует существующий
                       ffmpeg-vf-cuda-grid image для совместимости glibc)

Сообщение в docs/docker/docker-compose.example.yml объясняет зависимости
(cuframes-ipc-anchor, cctv-mosquitto и т.д.) и нужный MQTT user.

Phase 6 deploy (intent перевести production):
  - Создать MQTT user composer + добавить в localhost-infra mosquitto passwd
  - Запустить cfc-grid параллельно с cuda-grid-pipeline (разные RTSP paths,
    не конфликтуют)
  - После проверки на проде — retire старый cuda-grid-pipeline
  - Обновить TV-плейлисты на новый rtsp://...:554/cfc-grid

Эти шаги требуют отдельных commit'ов в localhost-infra repo с явным
user approval, поэтому здесь только prep.
2026-06-03 06:26:14 +01:00

100 lines
3.1 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# cuframes-composer — пример docker-compose сервиса.
#
# Этот файл — образец для интеграции в localhost-infra/hosts/R9-88.23/docker/cctv/.
# В проде используется как отдельный service `cfc-grid` рядом с существующим
# cuda-grid-pipeline (постепенный переход в Phase 6).
#
# Зависимости (должны существовать в основном compose-стеке):
# - cuframes-ipc-anchor (для IPC namespace)
# - cuda-grid-mediamtx (RTSP server)
# - cctv-mosquitto (MQTT broker)
# - cctv-network (общая Docker network)
# - cctv_cuframes_sock volume (с cuframes UNIX-сокетами публишеров)
# - cuda_grid_icons volume (RGBA PNG-иконки)
services:
cfc-grid:
image: gx/cuframes-composer:0.1
container_name: cfc-grid
restart: unless-stopped
runtime: nvidia # NVIDIA Container Toolkit
environment:
NVIDIA_DRIVER_CAPABILITIES: "compute,utility,video"
NVIDIA_VISIBLE_DEVICES: "all"
networks:
- cctv
ipc: "container:cuframes-ipc-anchor"
depends_on:
- cuframes-ipc-anchor
- cuda-grid-mediamtx
- cctv-mosquitto
volumes:
- cctv_cuframes_sock:/run/cuframes:ro
- cuda_grid_icons:/icons:ro
- /usr/share/fonts/truetype/dejavu:/fonts:ro
- /tmp/cfc-pipe-dir:/out
ports:
- "5599:5599" # ZMQ control plane
command:
- "--out"
- "/out/grid.h264"
- "--fps=25"
- "--bitrate=4000"
- "--width=1920"
- "--height=1080"
- "--border=4"
- "--control=tcp://0.0.0.0:5599"
- "--mqtt=cctv-mosquitto:1883"
- "--mqtt-instance=cfc-grid"
- "--mqtt-user=composer"
- "--mqtt-pass=${COMPOSER_MQTT_PASSWORD}"
- "--text=id=label-parking:/fonts/DejaVuSans-Bold.ttf,28,255,255,255,16,16,Парковка"
- "--text=id=label-backyard:/fonts/DejaVuSans-Bold.ttf,28,255,255,255,976,16,Задний двор"
- "--text=id=label-frontyard:/fonts/DejaVuSans-Bold.ttf,28,255,255,255,16,556,Передний двор"
- "--text=id=label-gate:/fonts/DejaVuSans-Bold.ttf,28,255,255,255,976,556,Ворота LPR"
- "--cell=cam-parking,0,0,960,540"
- "--cell=cam-back_yard,960,0,960,540"
- "--cell=cam-front_yard,0,540,960,540"
- "--cell=cam-gate_lpr,960,540,960,540"
cfc-grid-ffmpeg:
image: ffmpeg-vf-cuda-grid:phase4b-final
container_name: cfc-grid-ffmpeg
restart: unless-stopped
networks:
- cctv
depends_on:
- cfc-grid
- cuda-grid-mediamtx
volumes:
- /tmp/cfc-pipe-dir:/pipe:ro
entrypoint: ["/opt/ffmpeg/bin/ffmpeg"]
command:
- "-loglevel"
- "warning"
- "-fflags"
- "+genpts"
- "-r"
- "25"
- "-f"
- "h264"
- "-i"
- "/pipe/grid.h264"
- "-c"
- "copy"
- "-f"
- "rtsp"
- "-rtsp_transport"
- "tcp"
- "rtsp://cuda-grid-mediamtx:8554/cfc-grid"
networks:
cctv:
external: true
volumes:
cctv_cuframes_sock:
external: true
cuda_grid_icons:
external: true