video-accessibility/docker-compose.optical-dev.yml
Vadym Samoilenko c1948ea198 feat(ux): T-2/PR-7/PR-8 — status color helper, queue stats widget, upload-final-VTT override
T-2: Extract getJobStatusColor() into utils/jobStatusMessages.ts; StatusBadge now uses the
     shared helper (single source of truth for badge colors).

PR-7: GET /admin/production/queue-stats — returns Celery queue depths via Redis LLEN.
      Production dashboard shows a live panel (10s refresh) with per-queue task counts.

PR-8: POST /admin/production/jobs/{id}/upload-final-vtt — Production/Admin can upload a
      hand-crafted VTT to bypass AI, writing to GCS and advancing the job to PENDING_QC.
      Upload modal added to FailuresList with language + type (captions/ad) selectors.

docker-compose.optical-dev.yml: enable USE_CELERY_FALLBACK=true, set worker replicas=1
      for all pipeline workers (ffmpeg/tts/whisper) with WORKER_CONCURRENCY=2 so the full
      pipeline runs on the 2-CPU optical-dev server until Cloud Run VPC Connector is ready.

Fix: remove unused effectiveMs variable in TimelinePreview (TS6133).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 11:12:36 +01:00

99 lines
2.5 KiB
YAML

# =============================================================================
# optical-dev overrides — 2 CPU / ~8 GB RAM server
#
# Cloud Run Jobs (va-worker) are NOT yet reachable from this server
# (VPC Connector pending). Until then USE_CELERY_FALLBACK=true routes all
# heavy tasks through local Celery workers constrained to WORKER_CONCURRENCY=2
# so they fit in 2 CPU without OOM on large videos.
#
# Usage:
# docker compose -f docker-compose.yml \
# -f docker-compose.prod.yml \
# -f docker-compose.optical-dev.yml \
# --env-file .env.production up -d
# =============================================================================
services:
# ── Keep on this server, resource limits fit in 2 CPU ──────────────────────
mongodb:
deploy:
resources:
limits:
memory: 1G
cpus: '0.5'
reservations:
memory: 512M
cpus: '0.25'
redis:
deploy:
resources:
limits:
memory: 512M
cpus: '0.25'
reservations:
memory: 256M
cpus: '0.1'
api:
deploy:
resources:
limits:
memory: 2G
cpus: '1.0'
reservations:
memory: 1G
cpus: '0.5'
environment:
APP_ENV: prod
# Fallback mode: bypass Cloud Run, dispatch heavy tasks to local workers
USE_CELERY_FALLBACK: "true"
WORKER_CONCURRENCY: "2"
# Full worker: handles ALL queues in fallback mode
worker:
deploy:
replicas: 1
resources:
limits:
memory: 2G
cpus: '0.75'
reservations:
memory: 1G
cpus: '0.25'
environment:
APP_ENV: prod
WORKER_CONCURRENCY: "2"
command: >
celery -A app.tasks worker
--loglevel=info
--queues=default,ingest,tts,render,ffmpeg,whisper,notify,embed
--concurrency=2
--hostname=full-worker@%h
# ── Pipeline workers — enabled in fallback mode ────────────────────────────
ffmpeg-worker:
deploy:
replicas: 1
resources:
limits:
memory: 1G
cpus: '0.5'
tts-worker:
deploy:
replicas: 1
resources:
limits:
memory: 512M
cpus: '0.25'
whisper-worker:
deploy:
replicas: 1
resources:
limits:
memory: 2G
cpus: '0.5'