build: support --ulimit, --shm-size and --cgroup-parent #5345
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 189 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.314
Real PR Conversation Timeline
1 comments
"Review active on #5345"
general
weight: 0.35
AkihiroSuda
First half of #5344: adds
--ulimit,--shm-sizeand--cgroup-parenttonerdctl buildand passes them to BuildKit as frontend attributes. The memory/cpu flags need BuildKit v0.31 and capability checks, so I left them for a follow-up.A few things worth knowing:
--ulimitis a StringSlice likenerdctl run --ulimit. Each value is validated withunits.ParseUlimitand they're sent as one comma-separatedulimitattr, which is what BuildKit parses.--shm-sizetakes the usual64mstyle and gets converted to bytes, since BuildKit'sshm-sizeattr is a plain integer.--cgroup-parent: with the systemd cgroup manager,build.slicebecomesbuild.slice:buildkit:, the form BuildKit treats as a slice. It uses the same "xxx.slice" check asnerdctl run. A value that's already in BuildKit's form (contains.slice, ends with:) passes through, and with cgroupfs it's passed as is. This goes by nerdctl's--cgroup-manager, since there's no easy way to ask buildkitd which driver it uses. Open to doing that differently.--cgroup-parenthas no effect there (moby/buildkit#7287). I documented that rather than warning. Ulimits and /dev/shm still apply in rootless.Tests: unit tests for the arg conversion and the cgroup parent handling, and an integration test that checks
ulimit -nand the /dev/shm size from inside RUN. I only ran the unit tests locally, the integration test needs buildkitd so I'm relying on CI for that one.