Repository navigation
ci: give pushes to main self-hosted runners of their own - #1906
Conversation
run.sh --reserved N registers the first N of its --count slots with --reserved-labels (default self-hosted-ovis-main) instead of --labels. They stay in the launcher's network namespace, so they share check.ts's slots with the other runners: the reserve takes runners, not load. A --reserved that is not a whole number up to --count (or is long enough to wrap in shell arithmetic) is refused before anything starts.
A push to main takes the repository variable CI_MAIN_SELF_HOSTED_LABELS over CI_SELF_HOSTED_LABELS when it is set, so main's Linux jobs can run on runners pull requests never take (run.sh --reserved) instead of queueing behind their runs. "ubuntu-24.04" there keeps only main hosted; deleting it puts main back on the shared runners. CI_SELF_HOSTED_LABELS set to "ubuntu-24.04" still keeps every job hosted, and no other event reads it.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Reserved runner slots scripts/self-hosted-runner/run.sh, scripts/self-hosted-runner.test.ts, scripts/self-hosted-runner/README.md |
The launcher supports reserved slots with configurable labels and validates the reserved count. Tests cover label assignment and invalid counts. Documentation describes the reserved-slot configuration and updates the P620 runner configuration. |
Main-push CI routing scripts/ci-runner-route.sh, .github/workflows/ci.yml, scripts/ci-runner-route.test.ts, docs/development.md, changelog.d/ci-main-runners.md |
The workflow passes the Git ref and CI_MAIN_SELF_HOSTED_LABELS to the routing script. For pushes to main, the script uses the main-specific setting when nonempty; tests cover overrides, fallback, other events, and invalid values. Documentation describes the setting and its effects. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Possibly related PRs
- devswha/ovis#1743: Established the existing runner-label routing contract that this change extends for main pushes.
Merge Risk: 
Minimal · up to 351af
-
No actionable merge-blocking issue remains; the change is ready for normal checks and merge.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description clearly explains the change, motivation, rollout, limitations, and validation results. It does not use the required "## Change" and "## Validation" headings and does not link an issue where a maintainer approved this feature, but the required information is otherwise present.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (4 skipped: 4 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Merge pass review-work report. Overall: PASSED. CodeRabbit did not review this workflow PR (rate-limited); the gate review below stands in for it.
QA
Gate
All required checks are green and no review thread is open. |
|
Merge pass: merged as 5761411. For the ci-main-priority lane: main pushes now read |
What this does
Gives pushes to main self-hosted runners of their own, so a merge's CI stops queueing behind pull request runs on the P620.
scripts/self-hosted-runner/run.sh --reserved Nregisters the first N of its--countslots with--reserved-labels(defaultself-hosted-ovis-main) instead of--labels. It is still one launcher with one network namespace, so the reserved slots sharecheck.ts's slots (CHECK_HOST_MAX_RUNS) with the others. The reserve takes runners away from PRs, not extra load. A--reservedthat is not a whole number up to--countis refused before anything starts, and that includes a number long enough to wrap around in shell arithmetic.scripts/ci-runner-route.sh(Detect changes inci.yml): for a push ofrefs/heads/main, the repository variableCI_MAIN_SELF_HOSTED_LABELStakes precedence overCI_SELF_HOSTED_LABELSwhen it is set.["self-hosted","self-hosted-ovis-main"]sends main to the reserved slots."ubuntu-24.04"keeps only main GitHub-hosted.workflow_callfromrelease.yml/pages.yml, and pushes of other refs.CI_SELF_HOSTED_LABELS='"ubuntu-24.04"'still keeps every job hosted.docs/development.mdand a changelog fragment document the flip. A job waits for a runner with every label it asks for, and the maintainer PC's fallback unit has no reserved slots. So when the P620 goes offline, alsogh variable delete CI_MAIN_SELF_HOSTED_LABELS, or main's Linux jobs wait.Why
The merge pass checks main's CI after each merge batch. Main's run waited behind about 10 PR runs for the same P620 runners, so merges crawled.
Before this change (12 P620 runners, 5 slots), main push runs took 13.8 to 88 minutes from creation to completion: 13.8, 17.3, 18.4, 19.3, 22.1, 35.8, 43.6 and 88 minutes. Main's Linux jobs waited 2-649 s for a runner. On top of that, the integration and browser jobs waited 6-242 s for a
check.tsslot.At 01:00 KST, run 40106555178 had been queued for 45 minutes. It waited 19 minutes behind the previous main run in the concurrency group, and its three heavy jobs then sat queued for runners while the P620 was cut from 12 to 8 runners.
Runner side and rollout
From 00:56 to 01:58 KST the P620 ran
--count 8 --reserved 2, which is how the dispatch run below was checked. But until this PR merges, main'sci.ymlstill asks forself-hosted-ovis, so the idle reserved pair took capacity from main as well as from PRs and main's CI stalled. The P620 is back to--count 8 --reserved 0(eight shared runners), andCI_MAIN_SELF_HOSTED_LABELSis deleted, so merging this changes no routing by itself.After the merge, the variable is set to
["self-hosted","self-hosted-ovis-main"]and the P620 restarts with--reserved 2in one step. The next push to main is then checked to start its Linux jobs on P620-1/P620-2.Not covered
Main's herdr-backed jobs still share the P620's 3
check.tsslots with PR jobs, so they can wait there for one. Giving a main run priority in slot admission would be acheck.tschange and is left as a follow-up.Two runners for main's four Linux jobs means Fast checks and one slot job start first, and the other two follow.
Verification
bun test scripts/ci-runner-route.test.ts scripts/self-hosted-runner.test.ts: 32 pass. The 6 new cases each fail under their mutation:--labels;--reserved≤--countcheck;bun run check fastpasses: typecheck, build and 6416 unit tests, report verified on 351af69.--reserved 2(00:56-01:58 KST): the runners API listed 8 online P620 runners, 2self-hosted-ovis-mainand 6self-hosted-ovis, and no PR job started on the reserved pair.self_hosted_labels=["self-hosted","self-hosted-ovis-main"]: run 40109536147 passed. All four Linux jobs ran on the reserved runners and none on the six PR runners: both Browser jobs started on P620-1 and P620-2 within 2 s, and Fast checks and Integration waited 344 s and 491 s for one of those two to free up instead of taking a PR runner.Review
This changes
runs-onrouting in a workflow and the self-hosted runner launcher, so it needs a real review before merging.["self-hosted"]inCI_SELF_HOSTED_LABELSwould let PRs onto reserved slots, the "P620 runs eight" wording was stale, and the docs now say which host has reserved slots.self_hosted_labelsis a write-access-only override for one run, and it is how this PR was checked on the reserved runners. The README now says so.CI_SELF_HOSTED_LABELS='"ubuntu-24.04"'. Pre-existing and intended:ci-runner-route.test.tsrequires it. Unchanged.--reservedwrapped to 0. Fixed, and the test covers it.