fix(remote): unblock audio-separator-remote for typical files (#288)
* fix(remote): unblock audio-separator-remote for typical files Two independent issues prevented `audio-separator-remote` from working end-to-end against the GCP Cloud Run deployment: 1. **CLI hits Cloud Run's 32 MiB request body limit on real audio files.** The underlying AudioSeparatorAPIClient already supports a `gcs_uri` mode where the server fetches from GCS (used by karaoke-gen), but the CLI only exposed the multipart upload path. Now the CLI detects files >30 MiB and auto-uploads to GCS, passes `gcs_uri` to the API, and cleans up the GCS object in a `finally` block (the bucket's 1-day lifecycle is the safety net). Bucket configurable via `--gcs-bucket` or `AUDIO_SEPARATOR_GCS_INPUT_BUCKET`; defaults to the existing `nomadkaraoke-audio-separator-outputs` (separator SA already has objectAdmin, no infra change needed). `google-cloud-storage` is lazy-imported with a clear install hint if missing. 2. **Cloud Run server silently runs in CPU mode, not GPU.** The image relied on `pip install ".[gpu]"` for GPU support, which only swaps in `onnxruntime-gpu` — the `torch>=2.3` constraint pulls PyPI's default CPU-only PyTorch wheel. Result: `torch.cuda.is_available()` returns False, Separator falls back to CPU, jobs run ~10x slower (50 min instead of 5 min for the vocal_balanced preset). karaoke-gen's audio-separation-job image already documents this gotcha in `Dockerfile.gpu-base:100-106`; mirroring that pattern here: install `torch==2.6.0+cu126` from the cu126 index first so audio-separator[gpu] sees torch as already satisfied. Tests: 7 new unit tests covering GCS upload helpers (blob path format, URI parsing, error handling), bucket resolution priority (--flag > env > default), and the integration into handle_separate_command (large/small file, cleanup on failure, upload failure). Bumps version to 0.44.2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test: pass gcs_bucket to handle_separate_command in integration test Missed this call site when updating the function signature. Unit tests in tests/unit/test_remote_cli.py were updated, but integration test test_cli_separate_command_integration still passed only 3 args. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A
Andrew Beveridge ☄️ committed
fca0cf76d52b545cedbc75e1d3aea626d513c036
Parent: f510043
Committed by GitHub <noreply@github.com>
on 5/18/2026, 11:22:49 PM