Add support for sharing=private cache mounts #7127
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 375 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.355
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7127"
general
weight: 0.35
ajoshua2004
<!--
Thanks for sending a pull request!
Please make sure you've read and understood our contributing guidelines
(https://github.com/containers/buildah/blob/main/CONTRIBUTING.md) as well as ensuring
that all your commits are signed with
git commit -s.-->
What type of PR is this?
/kind feature
What this PR does / why we need it:
We reject
sharing=privateon cache mounts, so building Containerfiles fails on an option BuildKit has supported for a long time:A cache can now have more than one directory. A
sharing=privatemount takes one that nothing else is holding, creates another only when they are all busy, and keeps it locked until the command it is mounted for finishes. Directories are reused once they are free, so the count settles at how many commands use that cache at the same time.sharing=sharedandsharing=lockedare unchanged.How to verify it
Unit, integration, and conformance tests are added:
Also manually, start one of these and then run a second while it sleeps. The second one will get its own private directory named
[hash]-1:Which issue(s) this PR fixes:
<!--
Automatically closes linked issue when PR is merged.
Uncomment the following comment block and include the issue
number or None on one line.
Usage:
Fixes #<issue number>, orFixes (paste link of issue), orNone.-->
Fixes https://github.com/podman-container-tools/podman/issues/27188
Part of https://github.com/podman-container-tools/buildah/issues/6732
<!--
Fixes #
or
None
-->
Special notes for your reviewer:
Noting one pre-existing difference from BuildKit, since it carries over to
sharing=privateas well:sharing=sharedtakes no lock in buildah, so a shared mount can use the same directory as asharing=lockedcommand running at the same time. BuildKit'slockedwaits forsharedusages as well.Aligning with BuildKit would mean
sharedtaking a read lock, which changes the default sharing mode for cache mounts and might be risky. That seemed better as its own PR if we want to address it.Does this PR introduce a user-facing change?
``
release-note
``Cache mounts now accept sharing=private, which gives the command a cache directory that nothing else is using