Files
karaoke-gen/backend/cloudbuild-gpu-base.yaml
Andrew Beveridge ☄️andClaude Opus 5.5 49464e8fcc chore(cost): GCP cost cuts round 2 (v0.261.4) (#1107)
Round 2 of the GCP cost cuts, approved by Andrew. Target: the whole
project under $300/mo; the current run-rate is about $400.

## Changes
- **karaoke-backend min-instances 1 → 0** (`ci.yml`), about $24/mo. The
backend Cloud Run service isn't defined in Pulumi, so the CI flag is the
only place this is set. Andrew accepts a ~15s cold start. The 60s
`/api/health` uptime check and the `*/10` schedulers keep an instance
warm most of the time. With `--cpu-throttling` (request-based billing),
a warm instance above the minimum costs nothing while idle.
- **audio-separator Cloud Run GPU service shut down** (us-east4), about
$22/mo. It is now behind the Pulumi flag `audioSeparatorServiceEnabled`,
off by default. The service, SA, IAM bindings, output bucket and AR repo
were already removed with a targeted `pulumi up`; the bucket needed the
break-glass SA. `audio-separation-job` is untouched; it uses
`karaoke-backend-gpu/karaoke-backend`. The separator health check no
longer depends on `AUDIO_SEPARATOR_API_URL`, which also fixes a status
card that always showed "offline". The CLI now logs a clear hint when
the remote API fails. Companion PR:
nomadkaraoke/python-audio-separator#309 makes its Cloud Run deploy
manual-only.
- **backup-to-aws no longer copies job files to S3**, about $15/mo
egress. Job files now rely on GCS versioning plus soft-delete.
Firestore, secrets, BigQuery, kn-data and git-bundle backups are
unchanged. The freshness monitor no longer checks `gcs/job-files/`, and
DISASTER-RECOVERY.md is updated.
- **Artifact Registry cleanup policies**, about $8–10/mo. Per package:
keep the 10 most recent versions plus anything tagged `latest`,
`content-` or `cache`; delete all other versions older than 7d. Until
now, tagged per-commit images were never deleted. Dropped the CI
fallback that copied the GPU base once from us-east4, and deleted the
legacy 13 GB us-east4 GPU base package.
- Docs: GCP-COST-OPTIMIZATION.md (new section, including how to redeploy
the separator on demand), ARCHITECTURE.md, DISASTER-RECOVERY.md.

Changes made outside Pulumi (gcf-artifacts cleanup policy, destroying
superseded secret versions) are recorded in GCP-COST-OPTIMIZATION.md.

## Tests
- `backend/tests/test_system_status_endpoint.py` (new separator status
tests)
- `infrastructure/functions/backup_to_aws` (49 tests, including a new
one that checks job files aren't synced)
- `tests/unit/test_audio_remote.py`, `test_audio_processor_local_gpu.py`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Service Availability**
* The hosted audio-separation service is no longer available. Audio
separation can run locally; users relying on the hosted service will
need another deployment.
* **Backup and Recovery**
* New job files are no longer copied to off-site S3 backups. S3 recovery
is limited to files backed up through September 30, 2026; newer outputs
may need to be regenerated.
* **System Status**
* Audio-separator health status now reports the locally installed
package version without checking a remote service.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 21:22:49 -04:00

36 lines
1.1 KiB
YAML

# Cloud Build config for GPU base image
#
# Builds the CUDA + PyTorch + models base image used by the audio worker.
# This image is large (~10GB) so builds take 15-30 minutes.
#
# Trigger manually:
# gcloud builds submit --config=backend/cloudbuild-gpu-base.yaml --project=nomadkaraoke --timeout=3600s
#
# The app-layer Dockerfile uses this as its BASE_IMAGE for audio worker deploys.
steps:
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-f'
- 'backend/Dockerfile.gpu-base'
- '-t'
- 'us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-gpu-base:latest'
- '-t'
- 'us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-gpu-base:$BUILD_ID'
- '--build-arg'
- 'BUILD_DATE=$_BUILD_DATE'
- '--build-arg'
- 'BUILD_ID=$BUILD_ID'
- '.'
images:
- 'us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-gpu-base:latest'
- 'us-central1-docker.pkg.dev/nomadkaraoke/karaoke-repo/karaoke-backend-gpu-base:$BUILD_ID'
timeout: '3600s'
options:
machineType: 'E2_HIGHCPU_32'
diskSizeGb: 100