feat(api)!: model CPU and memory as typed compute resource requirements - #3012
Draft
elezar wants to merge 2 commits into
Draft
feat(api)!: model CPU and memory as typed compute resource requirements#3012elezar wants to merge 2 commits into
elezar wants to merge 2 commits into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Member
Author
|
/ok-to-test cd3f905 |
Add typed cpu/memory fields to ResourceRequirements in both the public and compute-driver protos, replacing the Struct-based SandboxTemplate.resources passthrough for portable sizing. Update CLI --cpu/--memory to populate the typed fields, gateway validation to reject the legacy template.resources.limits/requests.cpu|memory path, and the Kubernetes, Docker, and Podman drivers to consume the typed requirements. VM and MXC drivers explicitly reject typed CPU/memory until sizing support lands, rather than silently ignoring it. CPU/memory quantity validation is shared between the CLI and gateway via a new openshell-core::quantity module instead of being duplicated. Docs and SDK surface updates are still outstanding. BREAKING CHANGE: SandboxTemplate.resources.limits.cpu, limits.memory, requests.cpu, and requests.memory are no longer interpreted as portable sandbox sizing and are now rejected by the gateway. Callers must migrate to spec.resource_requirements.cpu.limit / memory.limit. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Replace the GPU-only ResourceRequirements handling in the Go SDK with a ResourceRequirements type that mirrors the proto message shape (GPU, CPU, Memory), so Go SDK callers can set typed CPU/memory requirements instead of relying on the now-rejected Template.Resources passthrough. Regenerate the generated proto bindings to pick up the Cpu/Memory fields added to ResourceRequirements. BREAKING CHANGE: types.SandboxSpec.GPUCount is replaced by types.SandboxSpec.ResourceRequirements.GPU.Count. Signed-off-by: Evan Lezar <elezar@nvidia.com>
elezar
force-pushed
the
feat/2838-portable-compute-requirements/elezar
branch
from
August 31, 2026 12:32
cd3f905 to
f3e21a8
Compare
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
cpu/memoryfields toResourceRequirementsin the public API and compute-driver protos, replacing theStruct-basedSandboxTemplate.resourcespassthrough for portable CPU/memory sizing.openshell sandbox create --cpu/--memorynow populate the typed fields instead of a Kubernetes-shapedStruct.template.resources.limits/requests.cpu|memorywith a clear migration error.--cpu/--memoryparsing rules) is shared between the CLI and gateway via a newopenshell-core::quantitymodule instead of being duplicated.types.ResourceRequirements, mirroring the proto shape) instead of only GPU.architecture/compute-runtimes.mddocuments the typed CPU/memory model and per-driver support/rejection behavior.This is still a draft — public docs (
docs/sandboxes/manage-sandboxes.mdx,docs/reference/sandbox-compute-drivers.mdx) and the TypeScript/Python SDK curated surfaces called out in the issue's acceptance criteria are not yet done.Related Issue
Part of #2838.
Changes
proto/openshell.proto,proto/compute_driver.proto: typedCpuResourceRequirements/MemoryResourceRequirementsunderResourceRequirements; oldDriverSandboxTemplate.resources/DriverResourceRequirementsreserved.crates/openshell-cli/src/run.rs,main.rs:--cpu/--memorybuild typed requirements.crates/openshell-core/src/quantity.rs(new): shared CPU/memory quantity validation used by both the CLI and gateway.crates/openshell-server/src/grpc/validation.rs: validates typed compute requirements; rejects legacytemplate.resourcesCPU/memory fields.crates/openshell-server/src/compute/mod.rs: gateway-to-driver translation for typed requirements.crates/openshell-driver-kubernetes,-docker,-podman: consume typed CPU/memory.crates/openshell-driver-vm,-mxc: explicitly reject typed CPU/memory until supported.crates/openshell-sdk/src/client.rs: passthrough update.sdk/go/openshell/v1/types/sandbox.go,internal/converter/sandbox.go,fake/sandbox.go: typedResourceRequirements{GPU, CPU, Memory}replacing GPU-only handling (breaking rename:SandboxSpec.GPUCount→SandboxSpec.ResourceRequirements.GPU.Count).architecture/compute-runtimes.md: documents the typed resource model and driver support matrix.Testing
cargo test --workspace --lib --binspasses.mise run pre-commitpasses (includescargo clippy --workspace --all-targets -- -D warnings,cargo fmt --check, helm lint, license headers, markdown lint).mise run go:lint,mise run go:test,mise run go:proto:check,gofmt -lpass for the Go SDK.Checklist