Repository navigation
feat(services): share an explicit container base with managed runtimes - #13093
Conversation
Signed-off-by: San Dang <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Merge canonical v1 (7c77512) after the OpenTofu-native provider reorganization in #13131. The old nemoclaw provider is gone. Application containers now use the existing providers: - host_image takes an explicit require_healthcheck input instead of a free-form image contract. Generated graphs set it for application images, so creation still requires image-owned startup and a Docker HEALTHCHECK. - A new read-only host_container_health data source waits for an owned container's Docker HEALTHCHECK on every apply. It takes typed engine, name, container ID, and label inputs instead of a compiled document, and replaces the application case in vLLM/Ollama service readiness. - The shared Docker installer and the application dependency edges use the current resource and readiness type names. Two stale docs/usage.md edits unrelated to application containers are restored to the v1 text. Signed-off-by: San Dang <[email protected]>
…aw needs An application container is now image, user, environment, publication, and its data mount. It always runs on the managed local Docker gateway's engine and network. Removed: - architecture: Docker pulls the image for the engine's platform, so the application image no longer needs a host_image platform check, and host_image's require_healthcheck goes back to v1. - placement, dependsOn, imagePullPolicy, and readiness: the gateway supplies placement, the health wait is fixed at 300 seconds, and the dependency validator and graph edges are gone. - validate_spec: it rechecked what the installer had just compiled. - host_container_health's offline validator and duplicate tests; one test covers healthy, starting, unhealthy, stopped, foreign, and absent containers. Signed-off-by: San Dang <[email protected]>
Keep Ollama and vLLM as typed convenience frontends over shared container assembly and limits. Explicit containers can carry the same runtime JSON, GPU and process limits, /data, and fresh runtime-status readiness. Add literal arguments/files, bounded HTTP readiness, and private serviceRef wiring without application-name detection. Preserve typed model memory, storage, authentication, update, and readiness policies. The explicit Ollama/vLLM compilation test failed on the old restricted base and now passes. SDK/provider/runtime/build selections passed apart from a local-Git fixture blocked by inherited offline mode; that unchanged fixture passed without CARGO_NET_OFFLINE in the same network-isolated sandbox. Schema, Clippy, and docs checks pass. Full pinned CI follows on this commit. The contract documents raw-container limits and the manual VoiceClaw interface; no live qualification is claimed. Signed-off-by: San Dang <[email protected]>
Signed-off-by: San Dang <[email protected]>
A native container argument equal to a logical resource address was being rewritten into a Docker address. The regression fails before the repair and passes afterward. Limit address rewriting to depends_on and replace_triggered_by; preserve command arguments and uploaded configuration contents. SDK tests and workspace Clippy pass. Signed-off-by: San Dang <[email protected]>
…nputs Merge current v1 to repair the compile_teardown API mismatch seen in CI. Update the new fixtures to the pinned gateway image. Keep PR #13093 independent of the closed protected-input PR #12619. Record the maintainer-approved temporary literal environment approach, including plaintext configuration/state/Docker exposure and no automatic redaction. Preserve typed managed-model credential storage and memory safeguards. No protected-files resource is added. 795 focused SDK/provider/runtime tests, workspace Clippy, generated schema/reference, and Rust documentation checks pass in credential isolation; full CI follows. Signed-off-by: San Dang <[email protected]>
Manual integration evidence — 2026-10-16The manual browser test reached the NemoClaw OpenClaw agent through OpenShell/Fabric and displayed its answer. The operator reported no spoken result. This establishes backend delegation and display; result audio playback remains incomplete. Companion PR: VoiceClaw #162. Tested source
The original NemoClaw commit could not persist container intent. The tested bundle adds | installers::vllm::SERVICE_KIND
+ | installers::container::SERVICE_KINDThe local patch also adds two persistence tests, covering initial save/reopen and service addition/removal. Both failed before the repair. All 213 SDK unit tests, formatting, and SDK library Clippy passed afterward. The patch is uncommitted and unpushed; this evidence does not qualify the unchanged PR commit. Patch SHA-256: Setup and observed exchange
Limits and remaining findings
Correlation and immutable image identities
Evidence combines the operator's browser transcript with read-only native artifact inspection. No additional invocation was sent during inspection. Credentials, raw state, and private manifests are excluded. |
…ures Signed-off-by: San Dang <[email protected]>
PR-6 merged v1 up to #13411. Three v1 changes move code this branch builds on: - #13224 removed the `nemoclaw` provider, which served this branch's cluster model types. They become `openshell_kubernetes_service` and `openshell_kubernetes_service_storage`, served by the openshell provider beside the Kubernetes gateway installation types: two more `INSTALLATION_TYPES` entries, and `cluster_services::definitions()` in `all_definitions()`. Their contract tests move to `openshell-provider::contract` with the Kubernetes gateway tests, their schema to the openshell snapshot, and the docs name the new types. - #13286 plans and applies each deployment as one OpenTofu root. The cluster image preflight moves from the removed runtime stage into `Deployment::run`, before compilation. #13286 also removed the "unfinished Kubernetes platform apply" rule, so this branch's exception to it (`revises_only_model_workloads`), its test, and its usage.md paragraph go too. The compile test now checks that the apply-time gateway read, which every object waits on, waits on the cluster service, instead of checking that agents compile into a separate graph. - #13184 added `Definition::derived`: a computed attribute kept out of backend rows. This branch's `derived` is an optional input checked against the spec and kept in the row, so ownership checks still see `owner` and `generation`. It is renamed `derived_input`. Smaller follow-ups: - #13093 added `ServiceDefinition::Container`; the cluster matches cover it. The cluster service is no longer a `runtime_process` kind: that flag now also selects Docker readiness and compute, which decode a Docker spec. Its only other readers handle the cluster kind first. - #13223 dropped the `org.nemoclaw.runtime.spec` label everywhere; the cluster image check no longer requires it. - #13369 removed `model_metadata` from OpenClaw routes, since Fabric v0.5.0's adapter rejects it; the cluster fixtures and docs drop it. The remaining conflicts keep both sides. `openshell-provider::contract`'s summed budget rises from 105 to 130 s, keeping v1's margin: the 8 moved cluster model tests add 23.2 s in a local linux_arm64 run (slowest 3.9 s, within the 6 s limit), about 17 s at CI speed. `nemoclaw-provider::contract` keeps its v1 budget; this branch's earlier raise to 150 s went with the tests. Validation on linux_arm64: the `cargo ci` fmt, clippy, test, schema, bundle and lifecycle steps pass (161 lifecycle tests, among them the 8 cluster model contract tests), as does `nemoclaw-build docs --check`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#14166) <!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. --> <!-- SPDX-License-Identifier: Apache-2.0 --> ## Failure #13093 added `kind: container` services, but #12567's acceptance criteria were not all met: - No committed example declared a container service; #13093 removed its YAML fixtures. - No test exported and reapplied a container service, or compared it with the generated schema. - The schema typed `command`, `readiness.path`, and `readiness.runtimeStatus` as nullable, so the configuration reference listed them as "any JSON value". When the new example went through the onboarding journey, the journey asked for `readiness.path` as JSON, rejected `/health`, and offered no text for the service's environment variables. ## Decision - Add `examples/application-container.yaml`: one OpenClaw agent and one application container on a managed local Docker gateway. Following the manual connection in the [container contract](docs/design/container-contract.md#manual-voiceclaw-connection), the application's own environment variables name the gateway address, workspace, sandbox, sandbox ID, and agent. The example's comments say to apply the agent first and then copy its sandbox ID. `docs/usage.md` links to the example. The existing example tests now cover it: schema, round trip, Fabric validity, OpenShell fixtures, export, onboarding, and authoring. - Add `crates/nemoclaw-sdk/tests/application_container.rs`: - The example's settings match the workspace derived from its UID, its sandbox and agent, and its gateway's network address, and they reach the compiled container unchanged. - The configuration rejects designs the contract rules out: environment reference objects, `secrets`, `agentConnection`, a connection descriptor, service `placement`, `imagePullPolicy`, files under `/run/nemoclaw`, and explicit nulls. The schema also rejects every one of them except the protected file path. - The configuration rejects a container service on an external, Podman, or Kubernetes gateway, while accepting each of those gateways without the service. - Through scripted OpenTofu, the test applies the service with arguments, files, limits, data, environment, readiness, and publication. Export returns the same document, which passes the generated schema, and an unchanged reapply produces no changes and keeps the intent. Export refuses when the container's binding is missing or its name changed. Docker containers are disposable, so export doesn't compare their specification; Docker reconciles drift on apply. - Type `command`, `readiness.path`, and `readiness.runtimeStatus` as omitted rather than null, following the existing `port` and `publication` fields. This regenerates the schema and configuration reference. An explicit `null` in these fields is now rejected. - Give onboarding text to `/spec/services/*/environment/*`, telling the user not to enter a credential there. - Fix two example test harnesses: the Fabric validity test lacked the `container_service` generation, and the export unit test assumed the first observation wasn't a disposable Docker object. This PR doesn't meet every criterion. It is part of #12567. Criteria left open: - "Selects ... its intended sandbox dependency" and "reject invalid references and cycles" conflict with the accepted contract, which has no sandbox dependency field; the application gets its sandbox and agent from literal environment values. This PR doesn't add a dependency field. Maintainers need to either drop these criteria from #12567 or reopen the contract decision. `Gateway.config` is also typed as nullable; this PR leaves it unchanged because it isn't part of the container service. ## Validation - Tests written first and seen failing: - `cargo ci` failed `nemoclaw-onboarding` `tui::tests::example_journeys::application_container` (asked for `readiness/path` as JSON, then found no description for the environment variables) and `nemoclaw-authoring` `deployment_journey::single_sandbox_examples_offer_existing_sdk_values_without_changing_them` (example count). - The SDK refusal test failed on `command: null` before the schema change. - With the new example, `reference_combinations::example_configurations_are_valid_fabric_configurations` and `deployment::export::tests::each_example_exports_its_applied_document_and_stops_on_drift` failed until their harnesses were fixed. - The other new tests passed at once: they cover existing behavior. - `cargo ci` on Linux arm64: tools, fmt, clippy, build, test, schema, bundle, and lifecycle passed. - `cargo run --locked -p nemoclaw-build -- fern check`: 0 errors, using Node 25.9.0 rather than the pinned 24.22.1. - Not run locally: `cargo ci live-docker`. Nothing that runs in images or containers changed; the example and the schema typing only change what configuration is accepted. `cargo ci` reported that no image inputs changed. --------- Signed-off-by: Carlos Villela <[email protected]>
<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. --> <!-- SPDX-License-Identifier: Apache-2.0 --> ## Failure #13093 added `kind: container` services and said it fixed #12568, but only compile tests, one state test, and the provider's `host_container_health` tests covered them. Nothing applied a container service through the SDK and the real Docker provider, so these #12568 criteria had no coverage: bounded readiness, unchanged reapply, failures and retries, replacement, and cleanup. ## Decision Add `container_service`, a Rust system test in `crates/nemoclaw-e2e/tests/integration/rust`. It deploys a managed Docker gateway, one agent, and three container services, one for each readiness mode: HTTP `path`, `runtimeStatus`, and Docker HEALTHCHECK. The tests run through the SDK, the bundle's OpenTofu, and the real Docker provider. The engine is a fake that keeps what the provider creates and reuses `test-support/docker_engine.rs` for the gateway's storage. The `tofu test` scenarios mock the Docker provider, so they can't show what it creates, replaces, or deletes, or the provider errors that `expect_failures` can't catch. The module runs on Unix only, like the other managed Docker gateway tests. No VoiceClaw image, real container, or credential is used. | Criterion | Test | Result | | --- | --- | --- | | Apply creates resources, waits for bounded readiness, and leaves no background process | `apply_waits_for_each_readiness_mode_then_exits_and_reapply_keeps_the_containers` | Each mode reports starting before ready, and apply waits for it. Each service gets one container and one data volume. After apply returns, the engine and health endpoint get no request for 3 s, longer than the provider's 2 s poll. | | Unchanged reapply keeps the healthy service | same test | An unchanged plan has no changes. Reapply checks readiness again but sends no engine mutation and doesn't touch the sandbox or the Fabric start. | | Unhealthy startup, unknown observations, and interrupted setup report actionable failures; retry doesn't duplicate | `unhealthy_or_unknown_readiness_fails_apply_and_retry_keeps_the_created_containers`, `readiness_that_never_arrives_times_out_within_its_bound_and_retry_completes`, `interrupted_setup_is_unfinished_and_retry_completes_without_duplicates` | Apply fails with the provider's reason: an unhealthy HEALTHCHECK, an undefined runtime status phase (its value isn't echoed), a missing HEALTHCHECK, or a timeout within the 8 s bound. A cancelled apply leaves the deployment unfinished. Each retry creates no second container or volume. The interruption test cancels during the web service's readiness wait, after the provider has created and recorded the container: only that service is deployed, and only its readiness check knows its health path. | | Configuration changes follow replacement semantics and ordering | `a_changed_application_is_replaced_alone_and_keeps_its_volume` | Changing one service's `environment` plans delete-then-create for that container only. The old container is deleted before the new one is created. The new container mounts the same data volume and readiness is checked again. The other containers and the agent don't change. | | Destroy removes owned resources and keeps external resources and retained data | `apply_refuses_removal_and_destroy_deletes_owned_applications_keeping_other_resources` | Destroy deletes every application container and its disposable volume. It keeps the gateway's retained storage and another owner's container, volume, and network. Applying the same document again over the retained storage succeeds. | All six tests passed on their first run against `v1` and found no product bug. They stay as regression coverage. The fake engine is not real Docker, so these tests don't establish Docker or VoiceClaw behavior. The #13093 description reports that retained-state recreation failed during gateway observation in a live run. With container services, destroy followed by apply over the retained gateway storage succeeds against these fixtures. That run doesn't reproduce the live failure, so it doesn't rule it out. An interrupt during the Docker provider's container create is different. The first version of the interruption test could cancel there, and darwin CI failed: the retry created a second web container. Locally, holding the fake engine's create response and cancelling during it reproduced the same result. OpenTofu stops the Docker provider, which abandons the create request. The engine had already created the container, so the provider never recorded it, and the retry created another. Real Docker would refuse the retry's create because the name is in use. The provider owns its create, so this is outside this PR. Cancelling during the readiness wait never duplicated a container in 36 local runs, 16 of them under CPU load. I didn't observe the darwin run's exact cancellation point. Part of #12568; depends on the declaration from #12567 (#13093). These criteria remain open: - **Destroy preserving the intended agent.** Destroy removes the whole deployment, including its agents. Apply refuses to remove a container service from the document with `apply cannot remove a managed runtime` and changes nothing. `runtime_bindings` in `crates/nemoclaw-sdk/src/deployment/runtime.rs` refuses any removed `docker_volume` binding, including the disposable `container_storage` volume. So no operation removes an application while keeping the agent. The test pins the current refusal. Maintainers need to decide whether apply should remove a container service whose only storage is disposable. I didn't change the policy. - **Interrupting the provider's container create.** An interrupt during the Docker provider's create leaves a container that neither state nor the retry knows, as described above. Per the upstream boundaries, that belongs to the Docker provider or needs a maintainer decision. - **Live qualification.** These tests use fixtures. A live Docker run of a container service isn't part of this PR. ## Validation - `NEMOCLAW_TEST_BUNDLE=$PWD/dist/linux_arm64 cargo test -p nemoclaw-e2e --test integration container_service:: -- --ignored`: 6 passed in 11.5 s. - `cargo ci` on Linux ARM64 (base `origin/v1`): fmt, Clippy, build, 1,812 unit tests, schema, bundle, and 102 lifecycle tests passed. The 6 `container_service` tests took 44.1 s summed, with the slowest at 11.4 s. - `cargo ci live-docker` didn't run. The change adds only fixture tests and contributor docs and doesn't change what runs in images. - CI runs the other platforms. Windows skips the module.
Pull request descriptions become squash commit messages, so the template now asks for a summary, then the problem and the change, plus an optional section for checks outside CI; the PR skill states the rules for the result. ## Problem Descriptions written from the template were often dense and hard to review. Some claimed more than their checks showed: #13093 said "Fixes #12567, #12568, #12570" with acceptance criteria still open. Most listed the commands their authors ran and the results, which CI reruns on the final commit anyway. Because `v1` squash-merges, all of that stays in the history as the commit message. ## Change - `.github/PULL_REQUEST_TEMPLATE.md`: an opening summary paragraph, then **Problem** and **Change**, replacing Failure and Decision, which fit bug fixes but not docs, refactors, or dependency changes. Problem asks for "Resolves #N" only when every acceptance criterion is met, and "Part of #N" with what is left otherwise. Change asks for rejected alternatives, what is left out, and, for a workaround, the upstream issue and when it can go. An optional **Beyond CI** section replaces Validation: checks CI doesn't run and what they showed, and what remains unverified. - `.agents/skills/nemoclaw-contributor-create-pr/SKILL.md`: points to WRITING.md for style and replaces the draft, rewrite, and compare pass with rules for the result. The first paragraph says what changes and for whom. Every claim rests on CI or a check under Beyond CI and is no stronger than it. Checks CI runs aren't listed, and local runs go to whoever asked for the change. Only what stays true after merge goes in the description. - `AGENTS.md`: the pull request line names the new sections and says the description becomes the commit message, and the line on reporting checks sends that report to whoever asked for the change. --------- Co-authored-by: Carlos Villela <[email protected]>
Outcome
Share one Docker container assembly across generic application containers and managed Ollama/vLLM services. Keep the typed model installers' hardware checks, memory safeguards, readiness, retained storage, authentication, and update policies.
Reason
An application image should not need a custom SDK installer to supply its arguments, configuration, resource limits, or readiness check. Ollama and vLLM already run as containers and can use the same assembly layer.
Related issues
Fixes #12567, #12568, #12570, and #13131. Protected credential-file delivery from #12569/#12619 remains deferred.
Changes
kind: containerwith image-owned arguments, literal environment values, nonsecret files, resource limits, a listener port, private publication, and HTTP, managed-status, or Docker health checks.serviceRef.container_servicein retained generation validation. A focused inline regression covers state save, reopen, and removal of a service whose generation remains retained.Verification
Commit under review:
6cb70c8319fdfb59d1d423f292b2311dc435edd8.deployment intent record is invalid.cargo ci --full: passed on macOS ARM64, including formatting, workspace Clippy, build, 1,484 unit tests, doctests, schema, bundle, and 147 lifecycle tests. The run kept the repository profiles, assertions, and timeouts.Qwen/Qwen3-4B, and displayed the binary-search answer. That run usedbf93570plus the production allowlist repair now included here; it did not run this final commit.Review notes
Self-review covers the shared assembly, typed installers, container readiness, state persistence, and plaintext-environment boundary. Independent maintainer review is outstanding. The PR is ready for human review.
The manual test establishes backend execution and display. The backend supplied speech text, but the operator heard no spoken result; result audio delivery/playback remains unqualified in companion VoiceClaw #162.
Pinned Fabric reports
fabric_health_unsupportedwhile its native runtime is running, so the VM's setup applies exited 1. Retained-state recreation also failed during gateway observation; setup used a fresh UID and state. Those lifecycle paths are unchanged from the recorded v1 base. Neither observation is reported as a successful readiness or recreation test.Signed-off-by: San Dang [email protected]