-
Notifications
You must be signed in to change notification settings - Fork 35
ci: prune stale earthly buildkit cache on self-hosted host #1665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d429bd0
1f52323
32335a9
d8a7371
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1167,6 +1167,24 @@ jobs: | |
| docker volume ls -q --filter "label=com.docker.compose.project=${proj}" \ | ||
| | xargs -r docker volume rm -f || true | ||
|
|
||
| # Bound the shared earthly-buildkitd cache. It accumulates pulled base | ||
| # images and cache mounts (e.g. nixos/nix for compactc) across all slots | ||
| # on the self-hosted host, and is NOT covered by the local-env teardown | ||
| # above. Left unbounded it creeps toward the 1.7 TB /var ceiling and large | ||
| # link steps die with "No space left on device". buildctl prune is | ||
| # concurrency-safe (it skips records held by in-flight builds), and | ||
| # --keep-duration keeps a day of hot cache so other PRs still hit it. This | ||
| # does not change the daemon's settings hash, so it never restarts the | ||
| # shared buildkitd. The host-side reaper timer (shielded-iac runner role) | ||
| # is the backstop for slots whose job is hard-killed before this runs. | ||
| - name: Prune stale earthly buildkit cache (defensive) | ||
| if: always() | ||
| shell: bash | ||
| run: | | ||
| if docker inspect earthly-buildkitd >/dev/null 2>&1; then | ||
| docker exec earthly-buildkitd buildctl prune --keep-duration=24h || true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On self-hosted runs where Earthly manages Useful? React with 👍 / 👎. |
||
| fi | ||
|
|
||
| - uses: ./.github/actions/tree-cache-guard/save | ||
| if: steps.guard.outputs.hit != 'true' | ||
| with: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.