Skip to content

feat(provider): type gateway resources and service observation inputs - #12831

Merged
cv merged 6 commits into
v1from
feat/typed-managed-gateway
Oct 8, 2026
Merged

cv merged 6 commits into
v1from
feat/typed-managed-gateway

Conversation

@cv

@cv cv commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #12785. Carries #12832 and #12834, which merged into this branch while the PRs were stacked.

Failure

Gateway resources and the service observation data sources took SDK-compiled spec strings. To declare a gateway, check a runtime image, wait for a service, or measure capacity in HCL, an author had to reproduce the SDK's internal JSON, including layout numbers that encode storage contract versions. Generated Docker gateway containers also carried an entrypoint, command and environment that only the SDK compiler could write.

Decision

  • nemoclaw_managed_gateway and nemoclaw_gateway_storage take name, compute_driver, engine, image, network_cidr and endpoint as attributes. owner and generation are optional, computed and generated on create. The provider derives the internal layout. Docker gateway storage rejects endpoint, because its data does not depend on the listen port. The backend still builds the same internal specification, so container and volume labels are unchanged. The SDK reads the attributes back from OpenTofu state for bound gateways.
  • nemoclaw_gateway_runtime computes a Docker gateway container's entrypoint, command and env from name, endpoint and the storage's data_path. It shares one launch definition with the SDK compiler. Generated graphs take the launch from it.
  • nemoclaw_runtime_image takes engine, a digest-pinned image, architecture and optional labels.
  • nemoclaw_service_readiness takes the container's engine, name and container_id, and its contract: the spec of the vLLM, Ollama or Ollama proxy runtime data source the container runs with.
  • nemoclaw_service_capacity takes contracts instead of specs and rejects a contract listed twice.
  • The provider guide documents each input. docs/limits.md now lists only the Kubernetes types as taking a compiled spec.

The merge from v1 keeps #12842's removal of the nemoclaw provider's gateway settings. The authored HCL in the end-to-end tests uses an empty provider "nemoclaw" block.

Validation

  • Gateway resources: a provider schema test checks their typed attributes. Attributes round-trip to the internal specification for both drivers, and invalid values are rejected. State bindings record typed settings, including the null endpoint of Docker gateway storage.
  • End-to-end through pinned OpenTofu:
    • The prerequisite protocol test writes the gateway in HCL.
    • A Docker gateway written in HCL plans its launch through nemoclaw_gateway_runtime.
    • The readiness and capacity tests use the typed inputs.
  • After merging v1:
    • nemoclaw-sdk, nemoclaw-provider and nemoclaw-build pass 776 tests.
    • The standalone OpenTofu tests (24), the production provider tests and the capacity test pass.
    • Workspace clippy at -D warnings and fmt are clean.

cv added 4 commits October 8, 2026 05:00
nemoclaw_ollama_proxy_storage and nemoclaw_ollama_external_model
required owner and generation, which authors had to invent before
writing an Ollama proxy in HCL.

Both now treat them as optional and computed: the provider generates
omitted values on create and keeps them in state, as it does for
service storage, while generated graphs keep supplying the values the
SDK records. Identity generation is shared by the provider's resource
families.

Part of #12785.
…settings

Managed Ollama containers received NEMOCLAW_RUNTIME_SPEC and Ollama
proxy containers NEMOCLAW_OLLAMA_PROXY as strings only the SDK
compiler could produce.

The vLLM data source becomes a runtime contract data source that also
serves nemoclaw_ollama_runtime, generated from the Ollama runtime
schema. nemoclaw_ollama_proxy_runtime takes the bind address,
upstream, model, and digest and validates them with the proxy's own
rules. Generated graphs take both containers' environment from them.

Part of #12785.
nemoclaw_managed_gateway and nemoclaw_gateway_storage took one
SDK-compiled spec string, so an HCL author could not declare a gateway
without reproducing the SDK's internal JSON and layout numbers.

Both now take name, compute_driver, engine, image, network_cidr, and
endpoint as attributes, with owner and generation optional and
generated as for service storage. The provider derives the internal
layout from the type and compute driver. Docker gateway storage omits
the endpoint because its data does not depend on the listen port.

The SDK compiles the attributes, reads them back from state for bound
gateways, and compares them when checking plans against retained
intent.

Part of #12785.
@cv cv added area: architecture Architecture, design debt, major refactors, or maintainability v1 NemoClaw v1 branch labels Oct 8, 2026
Base automatically changed from feat/ollama-runtime-data-sources to v1 October 8, 2026 12:48
cv added 2 commits October 8, 2026 10:51
…#12832)

Part of #12785. Stacked on #12831.

## Failure

Generated Docker gateway containers carried an `entrypoint`, `command`
and `env` that only the SDK compiler knew how to write. An HCL author
declaring a Docker gateway had to copy OpenShell gateway flags and data
paths by hand.

## Decision

