post-step: keep committing the sticky disk when buildkitd is already gone; disable in-use pruning - #130
Open
piob-io wants to merge 1 commit into
Open
Conversation
…gone; disable in-use pruning Write pruneInUse = false into buildkitd.toml so a customer-run `prune --all --keep-storage` uses upstream leaf-first semantics and can no longer remove a parent layer out from under its children (which leaves DiskUsage with a dangling parent and crashes the daemon). Make shutdownBuildkitd report whether a daemon was actually running: `pkill` exiting 1 means buildkitd already exited, which is not a cleanup failure. The post-step logs the buildkitd tail and continues with sync/unmount and the sticky disk commit; only sync/unmount/flush failures still skip the commit. Drop the stale max-cache-size-mb docs and the unused pruneBuildkitCache helper from the v2 branch; v2 relies on buildkitd GC instead. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
piob-io
marked this pull request as ready for review
September 2, 2026 18:54
bruce-y
approved these changes
Sep 2, 2026
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.
Summary
Follow-up to useblacksmith/buildkit#34 for the v2 action. Fixes the failure mode where a job builds and pushes fine but the post-step skips the sticky-disk commit ("Skipping sticky disk commit due to cleanup error"), leaving the cache frozen on the previous snapshot.
Chain being broken: user runs
buildx prune --all --keep-storage Nin-job → forked buildkitd prunes a parent layer whose children survive → the post-step's diagnosticbuildctl dunil-derefs inDiskUsageand buildkitd dies →pkill -TERM buildkitdexits 1 →cleanupErrorset → commit skipped.buildkitd.toml (
writeBuildkitdTomlFile): addpruneInUse = falseunder[worker.oci]. With buildkit#34 this selects upstream leaf-first prune semantics for v2, so a size-bounded prune can no longer remove a still-referenced parent. buildkitd builds that don't know the key ignore it. v1 (main) is untouched and keeps the current in-use pruning via the daemon default.Commit gating (
shutdownBuildkitd,maybeShutdownBuildkitd):buildctl duwas already diagnostic-only (logBuildCacheContentscatches). Onlysync/ unmount / post-unmount flush failures setcleanupErrornow, i.e. the commit is gated on filesystem safety, not on whether the daemon happened to still be alive.Cleanup: remove the dead
pruneBuildkitCachehelper (+ its tests) and the stalemax-cache-size-mbinput docs — v2'saction.ymlhas no such input; README now points users at buildkitd GC instead of in-job prune.Tests:
shutdown.test.ts(graceful → true, already-gone → false without throwing, other pkill errors rethrown);writeBuildkitdTomlFileassertspruneInUse = false+ GC in the generated TOML.dist/rebuilt.Link to Devin session: https://app.devin.ai/sessions/5c8deaae10f14cf49877e6f03ff873f9
Open in Devin Desktop: https://app.devin.ai/desktop/session/5c8deaae10f14cf49877e6f03ff873f9?variant=devin
Requested by: @piob-io
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled. (Staging)