Skip to content

Pool (M10, Hetzner side): drain unserved repos, ci-kit-config label, ensure only for pool.json repos - #17

Merged
SSFSKIM merged 2 commits into
mainfrom
hetzner-drain-unserved
Oct 16, 2026
Merged

SSFSKIM merged 2 commits into
mainfrom
hetzner-drain-unserved

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 16, 2026

Copy link
Copy Markdown
Owner

The Hetzner half of spec §3a "Moving a repo between backends" (M10).

  • Draining an unserved repo. A repo with containers on the box that the agent no longer serves (removed from pool.json, or found public) is draining: its runners are still listed, so busy ones finish their jobs (or hit the 6 h 15 min deadline) instead of being killed as runner-gone after 5 min; its idle runners are unregistered at once by the unregister-first protocol (kept if GitHub refuses); its jobs are not listed, so nothing starts for it. logic.mjs unservedRepos, reviewContainers({unserved}); reconciler.mjs observe.
  • ci-kit-config=<sha8>. The commit of the config the agent runs: the bake commit (/var/lib/ci-kit/kit-commit) at boot until a fetch from main succeeds, then the newest commit on main that changed pool.json, read at that commit (raw.githubusercontent.com/<sha>/…, so never a stale CDN copy of main). Written through the ownership-checked read-modify-write; a failed fetch keeps the label. lib/github.mjs gains lastCommit (conditional, so the 5-min poll is mostly 304s).
  • Ensure. Reads pool.json and gce.json from the kit's main, falling back to the bundled copies; result=gce for a gce.json repo, none for a repo in neither, both without touching Hetzner (I12). A repo in both reads gce, the order §3a names; the config test refuses that state.
  • docs/pool.md: ensure's results and removing a repo.

Tests: 337/337 (npm test). New: draining keeps a busy job past 5 min and starts nothing for the removed repo; idle runner of a removed repo unregistered first, kept on 422; config label baked → fetched, kept on a failed fetch; backendOf, kitConfig fallbacks. Smoke: GITHUB_REPOSITORY=SSFSKIM/cua node pool-ensure/ensure.mjs → result=none; lastCommit against GitHub → 03f215d, then 304.

After merge: move v1, then re-bake from main with no box up (cpx12 builder) — before the first backend move.

… ones unregister first); agent labels ci-kit-config=<sha8>; ensure wakes Hetzner only for pool.json repos (gce|none otherwise) — spec §3a, M10
…refusing an unreadable copy rather than falling back; hcloud-token needed only for a pool.json repo
@SSFSKIM
SSFSKIM merged commit 5996e39 into main Oct 16, 2026
3 checks passed
SSFSKIM added a commit that referenced this pull request Oct 16, 2026
SSFSKIM added a commit that referenced this pull request Oct 16, 2026
…er frozen as fallback on pre-#17 snapshots; re-bake cancelled (human: use GCE spot)
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