Repository navigation
feat(provider): compute the Docker gateway launch from typed settings - #12832
Merged
Merged
Conversation
Generated Docker gateway containers carried an entrypoint, command, and environment that only the SDK compiler knew how to write, so an HCL author declaring a gateway had to copy OpenShell gateway flags and data paths by hand. nemoclaw_gateway_runtime takes the gateway's name, endpoint, and the data path its storage returns, validates them, and returns the container's entrypoint, command, and env. The SDK compiler and the data source share one launch definition, and generated graphs take the container's launch from the data source. Part of #12785.
…12834) Part of #12785. Stacked on #12832. ## Failure `nemoclaw_runtime_image`, `nemoclaw_service_readiness` and `nemoclaw_service_capacity` took SDK-compiled service specifications. An HCL author could not check a runtime image, wait for a service container, or measure capacity without reproducing the SDK's internal JSON. ## Decision - **`nemoclaw_runtime_image`** takes `engine`, `image` (pinned by SHA-256 digest), `architecture` (`amd64` or `arm64`) and optional `labels`, the labels the image must carry. `image_id` and `allow_missing` keep their meaning. - **`nemoclaw_service_readiness`** takes the container's `engine`, `name` and `container_id`, and its `contract`: the `spec` output of the `nemoclaw_vllm_runtime`, `nemoclaw_ollama_runtime` or `nemoclaw_ollama_proxy_runtime` data source the container runs with. The contract decides what readiness checks, including vLLM credential permissions when it enables authentication. - **`nemoclaw_service_capacity`** replaces `specs` with `contracts`, the runtime contracts of the services on the engine. A contract listed twice is rejected, replacing the old check for a repeated service name. - Generated graphs pass these values. Readiness references the same runtime contract data source as the container's environment. - Provider internals now read readiness and capacity from the runtime contract instead of the whole compiled specification. ## Validation - **Readiness and capacity:** the standalone OpenTofu tests for readiness and capacity now write the typed inputs. Readiness failed on the previous schema ("Extraneous JSON object property") and both pass now. - **Schema:** a new provider schema test checks that all three data sources take typed inputs and no `spec`. - **Runtime image:** new unit tests cover validation of its requirements and deferral of unknown values. The read-only image checks still pass. - **Compiled graph:** the SDK compile tests check the generated readiness `contract` references. - **Suites:** `nemoclaw-sdk`, `nemoclaw-provider` and `nemoclaw-build` tests pass, with workspace clippy at `-D warnings` and fmt. GitHub CI runs the full suite.
cv
added a commit
that referenced
this pull request
Oct 8, 2026
…#12831) 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.
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. Stacked on #12831.
Failure
Generated Docker gateway containers carried an
entrypoint,commandandenvthat 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_runtimetakes the gatewayname, itsendpoint(an HTTP origin with a loopback address and an unprivileged port) and thedata_paththatnemoclaw_gateway_storagereturns. It returns the container'sentrypoint,commandandenvas lists, without contacting any host. This follows the other runtime contract data sources.data_path.Validation
nemoclaw-sdkandnemoclaw-providertests pass, as do the runtime contract and service storage end-to-end tests. Workspace clippy at-D warningsand fmt are clean. GitHub CI runs the full suite.