Repository navigation
✨ Add runner image with gpsgate CI tools baked in - #1
Merged
Merged
Conversation
Jobs on self-hosted runners download Python, .NET, pre-commit hooks, csharpier and semgrep each time. Baking them in an immutable image makes jobs fast without writable host caches open to poisoning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Accept full Python versions in the semgrep step, check the image store path, run setup.sh with bash, check dependencies early, keep latest for main on the latest base and the Dockerfile description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The script runs as root at build time, so a silent upstream change should not slip into the image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A manual run from a branch named latest can overwrite the production runner image with a non-main build because branch tags are not isolated from reserved tags.
1 open issue
What changed in this PR
Adds a warmed-up self-hosted runner image to reduce repeated tool downloads in gpsgate CI without changing consuming workflows.
Changes:
- Preinstalls Python, .NET, pre-commit hooks, csharpier, and analysis tools.
- Adds image build, publishing, and weekly refresh automation.
- Documents usage and an untested read-only MegaLinter image-store option.
| File | Description |
|---|---|
README.md |
Documents tools, builds, runner usage, and cache isolation. |
precommit/README.md |
Explains hook configuration synchronization and overrides. |
precommit/.pre-commit-config.yaml |
Defines pinned hooks for warming environments. |
Dockerfile |
Assembles the runner image and baked tool caches. |
bin/python.sh |
Installs Python into the runner tool cache. |
bin/pre-commit.sh |
Installs pre-commit, hook environments, and csharpier. |
bin/dotnet.sh |
Installs the .NET SDK for runner workflows. |
.github/workflows/image.yml |
Builds, tags, publishes, and refreshes the image. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

Jobs on our self-hosted runners download Python, .NET, pre-commit hooks, csharpier and semgrep each time.
This adds an image built on
ghcr.io/efrecon/runner-krunvm-ubuntuwith these baked in,where gpsgate's workflows already look for them, so the workflows stay unchanged.
Mounting writable host caches would also be fast, but PR jobs could poison them for later jobs.
What is in the image
/opt/hostedtoolcache, found bysetup-python/usr/share/dotnet, found bysetup-dotnet~/.cache/pre-commit~/.dotnet/pre-commit/csharpier/1.2.5~/.venvs/semgrepbin/.precommit/holds a skeleton of gpsgate's.pre-commit-config.yaml, only what keys the hook environments.--build-context precommit=<gpsgate checkout>overrides it./usr/lib/containers/storageis enabled instead,to mount a store pre-pulled on the host. That part is untested.
latestandsha-*to GHCR frommain, and rebuilds weekly without cache.Testing
shellcheck -s shclean.--network none, gpsgate's full config passes all hooks on a sample of gpsgate files, without downloads.The csharpier hook uses the baked binary even with
PRE_COMMIT_HOOK_CSHARPIER_INSTALL: always.🤖 Generated with Claude Code