Skip to content

feat: add github_runner_tmpfs for in-memory runner mounts - #63

Merged
compscidr merged 2 commits into
mainfrom
feat/tmpfs-mounts
Nov 4, 2026
Merged

compscidr merged 2 commits into
mainfrom
feat/tmpfs-mounts

Conversation

@compscidr

@compscidr compscidr commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Why

A runner's job data, such as /_work and ~/.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, with comparisons: {tmpfs: strict} so removing an entry clears the mount. Containers without mounts stay as they are:

github_runner_tmpfs:
  - /_work:rw,exec,size=10g

Also bumps the collection to 0.1.8 and adds a tmpfs-mounts Molecule scenario to the CI matrix.

Things to know when using it

  • exec is required in practice: Docker's tmpfs default is noexec, which stops jobs running gradlew or native modules. I confirmed the default refuses to run a script.
  • Contents don't persist: they're lost whenever the container stops or is replaced.
  • Hidden paths: a mount hides anything the image has at that path. For example, compscidr/github-runner-android ships files in /root/.android.
  • Socket jobs: containers started through the Docker socket can't see a runner's tmpfs. That's no worse than today, because they already can't see its writable layer.

Testing

molecule test --scenario-name tmpfs-mounts passes locally, with:

  • The mounts present in HostConfig.Tmpfs
  • A clean idempotence run, so the drain gate doesn't see a change on every deploy
  • Removing the mounts clears them from the container

no-docker-socket also 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/bump after release.

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings November 4, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-mounts Molecule scenario and run it in the CI matrix.
  • Bump collection version to 0.1.8 and 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

Comment thread molecule/tmpfs-mounts/verify.yml Resolved
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>
@compscidr
compscidr merged commit 6cb8f11 into main Nov 4, 2026
8 checks passed
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.

2 participants