Repository navigation
feat: add github_runner_tmpfs for in-memory runner mounts - #63
Conversation
Job data lives in the container's writable layer, so busy runners on slow disks write constantly for data that can all be rebuilt. Let hosts with spare RAM keep it in tmpfs. Nothing changes unless the variable is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
The Molecule verify playbook contains a brittle assertion that can trigger a Jinja templating error when HostConfig.Tmpfs or the expected key is absent, indicating an active issue that should be corrected for reliable, diagnosable test failures.
1 open issue
What changed in this PR
This pull request adds optional tmpfs mount support to the github_runner role so rebuildable runner/job data (e.g., /_work, ~/.gradle) can live in memory rather than the container writable layer, reducing disk write pressure on hosts with spare RAM. It also updates documentation, release metadata, and CI coverage via a new Molecule scenario.
Changes:
- Introduce
github_runner_tmpfs(default[]) and pass it into both the check-mode “plan” container task (drain gate) and the deploy container task. - Add a
tmpfs-mountsMolecule scenario and run it in the CI matrix. - Bump collection version to
0.1.8and update the changelog. - Document the new variable and usage notes in defaults and README.
| File | Summary |
|---|---|
roles/github_runner/tasks/main.yml |
Wires github_runner_tmpfs into container plan/deploy tasks; review notes include moderate concern about using omit when the list is empty preventing clearing previously-set tmpfs mounts. |
roles/github_runner/defaults/main.yml |
Adds github_runner_tmpfs default and inline docs; review note requests explicitly warning that tmpfs consumes host RAM/swap. |
README.md |
Documents github_runner_tmpfs; review note requests adding an operational warning about RAM/swap consumption and OOM risk with large size= values. |
molecule/tmpfs-mounts/verify.yml |
Adds verification for tmpfs via container inspect; review note suggests avoiding direct indexing of HostConfig.Tmpfs[...] to prevent templating errors when keys are missing. |
molecule/tmpfs-mounts/molecule.yml |
Defines the new Molecule scenario for tmpfs mounts. |
molecule/tmpfs-mounts/converge.yml |
Converge playbook applying the role for the tmpfs scenario. |
galaxy.yml |
Bumps the collection version to 0.1.8. |
CHANGELOG.md |
Adds the 0.1.8 entry describing tmpfs support and the new scenario. |
.github/workflows/lint-and-test.yml |
Extends the CI matrix to include the tmpfs-mounts Molecule scenario. |
Review effort: Balanced
The docker module leaves existing mounts in place when an entry is removed, whether the variable is omitted or an empty list, so rolling back would have silently kept runners on tmpfs. Compare strictly, and test the rollback. Also make the verifier fail cleanly on a missing mount, and warn that mounts use host RAM and swap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Why
A runner's job data, such as
/_workand~/.gradle, lives in the container's writable layer. On a RAID5 array with no cache, that keeps the disks busy with writes to data that can all be rebuilt. Hosts with spare RAM should be able to keep it in memory.Change
Adds
github_runner_tmpfs(default[]), passed to both the deploy task and the check-mode task behind the drain gate, withcomparisons: {tmpfs: strict}so removing an entry clears the mount. Containers without mounts stay as they are:Also bumps the collection to 0.1.8 and adds a
tmpfs-mountsMolecule scenario to the CI matrix.Things to know when using it
execis required in practice: Docker's tmpfs default isnoexec, which stops jobs runninggradlewor native modules. I confirmed the default refuses to run a script.compscidr/github-runner-androidships files in/root/.android.Testing
molecule test --scenario-name tmpfs-mountspasses locally, with:HostConfig.Tmpfsno-docker-socketalso passes idempotence with no mounts set.No real CI job has run on this yet. I plan to try it on one host through
BumpApp/bumpafter release.🤖 Generated with Claude Code