Skip to content

perf(batch): enable production worker autoscaling - #23891

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/accel3g-prod-values-1028
Oct 30, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/accel3g-prod-values-1028

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Change

Enable the existing production OD-first demand scaler in the batch-pipeline-worker chart values. The already-merged #23860 sets the worker budget to min 3 / max 16; balanced pools remain disabled.

With autoscaling enabled, the chart keeps spec.replicas in the Deployment manifest and uses Helm lookup to carry forward the live count on upgrades. The first HPA install therefore keeps the existing count instead of allowing the API to default it to 1; later chart upgrades also preserve the HPA's current scale. Fresh installs and offline renders use replicaCount.

25% soak sequence

  • This PR does not gate paired-25 entry.
  • Lead merges this PR only after the paired-25 entry and its packet are consumed.
  • After the merge, op1 deploys the pinned image digest cfb0ef through .github/workflows/gcp_diarizer.yml with service=batch-pipeline-worker and env=prod; no rebuild.
  • op1 raises batch-pipeline-pool node-pool max to 16 and leaves min at 3.
  • Use the 25% soak as the live HPA scale-up qualification. Confirm the HPA reacts before moving to 100%.

Existing STOP and rollback guards remain authoritative.

Local validation

  • backend/test.sh with BACKEND_UNIT_TEST_FILE_LIST=backend/tests/unit/test_batch_pipeline_chart.py: 39 passed.
  • make preflight on the 58a123e tree (merge base ebd6553): 35 checks passed.

View guided diff Turn on auto-fix

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T13:07:01.786232Z 58a123e 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.

Git-on-my-level added a commit that referenced this pull request Oct 29, 2026
…Prometheus (#24079)

## Why

The prometheus-adapter (`prod-omi-prometheus-adapter`) reads the
in-cluster
Prometheus (`prod-omi-kube-prometheus-stack`), not GMP. The external
rules
behind the batch worker HPA (#23891) —
`omi_batch_pipeline_admissible_ready_units`
and `omi_batch_pipeline_ready_age_seconds`, already present in
`prod_omi_prometheus_adapter.yaml` — match zero series today because no
scrape
job selects the `batch-pipeline-worker` pods into that Prometheus; they
only
feed GMP. Until this lands, the worker HPA cannot scale batch to 100%:
the
external metrics API returns no values.

## What

Adds a `batch-pipeline-worker-metrics` job to `additionalScrapeConfigs`,
mirroring the `diarizer-batch-metrics` precedent from #21448 (the
2026-10-14
diarizer-batch cutover):

- `scrape_interval: 15s`, `role: pod`, `namespaces: [prod-omi-backend]`
- keeps on the `app.kubernetes.io/name: batch-pipeline-worker` label
(selects
  every chart release, not one instance name), the `http` container port
(8080 — the same port the chart's GMP PodMonitoring scrapes), and
`Running`
  phase
- relabels exactly `namespace` + `pod`: the adapter's freshness joins
run
`on (namespace, worker_release, pod)`, so the scrape must attach those
two;
`priority` and `worker_release` ride the metric samples themselves and
are
  left untouched (no `metric_relabel_configs`)

Declares the job in `expected-targets.prod.yaml` (mechanism
`additionalScrapeConfigs`, `auth: null` — the worker's `/metrics`
handler is
unauthenticated, namespace `prod-omi-backend`, `coverage_status:
declared`
with no coverage alert, same class as `diarizer-batch-metrics`) and pins
the
whole shape in `test_batch_pipeline_chart.py` next to the worker's other
scrape contracts. The telemetry contract test enforces values↔inventory
bidirectionally, so both sides land together.

## Series this enables (at today's 3 replicas)

| family | labels | series |
| --- | --- | --- |
| `omi_batch_pipeline_admissible_ready_units` | priority,
worker_release, namespace | 9 (3 pods × 3 priorities) |
| `omi_batch_pipeline_capacity_refreshed_at_seconds` | worker_release,
namespace | 3 |
| `omi_batch_pipeline_ready_age_seconds` | priority, worker_release,
namespace | 9 |
| `omi_batch_pipeline_metrics_refreshed_at_seconds` | worker_release,
namespace | 3 |

## Risk

- **Cardinality:** the four adapter-consumed families add 24 series at 3
  pods. The job scrapes the worker's full `/metrics` exposition (as the
diarizer job does for its pods), bounded by the runtime's registry — an
O(100) series addition against the 2.25M-series head, ingested locally
by
  both Prometheus replicas, no Cloud Monitoring reads. Negligible.
- **No behavioral change until applied:** this only edits repo values.
The
rollout lead applies the stack with the pinned-chart runbook (helm
upgrade
`prod-omi-kube-prometheus-stack`, chart 75.15.1, per the monitoring
README)
in the same window as the prometheus-adapter apply that carries the HPA
rules. No `.github/` changes, no flag flip, no IAM change, no data
mutation.
- **Target growth is bounded:** targets exist only while worker pods run
  (today 3; #23891's maxReplicas 16 bounds the ceiling).

## Test plan

- Local backend unit shard (BACKEND_UNIT_TEST_FILE_LIST) green: 86
passed
  across `test_batch_pipeline_chart.py` (new pin),
  `test_monitoring_telemetry_contract.py` (inventory bidirectional +
  declared-gap rules), `test_diarizer_batch_prereqs.py` (neighbor job
  unaffected).
- CI backend unit shard covers the same three files.

Failure-Class: none


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/24079?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/24079?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24079&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. -->
MichaelC001 pushed a commit to MichaelC001/omi that referenced this pull request Oct 30, 2026
…Prometheus

The prometheus-adapter reads the in-cluster Prometheus, not GMP, so the
omi_batch_pipeline_* external rules behind the worker HPA (BasedHardware#23891) matched
zero series: nothing scraped the batch-pipeline-worker pods into that
Prometheus. Add a batch-pipeline-worker-metrics additionalScrapeConfigs job
mirroring diarizer-batch-metrics (BasedHardware#21448): 15s, role pod, prod-omi-backend,
keep on the app.kubernetes.io/name label, the http port and Running phase,
relabel exactly namespace+pod so the adapter's per-pod freshness join
(namespace, worker_release, pod) resolves; priority and worker_release ride
the metric samples. Declare the job in expected-targets.prod.yaml as a
declared batch target with no coverage alert, and pin the whole contract in
test_batch_pipeline_chart.py alongside the worker's other scrape checks.
@Git-on-my-level
Git-on-my-level merged commit dad098c into main Oct 30, 2026
60 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/accel3g-prod-values-1028 branch October 30, 2026 05:10
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