Repository navigation
feat(backend): bind batch cohort and model callers to shared Gateway - #21482
Git-on-my-level merged 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 279008e2c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| value: "http://<GATEWAY_IP>/vad/v1/vad" | ||
| - name: HOSTED_SPEAKER_EMBEDDING_API_URL | ||
| value: "http://diarizer.omiapi.com:80" | ||
| value: "http://<GATEWAY_IP>/diarizer" | ||
| - name: HOSTED_TRANSLATION_API_URL | ||
| value: "http://nllb.omiapi.com" | ||
| value: "http://<GATEWAY_IP>/nllb" |
There was a problem hiding this comment.
Do not auto-deploy unresolved dev placeholders
When this lands on main, these are not inert examples: the inspected gcp_backend_listen_helm.yml push trigger deploys changes under backend/charts/backend-listen/**, gcp_backend_pusher_auto_deploy.yml does the same for the pusher chart, and gcp_backend_auto_dev.yml treats this commit's backend/** runtime-manifest changes as deployable. Because no dev VIP is reserved, those revisions receive the literal <GATEWAY_IP> hostname, so VAD, NLLB, and speaker-embedding requests fail before the lead can perform the replacement required by the new runbook; retain the legacy URLs or gate/substitute these automatic deployments until a real probed IP is committed.
Useful? React with 👍 / 👎.
| 4. Independently qualify/deploy the batch cohort A and its subsequent stages. | ||
| Do not switch `HOSTED_PARAKEET_API_URL` during this rollout. | ||
|
|
||
| Rollback the caller commit alone and redeploy **all** affected hosts, including |
There was a problem hiding this comment.
Make the documented rollbacks independently revertible
If either production migration needs the promised isolated rollback, the referenced caller commit does not exist: c23310332c10daa96d2e207fc386a062974ac63d contains both the caller URL changes and batch-cohort bindings, while its parent only adds the Gateway routes. Reverting this commit therefore restores the legacy callers and removes the batch binding together, contradicting the later promise that each revert preserves the other rollout; split the changes into independently revertible commits or document an exact partial rollback before rollout.
Useful? React with 👍 / 👎.
279008e to
3e4092f
Compare
3e4092f to
42b45ea
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42b45ea962
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| at least 30 minutes. Apply the combined caller commit via staged workflow | ||
| releases; if listen deploys all three URLs at once, qualify all routes first | ||
| and require separate NLLB/VAD metric readouts before the embedding cohort. | ||
| 4. Independently qualify/deploy the batch cohort A and its subsequent stages. |
There was a problem hiding this comment.
Keep batch A out of the caller deployment
When production follows step 3, the gcp_backend_pusher.yml Helm step consumes the entire prod pusher values file, while gcp_backend.yml's Deploy backend stack action renders the entire prod runtime manifest. Both inputs now already enable pyannote_shadow for pusher/backend/backend-sync, so the embedding rollout starts batch A before this step 4 has installed and qualified the batch route. That can send David's stored audio to an absent or unqualified backend and pollute the stage-A baseline; keep the cohort bindings off or separately overridable until the independent batch step.
Useful? React with 👍 / 👎.
Summary
Single runtime-env PR for the shared model Gateway rollout. Two independently revertible commits:
http://172.16.160.20/diarizer-batch. Both cohort percentages 0, authoritative false, sync false. Strict scope/parity checks accept only a complete reviewed ramp stage. The pyannote adapter appends/v2/diarization./nllb, VAD →/vad/v1/vad, and every speaker-embedding caller →/diarizerin dev/prod, including Parakeet's embedding fallback. Parakeet STT endpoints remain unchanged.Reserved addresses: dev
172.16.48.49(fresh ro-dev lookup after reservation appeared), prod172.16.160.20(ro-prod lookup). Both environments use concrete IPs. Reservation is not serving qualification: lead must probe Gateway programming, routes and caller reachability before deploying. No production user API calls, merge, deploy or ramp were performed.Exact ramp data
Complete env sets:
config/diarization-cohort-stages.json. Common values on backend/backend-sync/pusher:Combine these constants with this exact stage data (column names abbreviate
TRANSCRIPTION_; values are strings):&batch_cohortline: percentages"0", authoritative"false", hours"1""true""1", hours"80""5", hours"400"backend/deploy/runtime_env/prod.overlay.yamlowns the shared mapping. After that one-line data edit, recomposeruntime_env.yaml, align pusher chart literals with the selected stage, validate, and redeploy. No runtime code or guard changes per stage. Do not exceed 5%; wait ≥12h at D before proposing expansion. Hold every stage for sufficient gate samples.At each A/B/C/D check failure rate (
omi_transcription_final_pass_total, failed:*;omi_transcription_shadow_total), p95 latency (omi_transcription_final_pass_latency_seconds,omi_transcription_shadow_latency_seconds), speaker agreement (omi_transcription_final_pass_agreement) and word distance (omi_transcription_shadow_word_distance), owner parity (omi_transcription_shadow_owner_delta_ratio), remap correctness (omi_transcription_shadow_remap_success_rate,omi_transcription_shadow_remap_safe_total), and out-of-profile / determined language rate (omi_stt_output_language_segments_totalconformance labels;live_stt_language_summarylogs). Also inspectevent=transcription_shadow, scalar v2 results, batch queueomi_diarization_v2_queue_depth, 429/5xx, GPU load and current-revision/manual-annotation promotion receipts. Empty series do not pass; use matched baselines and review parity before B. No UID labels exist in aggregate metrics.Capacity / limits
The existing Redis daily cap is configurable and charges all selected stored audio, not just multi-speaker GPU work. At planning load 6,300 h/day, C/D select ~63/315 h; 80/400 h provide headroom. D's ~140 multi-speaker h/day × supplied T4 RTF .06 = 8.4 GPU-h/day, ~35% average occupancy on one T4. This is planning arithmetic, not a new T4 load-test receipt; queue/latency/bursts gate the ramp. Two-hour worker/API cap remains bounded: ~432s inference at .06 RTF versus 600s worker deadline and 900s Gateway timeout. ASR/decoding/queue consume the same worker budget. Longer calls retain legacy attribution; inspect
failed:too_longmetadata and excluded duration share. Sync stays false through D. Cloud Run process-local shadow dispatch is not durable: equal env does not prove Cloud Run receipt completion; durable shadow dispatch remains required for reliable Cloud Run coverage.Deploy order / rollback
See
backend/docs/diarizer-batch-cohort.md,backend/docs/internal-gateway-callers.mdandbackend/charts/internal-gateway/README.mdfor lead operations. Qualify Gateway/routes from GKE and Cloud Run first. Dev caller migration first, then prod; NLLB/VAD readouts and ≥30m hold, followed by coordinated embedding switches across all six speaker-ID hosts plus Parakeet fallback. Use listen/pusher workflows,gcp_backend.yml,gcp_parakeet.yml. Then independently deploy batch A and advance through gates. Listen carries NLLB/VAD/embedding together; qualify every route before that workflow and review NLLB/VAD separately before finishing the embedding cohort.Rollback caller commit alone and redeploy every affected caller, including Parakeet fallback; restore legacy hostnames/cluster-local fallback from the runbook. Keep the Gateway while batch still uses it. After either revert, recompose
runtime_env.yamlfrom the retained overlays (this also resolves generated-manifest conflicts without undoing the other commit). Rollback cohort commit alone and redeploy backend/backend-sync/pusher, or return to A to stop promotion; incident stop sets shadow kill switch true plus final-pass diarizer legacy. Disable batch callers before removing its capacity. Keep legacy Ingress/DNS ≥7d. No historical record rewriting.Validation
backend/scripts/pre-deploy-check.sh: dev/prod manifest and workflow/render validation passed; 305 deploy-safety tests passed.BACKEND_UNIT_TEST_FILE_LIST=/tmp/cohort-fast-tests.txt bash backend/test.sh(run from backend with its local Python): 65 tests passed across cohort, caller, co-host guard and adapter contracts; CPU duration guard enabled.backend/test.shwithtest_verify_pusher_config_references.py: 28 rendered binding contract tests passed, CPU duration guard enabled.python scripts/test_check_feature_flag_registry.py: 24 tests passed, including shared-map resolution.make preflight: 41 selected checks passed; final pre-push passed the manifest checks, typecheck (0 errors), source closure (16 images) and changed backend tests.Runtime-only changes exercise rendering and hermetic adapters rather than calling production user APIs. Lead-owned serving probes and acceptance are not performed by this PR.
Product invariants affected
Why isn't this a shared primitive instead? The shared final-pass policy, Redis cap and adapter already exist (#21424); this PR binds them and reuses the shared Gateway (#21473). Stage data and the existing co-host guard prevent the obsolete endpoint or widened/mixed cohorts prepared in 3ec0377. Registry rendering resolves the shared overlay mapping so documented effective bindings remain accurate.