Repository navigation
listen: raise prod HPA minReplicas 30→40 - #22623
Conversation
A 40-pod floor rolls in 14 waves of 3 pods at a 300s startup budget, so the rollout wait and progressDeadlineSeconds rise to 4200s and the helm rollback wait to 70m, as #22461 did for the 30-pod floor. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: 1aeb49fc79
ℹ️ 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".
| autoscaling: | ||
| enabled: true | ||
| minReplicas: 30 | ||
| minReplicas: 40 |
There was a problem hiding this comment.
Update the scheduled prod scale-up floor to 40
When the tracked production scaler CronJob runs at 11:00 UTC, backend/charts/backend-listen/prod_omi_backend_listen_cronjob.yaml:46-47 patches this same HPA back to minReplicas: 30. That silently undoes the new capacity floor every day and reintroduces the CPU saturation and connection-loss conditions this change is intended to address; update the scheduled scale-up target alongside the values file.
Useful? React with 👍 / 👎.
| @@ -1,4 +1,4 @@ | |||
| progressDeadlineSeconds: 3000 | |||
| progressDeadlineSeconds: 4200 | |||
There was a problem hiding this comment.
Keep the progress deadline independent of rollout size
When a production rollout makes no progress at all—for example because every new pod has an image-pull or readiness failure—this increase delays ProgressDeadlineExceeded and the workflow failure from 50 to 70 minutes. Kubernetes defines this field as the interval before reporting that progress has stalled, and counts scaling a ReplicaSet or a pod becoming ready as progress; it is not a whole-rollout wall-clock budget (Deployment status documentation). The 40-replica wave calculation therefore justifies extending the separate kubectl rollout status watch, but not this stall detector; retain an appropriately bounded no-progress deadline so a broken production rollout is reported promptly.
Useful? React with 👍 / 👎.
| # See gcp_backend.yml: 300s cannot cover a full backend-listen roll; a | ||
| # stalled rollout still fails on progressDeadlineSeconds. | ||
| if ! kubectl -n ${{ vars.ENV }}-omi-backend rollout status deploy/${{ vars.ENV }}-omi-backend-listen --timeout=3000s; then | ||
| if ! kubectl -n ${{ vars.ENV }}-omi-backend rollout status deploy/${{ vars.ENV }}-omi-backend-listen --timeout=4200s; then |
There was a problem hiding this comment.
Refresh GKE credentials before waiting longer than one hour
For a rollout that legitimately takes between 60 and 70 minutes—the exact case this change is meant to permit—the workflow's kubeconfig can no longer authenticate the final status gate. The earlier get-gke-credentials@v3 step leaves use_auth_provider at its default false, which embeds a short-lived token rather than a refreshable auth-provider configuration (action documentation); the action's tracker documents these kubeconfigs returning unauthorized after the default one-hour lifetime (observed failure). Even if the existing watch connection survives, the strict deploy_status_report.py call immediately afterward starts fresh kubectl requests and fails, so the extra ten minutes cannot produce a successful deployment. Refresh the kubeconfig immediately before this wait or enable refreshable authentication; the composite action has the same default-token setup and changed timeout.
AGENTS.md reference: .github/AGENTS.md:L26-L29
Useful? React with 👍 / 👎.
## Summary - Lower prod `backend-listen` HPA `autoscaling.minReplicas` 40 → 30 (`maxReplicas` stays 60). The 40 floor was the 10-19 incident hardening (#22623); measured off-peak load needs only ~31 pods at the 55% CPU target, so 30 (the pre-#22623 floor) is enough night headroom and stops paying for ~9 idle pods every night. - Peak path untouched: same requests/limits, 55% target, socket guards (16 req / 35 ws per pod), max 60. The floor only binds off-peak; peaks still drive 50–60 pods (pegged at 60 on 10-20). - Matching pin: `test_backend_listen_helm_defaults.py` `(40, 60)` → `(30, 60)`. The #22623 rollout waits stay valid unchanged — a 30-pod floor rolls in fewer waves, not more (`test_backend_listen_rollout_wait_can_cover_a_real_rollout` passes with the existing 4200s waits and `progressDeadlineSeconds: 4200`). - Expected saving ≈ $1k/mo (~35% of listen node spend) together with the node-pool consolidation: night floor 40 → ~31 pods ⇒ 14 → 11 nodes. ## Evidence (read-only, prod, 2026-10-24, listen capacity review §4A) - Off-peak fleet 17.4–20.5 cores; at the 55% target that is ~31 pods. HPA status reports "desired replica count is less than the minimum" all night — the 40 floor is pure night waste. Socket guards idle at 4.2 req / 12.4 ws per pod vs 16/35. - Peak (10-22/23 14–18Z): fleet 34–38 cores, 50–60 pods — unchanged by this PR. - Reconnect-storm check: worst landing = all 635 peak fleet WS on the 30-pod floor = 21 ws/pod vs the 35-socket guard (1.7×); client reconnects are rate-shaped by `LISTEN_RECONNECT_BUDGET_PER_MIN=6`. ## Deploy timing Apply only after 22Z (listen freeze 13–22Z). Roll out via the normal listen helm workflow. ## Product invariants affected - INV-DATA-1: path match only (chart values); no data-path behavior change. ## Verification - `BACKEND_UNIT_TEST_FILE_LIST=<list file> BACKEND_PYTEST_WORKERS=4 bash backend/test.sh` (contracts, listen helm defaults, release vector): `test_workflow_contracts.py` 94 passed, `test_backend_listen_helm_defaults.py` 12 passed, `test_verify_backend_release_vector.py` 51 passed. Not verified here: an actual prod roll at the new floor. ## Rollback Revert this PR and re-roll the listen helm workflow. Scale-up is fast (50%/15s ≈ 5 pods/15s — back to a 40-pod fleet in ~2 min); the 4200s rollout waits stay valid in both directions. Failure-Class: none 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23476?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/23476?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23476&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Night fleet needs only ~31 pods at the 55% CPU target, so the 10-19 incident floor of 40 (BasedHardware#22623) idles ~9 pods every night. Return the floor to its pre-BasedHardware#22623 value of 30; peak path (max 60, requests, target, socket guards) is unchanged. Update the (40, 60) pin in test_backend_listen_helm_defaults.py; the 4200s rollout waits stay valid (a 30-pod floor rolls in fewer waves). Saves ~$1k/mo with the pool consolidation. Apply only after 22Z (listen freeze 13-22Z). Rollback: revert and re-roll; scale-up 50%/15s (~5 pods/15s) restores 40 in ~2 min.
…etire100) Batch at 100% moves consented mobile capture off the live sync path; the residual live leg (opt-outs + desktop, ~45-65% of sessions) needs ~19-27 listen pods, not the 42 running now. Pusher's 10-28 queue storm (sync-jobs-fresh depth 4.5k) has drained back to ~1.5k and the fresh queue's input collapses at 100%, so the emergency live-only floor of 36 lands as a chart value of 16 instead. - backend-listen: minReplicas 30 -> 20 (max 60 unchanged; socket guards and the BasedHardware#22623 rollout-timeout derivation only relax on a floor drop) - pusher: minReplicas 12 -> 16 (max 40 unchanged); mirrors the floor so deploys stop diverging from the live-only 36 - helm-defaults pin updated to (20, 60) Apply only with the live kubectl patch and guards from data/run-2026-10-13-two-lane-nemotron/retire100-changeset-2026-10-29.md, after the batch live100 gate (lead applies).
Summary
backend-listenHPAautoscaling.minReplicas30 → 40 (maxReplicasstays 60). This puts the floor the two-lane lead already patched live into the chart, so the next deploy doesn't drop it back to 30.test_backend_listen_rollout_wait_can_cover_a_real_rolloutneeds ≥ 4200s. As listen: raise prod HPA minReplicas 12→30 before live stage 2 #22461 did for the 30-pod floor, this PR raises thekubectl rollout statuswait (listen helm workflow anddeploy-backend-stack) and the prodprogressDeadlineSecondsfrom 3000s to 4200s, and the helm rollback--waitfrom 50m to 70m.test_workflow_contracts.pyis updated to match.Branch
lane/listen-hpa-min40intomain.Evidence (aggregates, prod, 2026-10-19)
connection_lostrose to 119/10m.connection_lostfell to 46/10m.Lane / contract
Two-lane live-STT capacity follow-up; no other lanes' files touched.
Product invariants affected
This change does not alter the Firebase/Firestore project or serving endpoints.
Verification
test_verify_backend_release_vector.py,test_workflow_contracts.py,test_listen_helm_env_overrides.py,test_streaming_stt_helm_key_bindings.py,test_backend_runtime_env_validator.py: 306 passed locally. Before the timeout changes, the rollout-wait invariant failed at minReplicas 40 (3000 < 4200).Rollback
Revert this PR. That returns minReplicas to 30 and the waits to 3000s / 50m.
Failure-Class: none
🤖 Generated with Claude Code