Repository navigation
Regenerate from API and add build memory and volume to sandbox image push - #26
Merged
Merged
Conversation
Carries build_memory and build_volume on the image push request, and upload_headers on its response, from the server's spec change, and regenerates the client. The spec is patched rather than downloaded, since the live spec does not have the change yet.
ImageClient.push and AsyncImageClient.push take build_memory and build_volume, in megabytes, for every source, and send them only when set, so a build_volume of 0 is sent. The build context upload sends the upload_headers a push returns, which its upload URL is signed for, and nothing more when there are none.
|
|
There was a problem hiding this comment.
🟢 Approval recommended
The specification, generated models, client paths, and tests are consistent with no blocking defects found.
0 open findings
What changed in this PR
Adds configurable build memory and scratch volume for sandbox image pushes across all supported sources.
Changes:
- Extends API schemas and generated models with build sizing and upload headers.
- Forwards sizing options in synchronous and asynchronous clients.
- Applies signed headers during archive upload and adds test coverage.
| File | Description |
|---|---|
baseten/sandbox/_images.py |
Implements sizing options and signed upload headers. |
baseten/client/managementapi/_models.py |
Adds generated request and response fields. |
scripts/apigen/specs/management.json |
Updates the management API specification. |
tests/sandbox/test_images.py |
Tests sync and async push behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Follows the server's rename: the push endpoint only builds, so no build prefix, and the unit is in the name.
Matches the unitless memory field, in megabytes, that the other sandbox options and API schemas use. images.push's memory_mb and volume_mb become memory and volume, sent as memory and volume. Values stay integers in MB.
cretz
approved these changes
Oct 15, 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.
🚀 What
ImageClient.push()andAsyncImageClient.push()takememoryandvolume, in MB, named likememoryon sandbox create, to size the temporary environment that builds or imports an image. This is for large images that run out of memory or disk while building. It works for every push source: builder, directory, files, zip and registry image.💻 How
adds the API's new fields to the vendoredRegenerate full specmanagement.json:memoryandvolumeon the push request, andupload_headerson the response. Then regenerates withpoe generate-api, so a later spec refresh produces no diff here.None, andvolume=0is sent; it builds in memory.upload_headers, so the PUT sends them as given. Without sizes nothing changes.🔬 Testing
volume=0is sent and the upload adds nothing extra;poe lint,poe typecheckandpoe testpass (428 passed; the e2e tests are skipped without credentials). Regenerating produces no diff.The generated models enforce the spec's ranges, so an out-of-range value raises a
ValidationErrorbefore any request, as sandboxmemoryalready does.Merge after the API change is in production.