Repository navigation
feat(provider): type gateway resources and service observation inputs - #12831
Merged
Merged
Conversation
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.
…#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
enabled auto-merge (squash)
October 8, 2026 18:08
Contributor
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.
This was referenced Oct 8, 2026
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.
This was referenced Oct 9, 2026
6 tasks done
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.
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.
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
specstrings. 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_gatewayandnemoclaw_gateway_storagetakename,compute_driver,engine,image,network_cidrandendpointas attributes.ownerandgenerationare optional, computed and generated on create. The provider derives the internal layout. Docker gateway storage rejectsendpoint, 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_runtimecomputes a Docker gateway container'sentrypoint,commandandenvfromname,endpointand the storage'sdata_path. It shares one launch definition with the SDK compiler. Generated graphs take the launch from it.nemoclaw_runtime_imagetakesengine, a digest-pinnedimage,architectureand optionallabels.nemoclaw_service_readinesstakes the container'sengine,nameandcontainer_id, and itscontract: thespecof the vLLM, Ollama or Ollama proxy runtime data source the container runs with.nemoclaw_service_capacitytakescontractsinstead ofspecsand rejects a contract listed twice.docs/limits.mdnow lists only the Kubernetes types as taking a compiledspec.The merge from
v1keeps #12842's removal of thenemoclawprovider's gateway settings. The authored HCL in the end-to-end tests uses an emptyprovider "nemoclaw"block.Validation
nemoclaw_gateway_runtime.v1:nemoclaw-sdk,nemoclaw-providerandnemoclaw-buildpass 776 tests.-D warningsand fmt are clean.