Skip to content

feat(backend): bind batch cohort and model callers to shared Gateway - #21482

Merged
Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/diarizer-batch-cohort
Oct 14, 2026
Merged

Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/diarizer-batch-cohort

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Single runtime-env PR for the shared model Gateway rollout. Two independently revertible commits:

  1. David-only batch diarization shadow on backend, backend-sync and pusher through 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.
  2. NLLB → /nllb, VAD → /vad/v1/vad, and every speaker-embedding caller → /diarizer in 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), prod 172.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:

HOSTED_DIARIZATION_API_URL=http://172.16.160.20/diarizer-batch
TRANSCRIPTION_FINAL_PASS_DIARIZER=pyannote_shadow
TRANSCRIPTION_FINAL_PASS_BACKEND=pyannote
TRANSCRIPTION_FINAL_PASS_UID_ALLOWLIST=vi7SA9ckQCe4ccobWNxlbdcNdC23
TRANSCRIPTION_FINAL_PASS_SYNC_ENABLED=false
TRANSCRIPTION_SHADOW_ENABLED=true
TRANSCRIPTION_SHADOW_KILL_SWITCH=false
TRANSCRIPTION_SHADOW_UID_ALLOWLIST=vi7SA9ckQCe4ccobWNxlbdcNdC23

Combine these constants with this exact stage data (column names abbreviate TRANSCRIPTION_; values are strings):

Stage FINAL_PASS_PERCENT SHADOW_PERCENT FINAL_PASS_AUTHORITATIVE SHADOW_DAILY_AUDIO_HOURS One-line prod overlay change, then redeploy all three
A David shadow 0 0 false 1 &batch_cohort line: percentages "0", authoritative "false", hours "1"
B David authoritative 0 0 true 1 Same line: authoritative "true"
C 1% authoritative + David 1 1 true 80 Same line: both percentages "1", hours "80"
D 5% authoritative + David 5 5 true 400 Same line: both percentages "5", hours "400"

backend/deploy/runtime_env/prod.overlay.yaml owns the shared mapping. After that one-line data edit, recompose runtime_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_total conformance labels; live_stt_language_summary logs). Also inspect event=transcription_shadow, scalar v2 results, batch queue omi_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_long metadata 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.md and backend/charts/internal-gateway/README.md for 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.yaml from 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.sh with test_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.
  • Independent rollback verified with a temporary Git index and recomposed overlays: each configuration preserves the other migration. Cohort revert requires regenerating the shared manifest as documented.

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

  • INV-MEM-4 — runtime manifest changes preserve the existing canonical memory authority bindings.

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T11:19:20.828696Z 42b45ea New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +311 to +315
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level force-pushed the lane/diarizer-batch-cohort branch from 279008e to 3e4092f Compare October 14, 2026 10:54
@Git-on-my-level
Git-on-my-level force-pushed the lane/diarizer-batch-cohort branch from 3e4092f to 42b45ea Compare October 14, 2026 11:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit ea093bc into BasedHardware:main Oct 14, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant