feat(api)!: model CPU and memory as typed compute resource requirements - #3012
Open
elezar wants to merge 7 commits into
Open
feat(api)!: model CPU and memory as typed compute resource requirements#3012elezar wants to merge 7 commits into
elezar wants to merge 7 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 |
elezar
force-pushed
the
feat/2838-portable-compute-requirements/elezar
branch
2 times, most recently
from
September 1, 2026 09:18
f3e21a8 to
18df2b1
Compare
elezar
force-pushed
the
feat/2838-portable-compute-requirements/elezar
branch
from
September 8, 2026 13:39
18df2b1 to
449d763
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-3012.docs.buildwithfern.com/openshell |
elezar
force-pushed
the
feat/2838-portable-compute-requirements/elezar
branch
3 times, most recently
from
September 9, 2026 10:28
beaa621 to
90eb97b
Compare
elezar
marked this pull request as ready for review
September 9, 2026 11:58
elezar
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
September 9, 2026 11:58
Model CPU, memory, and GPU through one typed ResourceRequirements envelope across inline sandbox specs, reusable workload templates, and compute drivers. Update the CLI, gateway translation, and built-in drivers to consume the unified model. BREAKING CHANGE: CPU and memory move to typed resource requirements, and SandboxWorkloadConfig.resources now uses ResourceRequirements instead of SandboxResources. Part of #2838 Signed-off-by: Evan Lezar <elezar@nvidia.com>
Expose the shared typed ResourceRequirements model for inline and reusable-template workloads and remove the template-only SandboxResources alias. BREAKING CHANGE: SandboxResources is removed; reusable workload templates now use ResourceRequirements with typed CPU and memory fields. Part of #2838 Signed-off-by: Evan Lezar <elezar@nvidia.com>
Use ResourceRequirements for both inline and reusable-template sandbox workloads, update deep-copy converters and fakes, and regenerate the Go protobuf binding. BREAKING CHANGE: SandboxWorkloadConfig.Resources now uses ResourceRequirements, and the template-only SandboxResources and SandboxGPURequirements types are removed. Part of #2838 Signed-off-by: Evan Lezar <elezar@nvidia.com>
Update reusable workload template construction and tests for the shared ResourceRequirements protobuf shape while preserving the high-level builder arguments. BREAKING CHANGE: Raw reusable-template protobuf callers must use resources.cpu.limit and resources.memory.limit instead of string fields. Part of #2838 Signed-off-by: Evan Lezar <elezar@nvidia.com>
Use the shared generated ResourceRequirements shape for reusable workload templates and update the curated exports and tests. BREAKING CHANGE: SandboxResources is no longer exported, and reusable-template CPU and memory values use typed limit objects. Part of #2838 Signed-off-by: Evan Lezar <elezar@nvidia.com>
Validate typed CPU and memory quantities and reject legacy CPU or memory entries in the historical inline template resource passthrough with migration guidance. Part of #2838 Signed-off-by: Evan Lezar <elezar@nvidia.com>
Document the shared inline and reusable-template resource model, driver behavior, migration from legacy template resource sections, and updated SDK examples. Part of #2838 Signed-off-by: Evan Lezar <elezar@nvidia.com>
elezar
force-pushed
the
feat/2838-portable-compute-requirements/elezar
branch
from
September 10, 2026 06:57
90eb97b to
75f6162
Compare
sjenning
reviewed
Sep 10, 2026
| // Driver CPU resource requirements. | ||
| message CpuResourceRequirements { | ||
| // CPU limit for the sandbox workload (e.g. "500m", "2"). | ||
| string limit = 1; |
Collaborator
There was a problem hiding this comment.
It seems that there is no way to specify resource requests on cpu/memory, only limits. Typically, one does not want to specify a CPU limit because it needlessly throttles a pod that could otherwise use the idle CPU on the node.
| apply("requests", "cpu", cpu_request); | ||
| apply("requests", "memory", memory_request); | ||
| if let Some(cpu) = requirements.cpu.as_ref() { | ||
| apply("limits", "cpu", &cpu.limit); |
Collaborator
There was a problem hiding this comment.
We lost fidelity here where limits on the API are used to set both limits and requests
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
ResourceRequirementsmessages.ResourceRequirementsmessage for inline sandbox specs and reusableSandboxWorkloadConfig.resources(field 3), removing the duplicateSandboxResourcesand template-only GPU SDK types.SandboxTemplate.resourcesfield as platform-native passthrough and rejects legacy CPU/memory entries there with migration guidance.Related Issue
Part of #2838.
Changes
proto/openshell.proto: models portable CPU, memory, and GPU requirements once underResourceRequirements; reusable workload templates reuse that message without renaming or renumbering theirresourcesfield.proto/compute_driver.proto: carries the corresponding typed requirements at the existing driver sandbox-spec boundary; no additional driver template message was added.cpu.limitandmemory.limit; Rust and TypeScript expose the same shared shape.ResourceRequirements; generated Go protobuf bindings were regenerated. TypeScript and Python generated bindings remain build outputs regenerated by their build tasks.ResourceRequirementsfrom the historical inline platform-nativeSandboxTemplate.resourcespassthrough.Compatibility
This is an intentional breaking API change. Existing reusable-template clients using the removed
SandboxResourceswire shape must regenerate bindings and sendResourceRequirements(cpu.limit,memory.limit, andgpu). The outerSandboxWorkloadConfig.resourcesfield name and field number remain unchanged.The SDK impact is recorded in language-specific breaking commits, ordered Rust, Go, Python, then TypeScript:
SandboxResourcesalias and exposes typed CPU and memory requirements.SandboxWorkloadConfig.ResourcestoResourceRequirementsand removes template-only resource types.SandboxResourcesexport and uses the shared generated type.Testing
cargo test -p openshell-server -p openshell-cli -p openshell-sdkmise run go:cimise run sdk:ts:ci(105 tests)mise run test:python(152 tests)mise run pre-commitChecklist