Repository navigation
fix(metrics): re-land GMP scrape token and collector RBAC (#24961) - #25040
Merged
Merged
Conversation
Re-applies #24961 (merged as 48eaf3e) unchanged by reverting its revert (8141729), and fixes the shard-5 CI failure that triggered the revert. The shard-5 red was not #24961's content. Backend unit shard 5/8 in run 42786950639 failed on the per-test CPU duration guard: test_pusher_storage_pcm_saturation.py::test_50_sockets_plateau_refuse_without_ack_then_retry_once measured 1.01s against the 1.00s fail limit while all 38 tests in that file passed. The same node measured 0.70s / 0.77s / 0.85s on recent main runs; the test drives 50 real producer threads against a stubbed slow GCS with tracemalloc and RSS sampling, so its call-phase CPU is not stable and the fail limit sits inside its own spread. #24961 changed only charts and chart tests; its new test_backend_secrets_chart.py shifted the weighted LPT shard deal, which moved this file from shard 4 to shard 5, but CPU time is per-process, so the shard move is incidental. Fix: exempt that node in tests/fast_unit_duration_allowlist.txt, the documented mechanism for genuine unit tests whose measured CPU exceeds the failure threshold. The test still runs and still asserts; only the duration guard is exempted. The five objects are live in prod since 2026-11-10T09:07Z and load-bearing (pusher 22/22, listen 28/29 after the gmp-system collector restart); this commit makes git match. David approved the access change at 2026-11-10T08:53Z (relay-cl1 e68296). Failure-Class: none
Mark the 50-socket saturation stress test slow instead of duration-allowlisting it. Select both scrape-auth chart tests for monitoring changes, compare secret names across all three charts, and cover missing METRICS_SECRET. Document Helm ownership and destructive rollback, and explain the field-selector restriction and collector watch requirement without changing RBAC verbs. Failure-Class: none
List the saturation file in the existing slow-guardrail manifest so the slow-marked plateau/refuse-without-ACK/retry behavior runs in the recurring guardrail job. The manifest supports file granularity; its marker filter selects only this slow test. Failure-Class: none
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-land #24961, reverted by 8141729f. The reland restores the chart, chart-test, and pipeline-note changes from that revert. This review fix marks the 50-socket saturation stress test
slow, removes its duration allowlist exemption, completes chart test selection, pins the cross-chart secret contract, covers absentMETRICS_SECRET, and corrects ownership/rollback documentation.LIVE DRIFT: the 5 objects (ExternalSecret metrics-scrape-token-store; Role+RoleBinding prod-omi-pusher-metrics-scrape and prod-omi-backend-listen-metrics-scrape) are live in prod since 2026-11-10T09:07Z and load-bearing; this PR makes git match. They are Helm-owned by releases
prod-omi-backend-secrets/prod-omi-pusher/prod-omi-backend-listen, verified at 2026-11-10T16:4xZ in the operator handoff.David approved this access change at 2026-11-10T08:53Z (relay-cl1 e68296), as supplied in the operator handoff. This publication performs no production reads or writes. The live-drift statement above is the operator's recorded state, not a fresh production measurement by this lane.
Shard-5 cause and fix
Main run 42786950639, shard 5 failed solely on the CPU duration guard for
tests/unit/test_pusher_storage_pcm_saturation.py::test_50_sockets_plateau_refuse_without_ack_then_retry_once: 1.01 s > 1.00 s, at 2026-11-10T09:25:14Z. All 38 tests passed in that file; its process exited 1 because of the guard. Thegh run view --log-failedoutput on m1 omitted the job tail; the raw job log retrieved withgh api repos/BasedHardware/omi/actions/jobs/129738063716/logsindependently confirms both lines.Recent main measurements for that same node:
9c051da5beded44ab10a8141729fccThese are historical log measurements, re-read on 2026-11-10. The test runs 50 producers against stubbed slow GCS while sampling allocations/RSS; process CPU includes its threads. Adding the chart test changes the deterministic LPT shard deal, but the CPU guard is per process. The observations support a marginal duration-budget failure, unrelated to chart behavior.
The documented mechanism for stress tests is
@pytest.mark.slow(backend/tests/README.md:79–90), so this fix removes the node and its comment from the duration allowlist and adds that marker. Its assertions are unchanged. The PR unit lane excludes it throughnot integration and not slow; a direct pytest run still executes it.The saturation backpressure behavior guardrail is now listed at file granularity in
backend/tests/slow_guardrail_manifest.txt:51; the existing Backend unit guardrails job runs it withslow and not integration, without a 1.0 s CPU fail limit (unset-limit early return); the runner accepts files only (-fat line 30), matching existing runtime behavior guardrails such as sliding-window limits. Local validation viabin/omi-heavy: exact file selection 1 passed, 37 deselected; full guardrail runner 2051 passed, 1435 deselected (350.37 s), at follow-up commitbaaa02b9aa.Review fixes also select both chart test files for monitoring-contract sources, including backend-secrets; render all three charts together to compare the ExternalSecret target, PodMonitoring credential references, and Role resourceNames; and assert that no scrape-token ExternalSecret renders without
METRICS_SECRET. RBAC verbs remainget/list/watch: resourceNames restricts list/watch only with a metadata.name field selector, a plain list is denied, and the live collector requires watch (previously failed with "watch unknown").Review-fix validation on m1
Current head
baaa02b9aa0e292badad58d0578ed51bdd282437: it adds only the guardrail-manifest entry (2 lines inbackend/tests/slow_guardrail_manifest.txt) on top of89bd3dfa0f041f1ea09b12bbc1804310e6159ae6; guardrail selection atbaaa02b: 2051 passed, 1435 deselected locally and in CI. The review-fix validation below ran at89bd3df. All commands use~/workspace/omi-workspace/bin/omi-heavy run --in the existing m1 reland worktree, with Google credential environment variables removed.Direct saturation run:
cd backend && .venv/bin/python -m pytest -q tests/unit/test_pusher_storage_pcm_saturation.py: 38 passed, 9 deprecation warnings, 10.57 s, including the slow-marked stress node.BACKEND_UNIT_TEST_FILE_LIST=<8 chart/selector contract files> bash backend/test.sh: 175 passed across 8 files, no skips or failures. Includes both touched chart tests (12 passed), selector workflow contracts (101 passed), selector output, duration-allowlist selection, Firestore selector contracts, monitoring adapter selection, and CI runner shard-selection tests. The standard 1.0 s CPU guard passed; one unrelated workflow-contract test emitted an advisory 0.11 s warning.PYTHON=.venv/bin/python bash backend/test-preflight.sh: 18 passed, 8 optional warnings, 0 failed. Optional warnings concern integration credentials and unused provider packages.OMI_PR_BODY_FILE=<body> make preflight: 44 checks passed, 70.09 s.The single push passed the normal bounded pre-push gate, including 150 tests passed (saturation fast lane: 37 passed, 1 deselected) and pinned formatting.
Final CI at the current head
CI readback for
baaa02b9aa0e292badad58d0578ed51bdd282437, measured 2026-11-10T18:34Z (re-verified independently by merge-desk): 36 passed, 22 skipped, 0 failed, 0 pending; merge state CLEAN. Per-check results: https://github.com/BasedHardware/omi/pull/25040/checksThe earlier head
89bd3dfhad the same totals at 17:33Z (36 passed, 22 skipped, 0 failed, 0 pending).Prior validation at 9e80314
Repository
BasedHardware/omi, branchlane/reland-24961-m1, original head9e8031431e5c170775c56d789356350e1eb8f1b5, based onorigin/main6fb62a6767394006108398fccf638e868058bbbf.git amwithout conflicts. Removed only the model-named co-author trailer from the commit message; source diff unchanged.bin/omi-heavy:BACKEND_UNIT_TEST_FILE_LIST=<two touched chart tests> bash backend/test.sh: 8 passed, including dev/prod rendering and monitoring-off behavior; Helm installed, no skips.bin/omi-heavy run -- env -u GOOGLE_APPLICATION_CREDENTIALS -u CLOUDSDK_CONFIG -u CLOUDSDK_CORE_ACCOUNT BACKEND_UNIT_FILE_BUDGET_SECONDS=900 bash backend/scripts/run-unit-ci.sh --all --shard 8/5: passed, 345/345 files, using the existing native Opus fixture path documented below.bin/omi-heavy run -- env OMI_PR_BODY_FILE=<body> make preflight: 43 checks passed, 47.48 s. The first invocation stopped for missing draft metadata; the completed run supplied this body.bin/omi-heavyandbackend/test.sh: 38 passed, including the stress node before this review fix added its slow marker.OMI_TEST_OPUS_LIBRARY=/opt/homebrew/lib/libopus.dylibsupplies the installed native codec path to the existing retained-audio fixture. The first shard run failed only that file because native discovery missed it; its corrected focused rerun passed 68 tests. The full shard rerun uses the same native path.scripts/pr-preflight --metadata-only --pr-body-file <body>throughbin/omi-heavy: 5 checks passed, 14.17 s.9e8031431e5c170775c56d789356350e1eb8f1b5.Rollback
Rollback by revert DELETES the scrape-token ExternalSecret and collector Roles/RoleBindings (and the owned Secret copy), which stops pusher/listen GMP scraping. Alternatively, set
podMonitoring.enabled=falseon pusher/listen and upgrade them; this removes their PodMonitoring and collector RBAC while leaving the backend-secrets token copy in place.Product invariants affected
none
Failure-Class: none
🤖 Generated with Claude Code