- `nemoclaw_gateway_runtime` takes the gateway `name`, its `endpoint`
(an HTTP origin with a loopback address and an unprivileged port) and
the `data_path` that `nemoclaw_gateway_storage` returns. It returns the
container's `entrypoint`, `command` and `env` as lists, without
contacting any host. This follows the other runtime contract data
sources.
- Invalid settings fail validation with a message naming the setting.
- The SDK compiler and the data source share one launch definition, so
the compiled Podman container and the data source's Docker output cannot
drift apart.
- Generated graphs take the Docker gateway container's launch from the
data source, fed the storage's `data_path`.
- The provider guide documents the data source with an example and lists
the container settings generated graphs add.

## Validation

- A new end-to-end test writes a Docker gateway in HCL through pinned
OpenTofu and checks the planned launch. It also checks that invalid
settings fail. It failed against the previous bundle ("Invalid data
source") and passes against a rebuilt one.
- A unit test checks that the launch matches the compiled container and
that invalid names, endpoints and data paths are rejected.
- The SDK compile tests now check the generated data source and the
references to it.
- `nemoclaw-sdk` and `nemoclaw-provider` tests pass, as do the runtime
contract and service storage end-to-end tests. Workspace clippy at `-D
warnings` and fmt are clean. GitHub CI runs the full suite.
# Conflicts:
#	crates/nemoclaw-e2e/tests/provider_protocol.rs
#	crates/nemoclaw-e2e/tests/service_capacity.rs
#	crates/nemoclaw-e2e/tests/service_readiness.rs
#	crates/nemoclaw-e2e/tests/vllm_runtime.rs
#	crates/nemoclaw-provider/src/lib.rs
#	crates/nemoclaw-provider/src/provider.rs
#	crates/nemoclaw-provider/tests/schema.rs
#	crates/nemoclaw-sdk/src/services/installers/ollama/proxy_container.rs
#	docs/provider.md
@cv cv changed the title feat(provider): type managed gateway and gateway storage settings feat(provider): type gateway resources and service observation inputs Oct 8, 2026
@cv
cv enabled auto-merge (squash) October 8, 2026 18:08
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 1d05a42 into v1 Oct 8, 2026
17 checks passed
@cv
cv deleted the feat/typed-managed-gateway branch October 8, 2026 18:37
cv added a commit that referenced this pull request Oct 8, 2026
Closes #12785. Part of #12782.

## Failure

`nemoclaw_kubernetes_storage`, `nemoclaw_kubernetes_auth` and
`nemoclaw_kubernetes_gateway` were the last `nemoclaw` types that took
one SDK-compiled `spec` string. An HCL author could not declare a
managed Kubernetes or OpenShift gateway without reproducing the SDK's
internal JSON.

## Decision

- **Attributes:** the three resources take the cluster target and
identity as attributes: `name`, `compute_driver` (`kubernetes` or
`openshift`), `endpoint`, `kubeconfig_env`, `context`, `namespace`,
`authentication_profile` and an optional `environment` list.
- **Identity:** `owner` and `generation` are optional and computed,
generated on create. Generated graphs keep supplying the SDK's values.
- **Typed list:** `environment` is a `list(string)` carried through the
existing structured adapter. The `nemoclaw` provider now serves types
with structured inputs through that adapter.
- **Validation:** invalid values are reported at their attribute without
echoing them. The backend rebuilds the same internal specification from
the attributes, so cluster objects and receipts are unchanged. A changed
target or identity still fails planning and retains the resources.
- **SDK, compiling and reading state:** the SDK compiles the attributes
and reads them back from OpenTofu state, including the `environment`
list.
- **SDK, comparing intent:** teardown and runtime binding checks compare
the typed attributes, and plan identity checks cover the new ones.
Export now checks every typed resource against intent, not only those
with a `spec`. Since #12831, managed gateways and their storage had
dropped out of that export check; this restores it.
- **Docs:** the provider guide lists the attributes. It says the three
resources must share one `owner`, because their receipt is keyed by
owner and name. `docs/limits.md` and the provider guide no longer list
compiled-`spec` types; no `nemoclaw` type takes one now.

## Validation

- **New tests:**
- A provider schema test checks the typed attributes, generated identity
and the `environment` list on all three resources.
- An SDK test round-trips each compiled Kubernetes and OpenShift
resource through its attributes and rejects invalid driver, namespace,
kubeconfig variable, endpoint, profile and reserved environment values.
- An end-to-end test writes `nemoclaw_kubernetes_storage` in HCL and
plans it through pinned OpenTofu without a cluster. It also rejects an
invalid namespace at its attribute.
- **Updated tests:** the existing Kubernetes compile, runtime binding,
teardown and refresh tests now use the attributes.
- **Suites:**
  - `nemoclaw-sdk`, `nemoclaw-provider` and `nemoclaw-build` tests pass.
  - The standalone and production-provider OpenTofu tests pass.
- Workspace clippy at `-D warnings`, fmt and the schema check are clean.
- **Not done:** I did not run the live cluster tests.

The draft #12736 already conflicts with `v1`. It also edits
`nemoclaw-provider/src/provider.rs`, `services/validation.rs` and
`docs/provider.md`, so it will need to follow these attributes.

## Follow-up

The first CI run failed five Helm recovery lifecycle tests with
"observation is incomplete". The resource adapter requires every
attribute in an observation, and a Kubernetes row without an
`environment` list left out `environment_json`. Observations now report
it as empty. A new unit test checks that each Kubernetes observation
reports every attribute; it failed before the fix. The 14 Helm recovery
tests and the SDK's Kubernetes and export tests pass against a rebuilt
bundle.
cv added a commit that referenced this pull request Oct 8, 2026
…12860)

