scale builder tmpfs with VM memory instead of fixed 3G#207
Draft
sjmiller609 wants to merge 1 commit intomainfrom
Draft
scale builder tmpfs with VM memory instead of fixed 3G#207sjmiller609 wants to merge 1 commit intomainfrom
sjmiller609 wants to merge 1 commit intomainfrom
Conversation
The /var/lib/buildkit tmpfs that BuildKit's overlayfs snapshotter writes into was hardcoded at 3GB. That's enough for small alpine-based images but too tight for any build whose base image extracts to >3GB on its own — e.g. GPU-driver bases like onkernel/chromium-headful-vgpu, where the FROM extraction alone leaves no room for a single apt install. Size the tmpfs at 75% of the builder VM's MemTotal so callers who request more memory_mb actually get more snapshot headroom. Keeps the 3G fallback for tiny builders or unreadable /proc/meminfo. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
The builder agent mounts a tmpfs at
/var/lib/buildkitfor BuildKit's overlay snapshotter, hardcoded tosize=3G. That's tight: any base image plus install layer that exceeds ~3GB extracted hitsno space left on devicemid-build, even when the VM was provisioned with 16GB+ of RAM.This change scales the tmpfs to 75% of VM memory (read from
/proc/meminfo) with a 1GiB floor and a 3G fallback, so callers who pay for a larger builder VM actually get the disk budget they expect.Test plan
go vet ./...andgo build ./...inlib/builds/builder_agent(already passing locally)