Skip to content

Commit 271f4c8

Browse files
feat: wire up memory_mb and cpus in builds API
1 parent 40bbd48 commit 271f4c8

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 37
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-d5ce7bbc5163c13d0ef49a4edc04d3186e7ba7d040726c149a218000faf3c1ce.yml
3-
openapi_spec_hash: cb4fac9f74fdd0a33d554e6630f8547b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-57c5cb3d3dc57a03333475dc1817875a36eead6be9439c0203d1832c32b068d5.yml
3+
openapi_spec_hash: 14f7b09e6e010020f42981dddeb0b415
44
config_hash: d452c139da1e46a44a68b91e8a40de72

build.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ type BuildNewParams struct {
246246
BaseImageDigest param.Opt[string] `json:"base_image_digest,omitzero"`
247247
// Tenant-specific cache key prefix
248248
CacheScope param.Opt[string] `json:"cache_scope,omitzero"`
249+
// Number of vCPUs for builder VM (default 2)
250+
CPUs param.Opt[int64] `json:"cpus,omitzero"`
249251
// Dockerfile content. Required if not included in the source tarball.
250252
Dockerfile param.Opt[string] `json:"dockerfile,omitzero"`
251253
// Global cache identifier (e.g., "node", "python", "ubuntu", "browser"). When
@@ -258,6 +260,8 @@ type BuildNewParams struct {
258260
// Set to "true" to grant push access to global cache (operator-only). Admin builds
259261
// can populate the shared global cache that all tenant builds read from.
260262
IsAdminBuild param.Opt[string] `json:"is_admin_build,omitzero"`
263+
// Memory limit for builder VM in MB (default 2048)
264+
MemoryMB param.Opt[int64] `json:"memory_mb,omitzero"`
261265
// JSON array of secret references to inject during build. Each object has "id"
262266
// (required) for use with --mount=type=secret,id=... Example: [{"id":
263267
// "npm_token"}, {"id": "github_token"}]

build_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ func TestBuildNewWithOptionalParams(t *testing.T) {
3232
Source: io.Reader(bytes.NewBuffer([]byte("some file contents"))),
3333
BaseImageDigest: hypeman.String("base_image_digest"),
3434
CacheScope: hypeman.String("cache_scope"),
35+
CPUs: hypeman.Int(0),
3536
Dockerfile: hypeman.String("dockerfile"),
3637
GlobalCacheKey: hypeman.String("global_cache_key"),
3738
ImageName: hypeman.String("image_name"),
3839
IsAdminBuild: hypeman.String("is_admin_build"),
40+
MemoryMB: hypeman.Int(0),
3941
Secrets: hypeman.String("secrets"),
4042
TimeoutSeconds: hypeman.Int(0),
4143
})

0 commit comments

Comments
 (0)