## Failure

Two live workflows on `v1` turned red after my PRs. Both run only on
pushes to `v1`, so neither PR ran them:

- **[Live /
Docker](https://github.com/NVIDIA/NemoClaw/actions/runs/37837713421)**,
red since #12831.
`managed_gateway_plan_apply_noop_destroy_and_recovery_use_real_opentofu`
failed with "Apply incomplete: observation is incomplete". The resource
adapter requires an observation to report every attribute, empty or not.
Docker gateway storage omits `endpoint`, because its data does not
depend on the listen port, so its observation left the attribute out.
- **[Live /
Kind](https://github.com/NVIDIA/NemoClaw/actions/runs/37837713424)**,
red since #12855.
`kubernetes_live::the_gateway_installs_authenticates_and_is_removed_keeping_storage`
still read the removed `spec` attribute of the compiled gateway target.

## Decision

- Managed gateway observations report an omitted `endpoint` as empty, as
Kubernetes observations already do for an omitted `environment`.
- The Kubernetes live test builds the specification from the typed
attributes with `Spec::from_row`.

## Validation

- A new unit test checks that gateway and storage observations report
every configured attribute for Docker and Podman. It failed on Docker
gateway storage before the fix.
- Run locally against a rebuilt bundle:
- `cargo ci live-docker` passes, including the managed gateway lifecycle
test.
  - `cargo ci live-kind` passes, including the gateway install test.
- Workspace clippy at `-D warnings` and fmt are clean.
cv added a commit that referenced this pull request Oct 9, 2026
Closes #12883. Part of #12876.

## Failure

`Live / Docker` and `Live / Kind` ran only on `v1` pushes. #12831 and
#12855 merged with passing pull request checks and turned `v1` red
([Docker](https://github.com/NVIDIA/NemoClaw/actions/runs/37837713421),
[Kind](https://github.com/NVIDIA/NemoClaw/actions/runs/37837713424)).

## Decision

- **Pull request trigger:** both workflows now run on pull requests to
`v1`. Pushes, `run-live-*` branches, and manual runs are unchanged.
- **Change check:** on a pull request, each job first runs
`nemoclaw-build changes live` and skips its remaining steps when the
change cannot affect the suite.
- The check uses the same determinator and guppy analysis as `changes
images`.
- It analyzes a live build: the packages whose tests run live
(`nemoclaw-build`, `-e2e`, `-provider`, `-runtime`, `-sdk`) and the CLI
and providers the bundle ships, with their dependencies and tests.
- **Path rules:** `.config/determinator-live.toml` classifies files
outside crates.
- Changes under these paths run the suite: `examples/`, `image/`,
`runtimes/`, `schemas/`, `versions.json`, the toolchain,
`.config/nextest.toml`, `.github/actions/`, and the live workflows.
  - Documentation, other workflows, and repository tooling skip it.
- Unclassified files, dependency or feature changes in the live build,
and failed analyses run it.
- **Concurrency:** a newer pull request run cancels a superseded one.
Push runs still finish.
- **Docs:** `docs/contributing/testing.md` describes the trigger and how
to check the decision locally.

Neither live workflow is a required check, so a skipped run doesn't
block merging.

## Validation

- **New tests:** `nemoclaw-build` tests decide on a committed temporary
workspace, as the image tests do.
- Documentation, another workflow, and a package outside the live build
skip the suite.
- Each live package and each live input path runs it, as does an
unclassified file.
- The tests failed before `changes live` existed, and the image tests
still pass.
- **This branch:** `changes live --base origin/v1` reports `live=true`,
because `nemoclaw-build` changed.
- **Checks:** the `nemoclaw-build` integration tests pass (77). clippy
at `-D warnings` passes with and without default features, and fmt is
clean.
- **Workflow:** this pull request runs both live workflows for the first
time.
@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery feature PR adds or expands user-visible functionality platform: container Affects Docker, containerd, Podman, or images security area: security Security controls, permissions, secrets, or hardening labels Oct 28, 2026
@wscurran wscurran removed the security label Oct 29, 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: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality platform: container Affects Docker, containerd, Podman, or images v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants