Skip to content

refactor(sdk): share managed model container resources - #13106

Merged
cv merged 14 commits into
v1from
refactor/sdk-container-resources
Oct 13, 2026
Merged

cv merged 14 commits into
v1from
refactor/sdk-container-resources

Conversation

@cv

@cv cv commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Moves the mapping from container settings to Docker resources into ServiceContainer, so the vLLM and Ollama installers share it.

Why

#13058 added CPU and memory limits. The vLLM and Ollama installers each turn an optional ServiceContainer into four Process fields using the same chained .container.as_ref()… expressions:

  • shared memory, with an inline 8 GiB default that repeats default_shm;
  • host IPC;
  • the CPU limit;
  • memory, with DEFAULT_MEMORY_LIMIT_GIB.

docker_compute also repeated attrs["labels"].as_array_mut().unwrap().push(json!({…})) for the two limit labels.

Change

  • ServiceContainer::resources(Option<&Self>) -> ContainerResources computes the four values once. Both installers copy them into Process.
  • The omitted shared-memory size now comes from default_shm. The value is still 8 GiB.
  • push_label in docker_compute adds the CPU and memory limit labels.

Validation

  • cargo test -p nemoclaw-sdk --lib: 210 passed.
  • cargo test -p nemoclaw-sdk --test integration: 444 passed. This includes the runtime compile tests that check the Docker limits and labels.
  • cargo ci on linux_arm64: all steps passed.

cv added 13 commits October 13, 2026 10:36
ObservationError lost Copy in #13056, and #13081 merged after it with a test
that moves the class twice, so the SDK integration tests no longer compile on
v1 and CI fails at clippy.
Move the OpenClaw and Hermes context advisory out of Deployment::run into
deployment::context_advisory, which returns the warnings for a validated
document. Unit tests call it directly; one test still checks that plan and
apply report the same warnings before creating state or starting a mutation.
Add ServiceDefinition::context_tokens, update_policy, and model_address so the
context advisory and Docker model preservation no longer match on vLLM and
Ollama themselves. model_address uses each installer's own address helper, so
preservation can no longer drift from the compiled resource address.
The vLLM and Ollama installers each turned an optional ServiceContainer into
shared memory, IPC, CPU, and memory settings with the same four expressions.
ServiceContainer::resources now does it once, using default_shm for the
omitted shared-memory size. Docker container labels use one push_label helper.
…cessors

# Conflicts:
#	crates/nemoclaw-sdk/src/deployment/context_advisory.rs
@cv
cv changed the base branch from refactor/sdk-service-accessors to v1 October 13, 2026 19:03
@cv
cv enabled auto-merge (squash) October 13, 2026 19:03
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit a94373e into v1 Oct 13, 2026
@cv
cv deleted the refactor/sdk-container-resources branch October 13, 2026 20:03
@wscurran wscurran added area: architecture Architecture, design debt, major refactors, or maintainability area: providers Inference provider integrations and provider behavior platform: container Affects Docker, containerd, Podman, or images provider: ollama Ollama local model provider behavior provider: vllm vLLM local or hosted provider behavior refactor PR restructures code without intended behavior change labels Oct 13, 2026
@wscurran wscurran added the v1 NemoClaw v1 branch label Oct 28, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: architecture Architecture, design debt, major refactors, or maintainability area: providers Inference provider integrations and provider behavior platform: container Affects Docker, containerd, Podman, or images provider: ollama Ollama local model provider behavior provider: vllm vLLM local or hosted provider behavior refactor PR restructures code without intended behavior change v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants