Skip to content

fix: plumb sandbox disk size and correct CPU/memory unit conversions#475

Merged
DorianZheng merged 1 commit into
mainfrom
fix/runner-resource-sizing
May 5, 2026
Merged

fix: plumb sandbox disk size and correct CPU/memory unit conversions#475
DorianZheng merged 1 commit into
mainfrom
fix/runner-resource-sizing

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

  • Runner was treating CpuQuota as cgroup µs and MemoryQuota as bytes; the API actually sends cores / GB. Fixed in both create (client.go) and resize (stubs.go) paths.
  • Added WithDiskSize(gb int) to the Go SDK plus matching FFI (boxlite_options_set_disk_size_gb); previously StorageQuota was logged-and-dropped, leaving every sandbox on the content-fitted 256 MB ext4 image disk.
  • Moved fs / path / url imports inside buildRunnerUserData (dynamic import) so SST 4.6.11 will accept the config and deploys can resume.

Test plan

  • Rebuild C SDK / libboxlite.a to ensure the new symbol is exported.
  • go build ./... in apps/runner/ after C SDK rebuild.
  • Create a sandbox; confirm df -h shows ~10 GB at /, nproc matches snapshot cpu, and free -m matches mem * 1024.
  • Resize a stopped sandbox with disk: 20; confirm new size reflected inside the guest.
  • npx sst deploy --stage dev completes past the prior yarn/Docker steps and reconciles the runner instance.

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
@DorianZheng DorianZheng merged commit 6f6e27b into main May 5, 2026
29 checks passed
@DorianZheng DorianZheng deleted the fix/runner-resource-sizing branch May 5, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant