Repository navigation
feat(provider): serve Fabric agents from the fabric provider - #12842
Merged
Merged
Conversation
Fabric agent configuration and sandbox readiness were the last nemoclaw types that reach the gateway. The nemoclaw provider therefore kept the gateway connection, a deferred connection state, and platform_only, which Kubernetes platform graphs needed before gateway credentials existed. terraform-provider-fabric serves fabric_agent_configuration and the fabric_sandbox_readiness data source. It takes the openshell provider's gateway settings, now GatewayConfig and GatewayClient::configure in openshell-provider, and reaches each sandbox's Fabric host through the OpenShell client. The Fabric bridge and agent configuration code moves from nemoclaw-provider unchanged apart from imports. The nemoclaw provider's only setting is destroy. Generated graphs configure the gateway connection on the openshell and fabric providers, Kubernetes platform graphs omit both, and teardown sets destroy on all three. The bundle ships the third binary. The SDK refuses state that holds nemoclaw_agent_configuration or nemoclaw_sandbox_readiness before reading it. Fabric capabilities stays in nemoclaw until its image-reading types leave the SDK. Part of #12788.
The nemoclaw provider no longer takes a gateway connection.
Contributor
The openshell and fabric providers kept an earlier destroy grant when a later configuration was rejected, because the shared gateway check returned before the flag was stored. Both now clear it first. Also drop nemoclaw-provider's unused nemo-fabric-core dependency, name Fabric types in the earlier-state refusal, and describe the shared destroy setting without naming sandboxes.
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.
cv
added a commit
that referenced
this pull request
Oct 8, 2026
…12844) Part of #12788 (step 1b of 3). Stacked on #12842; it retargets to `v1` when #12842 merges. ## Failure `nemoclaw_fabric_capabilities` was the last Fabric type in the `nemoclaw` provider. It shared one data source with `nemoclaw_engine_capabilities`, switched by a `fabric` flag, and the code it needed (the Fabric catalog an image advertises, capability assessment, configuration planning, the observation it reports, and the engine read of the image label) lived in `nemoclaw-sdk` and `nemoclaw-discovery`. The `fabric` provider could not serve it without depending on the SDK. ## Decision Three commits, reviewable separately: 1. **`schema_accepts` gets its own module** (`nemoclaw-sdk/src/json_schema.rs`) with its tests. It is the offline JSON Schema check the authoring journey uses, and lived in `fabric_capabilities.rs` by accident; Fabric planning never called it. A planner test named for it, which never called it, is renamed for what it checks. 2. **New crate `nemoclaw-fabric`: Fabric's image contract.** It takes the catalog types, capability assessment and configuration planning, `FabricObservation`, image-metadata bundle verification and its tests, and `valid_for`. It depends on `nemoclaw-backend`, `nemoclaw-openshell` (image runtime layouts), and `nemo-fabric-core`. Deriving requirements from a sandbox's YAML stays in the SDK as `requirements_for_sandbox`, replacing `FabricRequirements::for_sandbox`. The SDK re-exports the moved modules at their previous paths, and `diagnostic_field` becomes public because the SDK's discovery graph labels diagnostics with it. 3. **The data source moves.** - `observe_fabric` and `judge_image` move into `nemoclaw-fabric` behind a default `client` feature, like `nemoclaw-docker`; the SDK leaves it off, so it still does not link the Docker client. - `fabric_capabilities` becomes a `fabric` provider data source with unchanged inputs and outputs. It reads the engine named on it and needs no gateway. - `nemoclaw_engine_capabilities` keeps only the engine read, without the flag. - Generated discovery and deployment graphs use the new type, and the SDK refuses state that holds `nemoclaw_fabric_capabilities` before reading it. - `docs/provider.md` lists the data source under the Fabric provider; the Fabric harness reference links the moved assessment code. ## Validation - `state_with_openshell_types_from_the_nemoclaw_provider_is_rejected_before_any_read` now covers `nemoclaw_fabric_capabilities`; it failed first because the SDK ran OpenTofu on that state. - The Fabric data source tests move to `fabric-provider` with it; `nemoclaw-provider` tests assert the engine schema has no Fabric inputs and that it no longer serves `fabric_capabilities`; the `fabric-provider` schema test asserts it serves `capabilities` with a required `engine`. - `cargo ci`: all selected steps passed on linux_arm64, including 108 lifecycle tests. - `cargo tree -p fabric-provider` contains no `nemoclaw-sdk`; `cargo tree -p nemoclaw-sdk -i bollard` finds nothing. --------- Co-authored-by: Carlos Villela <[email protected]>
cv
pushed a commit
that referenced
this pull request
Oct 8, 2026
…ame (#12857) Part of #12788 (step 2 of 3, the last). Stacked on #12844, which is stacked on #12842; it retargets as those merge. ## Failure - `fabric_agent_configuration` checked `config_json` against Fabric's types only while planning, and reported any failure as `observation query failed`, without saying what was wrong. - `fabric_sandbox_readiness` took one `sandbox` map of strings. Generated graphs filled it with every string attribute of the sandbox, filtering out its typed inputs, and merged in the configuration's `config_json`. OpenTofu could not check which keys the read needed; a missing or misspelled key surfaced only when the read failed. ## Decision Two commits: 1. **Invalid configurations name the rejected field.** `config_json` is checked during validation with `serde_path_to_error`, and reported as `Invalid config_json` on that attribute: `config_json is not a valid Fabric configuration at harness.adapter_id`. The path passes through `diagnostic_field`; the value and Fabric's own message, which can quote it, never appear. To build that message, `ValidateAttribute` returns `Cow<'static, str>` instead of `&'static str`; storage's checks return the same fixed text. 2. **Readiness takes its inputs by name.** It requires the sandbox's `workspace`, `name`, `id`, `owner`, `generation`, `agent_name`, `agent_runtime`, and `runtime_json`, and the configuration's `config_json`: the keys the read already used. The checks are unchanged; validation now also requires `runtime_json` and `config_json`. Generated graphs reference each attribute directly, and the filter for typed sandbox inputs goes away. Two items in #12788 were deliberately not done; the issue records why: - **`config` as an HCL value.** Fabric's configuration schema is open, so generated blocks would drop extension keys. A `dynamic` attribute would fit, but the pinned `tf-provider` decodes state without the schema and cannot tell a dynamic attribute's `[type, value]` pair from a two-element list. `config_json` stays a JSON string. - **Optional `owner` and `generation` on the configuration.** They are the sandbox's identity, which the provider verifies before acting, not the configuration's own. They stay required. ## Validation - New unit tests, written first: a valid configuration passes; a wrong type at `harness.adapter_id` and malformed JSON are reported without the input. Readiness exposes the nine required inputs and no `sandbox` map, hands the bridge exactly those nine, defers on unknown inputs, rejects missing or empty ones, and does not echo rejected values. - The standalone Pi lifecycle test now plans a rejected configuration through OpenTofu: it fails with `Invalid config_json ... at harness.adapter_id`, never shows the value, and makes no sandbox call. - `cargo ci`: all selected steps passed on linux_arm64, including 108 lifecycle tests.
This was referenced Oct 9, 2026
Closed
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 #12788 (step 1a of 3; 1b moves
fabric_capabilities, 2 types its inputs).Failure
Fabric agent configuration and sandbox readiness were the last
nemoclawtypes that reach the OpenShell gateway. Thenemoclawprovider therefore kept the gateway connection settings, a deferred connection state for settings unknown at plan time, andplatform_only, which Kubernetes platform graphs needed because they run before gateway credentials exist.Decision
New provider.
terraform-provider-fabric(registry.opentofu.org/nvidia/fabric, same source-derived version asnemoclaw) serves:fabric_agent_configurationnemoclaw_agent_configurationfabric_sandbox_readinessdata sourcenemoclaw_sandbox_readinessThe name follows #12788's decision: the provider carries Fabric's configuration and its host, which Fabric is expected to own (#12444).
New crate
fabric-provider. The Fabric bridge, agent configuration, and sandbox readiness move fromnemoclaw-providerwithgit mv, changed only in imports. It depends onnemoclaw-backend,nemoclaw-tofu,openshell-provider(to reach each sandbox's Fabric host through the OpenShell client), andnemo-fabric-core; not onnemoclaw-sdkorkube.Shared gateway settings. The
openshellprovider's configuration becomesGatewayConfigandGatewayClient::configureinopenshell-provider, soopenshellandfabricvalidate the same settings with the same code. Its tests move with it.nemoclawprovider. Its only setting isdestroy; every resource already names its engine or cluster. The gateway settings, deferred connection state, andplatform_onlyare removed, along with their tests.SDK.
openshellandfabric.platform_only.destroyon all three.resource_typemapsagent_configurationtofabric_agent_configuration, and lifecycle classification accepts thefabric_prefix.nemoclaw_agent_configurationornemoclaw_sandbox_readinessbefore reading it, like the earlier OpenShell types.Bundle. It builds and ships the third binary, and the SDK checks that it is present. End-to-end workspaces install it from beside the
nemoclawbinary.Documentation.
docs/provider.mdadds a Fabric section and describes thenemoclawprovider's single setting. The scope, architecture, apply-flow, build, and integration-test guides name the Fabric provider.nemoclaw_fabric_capabilitiesstays until its image-reading types leave the SDK (step 1b).Validation
state_with_openshell_types_from_the_nemoclaw_provider_is_rejected_before_any_readnow covers the two old Fabric types; it failed first because the SDK ran OpenTofu on that state.fabric-providerschema test: the provider serves exactlyagent_configurationandsandbox_readiness, with theopenshellprovider's gateway settings.nemoclaw-providertests assertdestroyis its only setting, that only an explicittruegrants teardown, and that it serves no OpenShell or Fabric types.endpointonnemoclaw; a follow-up commit fixes them.cargo ci: all selected steps passed on linux_arm64, including 108 lifecycle tests.cargo tree -p fabric-providercontains nonemoclaw-sdkorkube.