Add configurable /tmp tmpfs size with ByteSize type#46
Merged
Conversation
f6bf39a to
0f2e062
Compare
Wire propolis WithTmpSize through all layers so users can configure the guest /tmp tmpfs size. Introduces a ByteSize type in the config domain that accepts "512m", "2g", or bare integers (MiB) in YAML. - New ByteSize type with encoding.TextUnmarshaler for yaml.v3 - DefaultsConfig and AgentOverride use ByteSize for tmp_size - bbox-init reads vmconfig and passes TmpSize to guest boot - VMConfig, RunOpts, and PropolisRunner pass TmpSizeMiB through Depends on stacklok/go-microvm#44 (go.mod replace is temporary). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
0f2e062 to
eb47c67
Compare
Also pin gvisor.dev/gvisor to the version propolis v0.0.21 actually requires, fixing a broken templated assembly file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jhrozek
reviewed
Mar 16, 2026
Contributor
jhrozek
left a comment
There was a problem hiding this comment.
Nice, clean feature addition — follows the existing CPUs/Memory patterns well and respects DDD boundaries. A few questions and a small correctness nit below.
- Fix uint64 overflow in ByteSize GiB parsing (silent wraparound) - Make workspace-local TmpSize tighten-only (cannot inflate beyond global) - Add explicit vmconfig fallback in bbox-init for future-proofing - Add --tmp-size CLI flag (parity with --cpus and --memory) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jhrozek
approved these changes
Mar 16, 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
WithTmpSizethrough all brood-box layers so users can configure guest/tmptmpfs sizeByteSizetype in config domain that accepts human-readable sizes ("512m","2g") and bare integers (MiB) in YAML/etc/propolis-vm.jsonwritten by the host to apply the configured size at bootConfig example
Bare integers remain backward compatible (
tmp_size: 512= 512 MiB).Changes
pkg/domain/config/bytesize.go:ByteSizetype withParseByteSize,encoding.TextUnmarshaler/TextMarshaler(no yaml.v3 import in domain layer)pkg/domain/config/config.go:DefaultsConfig.TmpSizeandAgentOverride.TmpSize→ByteSize; split clamping;Merge()converts touint32at agent boundarypkg/domain/agent/agent.go:DefaultTmpSize uint32fieldpkg/domain/vm/vm.go:TmpSizeMiB uint32inVMConfigpkg/sandbox/sandbox.go: WiresTmpSizeMiBthroughRunOpts→ override →VMConfiginternal/infra/vm/runner.go: PassesTmpSizeMiBtopropolis.WithTmpSizecmd/bbox-init/main.go: Reads vmconfig, passes toboot.WithTmpSizeDependencies
go.modhas a temporaryreplacedirective until a propolis release is cutTest plan
task testpassesreplacedirective after propolis release and verify🤖 Generated with Claude Code