feat(runner): runs-on from CI_RUNS_ON in every job, runner setup that survives restarts - #14
Merged
Merged
Conversation
… setup survives restarts
ci.yml and pr-auto-merge.yml had ubuntu-latest hardcoded and ignored the
config's runner. {{RUNNER}} now renders to a fromJSON(vars.CI_RUNS_ON ...)
expression that falls back to ubuntu-latest, so a repo moves to a
self-hosted pool with one gh variable set and back with one delete.
setup-self-hosted-runner.sh kept the registration inside the container with a
one-hour token, so the runner looped on 'already configured' after its first
restart. Registration now lives in a host volume, with limits and a pinned
image.
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.
Two problems found while moving the segsmartdev repos to a self-hosted pool after the GitHub Actions minutes ran out.
1. The config's runner was ignored by CI.
ci.yml.templateandpr-auto-merge.yml.templatehadruns-on: ubuntu-latesthardcoded; only the review, mention and triage workflows used{{RUNNER}}. A repo set to self-hosted still burned hosted minutes on lint, types and tests.Now
{{RUNNER}}renders to${{ fromJSON(vars.CI_RUNS_ON || '"ubuntu-latest"') }}and every job in those two templates uses it. The runner is picked per repo at run time:gh variable set CI_RUNS_ON --body '["self-hosted","linux","vps"]'moves the repo,gh variable delete CI_RUNS_ONis the kill switch. Deploy templates stay onubuntu-lateston purpose (docker-ghcr needs a Docker design of its own).Proven on segsmartdev/proteauto-admin (PR 81): with the variable, the 4 CI jobs and the 3 review jobs ran green on node01 runners; after deleting it and re-running, the same jobs were routed to
ubuntu-latest(and blocked by billing, which is the routing proof); after setting it again, green on node01.2. setup-self-hosted-runner.sh built runners that die on the first restart. It passed a one-hour registration token and kept the registration in the container's writable layer. Two runners created with it (node02) are in a restart loop with "Cannot configure the runner because it is already configured". The script now stores the registration in a host volume (
CONFIGURED_ACTIONS_RUNNER_FILES_DIR), disables deregistration on stop, pins the image, sets CPU, memory and PID limits, and sends the token over stdin. Verified: a container restarted with the same settings reconnected without a new token.Rendering checked locally: substituting the templates yields the expression in all 12
runs-onlines of ci, pr-auto-merge, pr-auto-review, claude-mention and issue-triage.