StephennFernandes's picture
Anuvani-Diarization 1.0.0
63dd946
Raw History Blame Contribute Delete
3.77 kB
# The serving deployment: the FastAPI service (the Rust engine: decoding, block scheduling over every GPU, masks,
# clustering, the decoder, the RTTM) and, from the file `diar up` writes beside its state ($DIAR_STATE/tritons.yml),
# one Triton per GPU holding the two networks, all on a private bridge network. Only the service's port is published
# (127.0.0.1 by default). Driven by ../../diar (up, down, status, logs), which also writes the .env this file reads:
# ../../diar up # every GPU of this machine, the default lane (ffn16)
# ../../diar up 2 --exact # the first two GPUs, the exact lane
# Each Triton sees only its own GPU (NVIDIA_VISIBLE_DEVICES=UUID) and holds that GPU's model diar_nn_g<i> (device 0
# inside the container) and resample_cpu; it checks every batch shape against the release's outputs before it serves.
# The service finds every diar_nn_g<i> model on the Tritons it is given (--gpus auto), on this machine or others.
services:
# one process, one engine: it owns every Triton it is given, on this machine and on others (diar up --remote)
service:
image: ${SERVICE_IMAGE}
networks: [diar]
command: ["--listen", "0.0.0.0:8180", "--triton", "${TRITON_URLS}", "--gpus", "auto",
"--slots-per-gpu", "${SLOTS_PER_GPU}", "--schedule", "${SCHEDULE}",
"--spool", "/var/lib/anuvani-diar/spool", "--triton-wait-s", "1200",
"--max-jobs", "${MAX_JOBS}", "--max-uploads", "${MAX_UPLOADS}", "--max-upload-mb", "${MAX_UPLOAD_MB}",
"--max-spool-gb", "${MAX_SPOOL_GB}", "--audio-budget-gb", "${AUDIO_BUDGET_GB}",
"--decode-threads", "${DECODE_THREADS}", "--post-threads", "${POST_THREADS}"]
environment: ["ANUVANI_DIAR_TOKEN=${TOKEN}"]
ports: ["${SERVICE_BIND}:${SERVICE_PORT}:8180"]
volumes: ["spool:/var/lib/anuvani-diar"]
# the service drains for 30 s (--drain-s), then stops
stop_grace_period: 60s
restart: unless-stopped
logging: { driver: json-file, options: { max-size: "50m", max-file: "5" } }
# runs as the account that started the deployment, so that it can read the service's token file (mode 0600)
prometheus:
image: prom/prometheus:v3.11.0
profiles: [obs]
networks: [diar]
user: "${HOST_UID}:${HOST_GID}"
command: ["--config.file=/etc/prometheus/prometheus.yml", "--storage.tsdb.path=/prometheus",
"--storage.tsdb.retention.time=15d"]
volumes: ["${PROM_CONFIG}:/etc/prometheus/prometheus.yml:ro", "${TOKEN_FILE}:/etc/prometheus/service_token:ro",
"${PROM_DATA}:/prometheus"]
ports: ["127.0.0.1:${PROM_PORT}:9090"]
restart: unless-stopped
grafana:
image: grafana/grafana:12.4.2
profiles: [obs]
networks: [diar]
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
- GF_AUTH_ANONYMOUS_ENABLED=false
- PROM_URL=http://prometheus:9090
volumes: ["./grafana/provisioning:/etc/grafana/provisioning:ro", "./grafana/dashboards:/var/lib/grafana/dashboards:ro",
"grafana-data:/var/lib/grafana"]
ports: ["127.0.0.1:${GRAFANA_PORT}:3000"]
restart: unless-stopped
# GPU counters; without its PROF_* fields, which DCGM serves to one client per GPU (a host that already runs an
# exporter with them: point Prometheus there instead, DCGM_TARGET)
dcgm-exporter:
image: nvcr.io/nvidia/k8s/dcgm-exporter:3.3.9-3.6.1-ubuntu22.04
profiles: [dcgm]
networks: [diar]
runtime: nvidia
cap_add: [SYS_ADMIN]
environment: [NVIDIA_VISIBLE_DEVICES=all]
command: ["-f", "/etc/dcgm-exporter/counters.csv", "-c", "1000"]
volumes: ["./dcgm_counters.csv:/etc/dcgm-exporter/counters.csv:ro"]
restart: unless-stopped
networks:
diar: {}
volumes:
spool: {}
grafana-data: {}