fix: plumb sandbox disk size and correct CPU/memory unit conversions#475
Merged
Conversation
Runner was ignoring StorageQuota and treating CpuQuota/MemoryQuota as
cgroup microseconds/bytes rather than the cores/GB the API actually
sends. Every sandbox booted with 1 vCPU / 128 MiB / 223 MB regardless
of snapshot config.
- sdks/{c,go}: add boxlite_options_set_disk_size_gb FFI + WithDiskSize
- runner client.go,stubs.go: cores direct, GB->MiB, plumb StorageQuota
- infra: move fs imports into builder fn to unblock SST 4.6.11 deploy
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
CpuQuotaas cgroup µs andMemoryQuotaas bytes; the API actually sends cores / GB. Fixed in both create (client.go) and resize (stubs.go) paths.WithDiskSize(gb int)to the Go SDK plus matching FFI (boxlite_options_set_disk_size_gb); previouslyStorageQuotawas logged-and-dropped, leaving every sandbox on the content-fitted 256 MB ext4 image disk.fs/path/urlimports insidebuildRunnerUserData(dynamic import) so SST 4.6.11 will accept the config and deploys can resume.Test plan
libboxlite.ato ensure the new symbol is exported.go build ./...inapps/runner/after C SDK rebuild.df -hshows ~10 GB at/,nprocmatches snapshotcpu, andfree -mmatchesmem * 1024.disk: 20; confirm new size reflected inside the guest.npx sst deploy --stage devcompletes past the prior yarn/Docker steps and reconciles the runner instance.