test(e2e): run agent container-deploy e2e on kubernetes (kind) too#738
Merged
Conversation
The docker-mode agent deployment e2e (test_nemo_agents_docker.py) proved the container-mode chain (gateway -> agent container -> IGW -> mock provider) only for the Docker backend. Add the Kubernetes equivalent so the same chain is exercised on the kind CPU e2e CI job. - Extract the backend-agnostic core (mock-backed agent config, deploy -> wait running -> assert container-mode endpoint shape -> invoke -> assert -> cleanup) into e2e/agents_deploy_helpers.py, shared by both modules. A reap_backend_resources hook lets a backend reap leaked resources (docker container) during teardown. - Refactor test_nemo_agents_docker.py to call the shared core; behavior and markers (subprocess_only, needs_nmp_api_image, Linux-only) are unchanged. - Add test_nemo_agents_k8s.py: deployment_mode=k8s, marked container_only (runs only against an external cluster, i.e. the kind e2e job) + needs_nmp_api_image. A single dual-marked function isn't viable — the markers are mutually exclusive and the platform source / networking differ — so it's a thin wrapper over the shared core. - Wire a nemo-deployments k8s executor into the kind Helm values (e2e/k8s/values/kind.yaml); the nmp-core controller Role already grants the needed deployments/services/configmaps/pods permissions. default_namespace is the release namespace so the agent lands beside the platform and the injected in-cluster IGW URL is reachable. - Export NMP_E2E_IMAGE_REGISTRY/NMP_E2E_IMAGE_TAG in the kind-cpu-e2e job so the k8s test can compose the (node-pre-pulled) nmp-api image ref. Signed-off-by: Ben McCown <bmccown@nvidia.com>
Contributor
|
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesContainer Agent E2E
Sequence Diagram(s)sequenceDiagram
participant E2ETest
participant SharedHelper
participant NeMoPlatform
participant AgentDeployment
participant AgentsGateway
participant MockProvider
E2ETest->>SharedHelper: deploy and invoke with mode and image
SharedHelper->>NeMoPlatform: create mock provider and agent
SharedHelper->>AgentDeployment: create container deployment
AgentDeployment-->>SharedHelper: running deployment and endpoint
SharedHelper->>AgentsGateway: invoke deployed agent
AgentsGateway->>MockProvider: request mocked completion
MockProvider-->>AgentsGateway: return TEST_AGENT_RESPONSE
AgentsGateway-->>SharedHelper: return completion response
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…pace The k8s deployments executor hardcoded default_namespace to "default" and had no way to self-locate, so the e2e kind values had to hardcode the release namespace (nemo-platform) — brittle and wrong if the namespace differs. Make default_namespace optional and resolve an effective namespace with precedence: explicit config value > POD_NAMESPACE (the controller pod's own namespace, injected via the downward API in the core controller deployment) > "default". A deployed platform can now omit the setting and agents land in its own namespace; an operator can still pin one, and per-deployment backend_config.k8s.namespace continues to override. Drop the hardcoded default_namespace from e2e/k8s/values/kind.yaml accordingly. Add unit tests covering the precedence (explicit wins, POD_NAMESPACE fallback, default fallback, blank POD_NAMESPACE treated as unset). Signed-off-by: Ben McCown <bmccown@nvidia.com>
mckornfield
approved these changes
Jul 16, 2026
Signed-off-by: Ben McCown <bmccown@nvidia.com>
benmccown
enabled auto-merge
July 17, 2026 16:38
svvarom
approved these changes
Jul 17, 2026
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.
Extends the docker-mode agent deployment e2e to also run on the kind (Kubernetes) CI job, proving the container-mode chain (gateway → agent container → Inference Gateway → mock provider → response) on the k8s deployments backend.
What
e2e/agents_deploy_helpers.py(mock-backed agent config, deploy → wait running → assert container-mode endpoint shape → invoke → assert mocked round-trip → cleanup). Areap_backend_resourceshook lets a backend reap leaked resources (docker container) during teardown.test_nemo_agents_docker.py) refactored to call the shared core. Behavior and markers (subprocess_only,needs_nmp_api_image, Linux-only) unchanged.test_nemo_agents_k8s.py):deployment_mode="k8s", markedcontainer_only(runs only against an external cluster — the kind e2e job) +needs_nmp_api_image.e2e/k8s/values/kind.yaml): wire a nemo-deploymentsk8sexecutor. Thenmp-corecontroller Role already grants the needed deployments/services/configmaps/pods permissions;default_namespaceis the release namespace so the agent lands beside the platform and the injected in-cluster IGW URL is reachable.kind-cpu-e2e): exportNMP_E2E_IMAGE_REGISTRY/NMP_E2E_IMAGE_TAGso the k8s test composes the (node-pre-pulled)nmp-apiimage ref.Why not one dual-marked test function
The docker and k8s variants have mutually-exclusive markers (
subprocess_onlyvscontainer_only) and different platform sources (self-driven subprocess platform + docker executor vs external Helm cluster) and networking (docker-bridge base_url juggling vs in-cluster DNS). So they are two thin wrappers over one shared core rather than one function with two markers.Validation
NMP_BASE_URL("requires NMP_BASE_URL"), docker skips on non-Linux; ruff/ty/pre-commit clean.helm templatewithkind.yamlrenders the expectedagents.deployments+deployments.executors[k8s]config into the platform ConfigMap.Kind CPU e2eCI job on this PR.Summary by CodeRabbit
New Features
Tests
Bug Fixes