docs(agents): add Deploy Agents guide and SDK deploy-mode parity#682
Conversation
|
🌿 Preview your docs: https://nvidia-preview-agent-deployment-docs.docs.buildwithfern.com/nemo-platform |
|
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)
📝 WalkthroughWalkthroughThe PR documents subprocess, Docker, and Kubernetes agent deployments, extends the SDK for deployment modes and images, updates writable container configuration paths, corrects Docker command mapping, adds packaging dependencies, and updates related tests and navigation. ChangesAgent deployment support
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
plugins/nemo-agents/src/nemo_agents_plugin/sdk.py (1)
217-244: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a test for the new
image/deployment_modevalidation.No test exercises the
ValueErrorpath (image+subprocess) or the payload shape for docker/k8s modes. This is new branching logic worth covering.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/nemo-agents/src/nemo_agents_plugin/sdk.py` around lines 217 - 244, Add tests for the deployment creation method covering both branches introduced by the image validation: assert that providing image with deployment_mode="subprocess" raises ValueError, and verify docker and k8s requests include the expected deployment_mode and image fields in the payload while preserving other deployment fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/agents/deploy-agents.mdx`:
- Around line 342-365: Update the Python SDK inspection example to handle both
deployment response shapes: use the plural endpoints field for container-mode
deployments and the singular endpoint field for subprocess deployments, avoiding
an unconditional deployment["endpoints"] access while preserving the displayed
deployment mode and status.
- Around line 244-246: Add a blank line between the closing </Tabs> tag and the
“Deploy on Kubernetes” heading. In the SDK deployment example, update the
deployment field access to support both endpoint and endpoints representations,
including subprocess deployments, instead of assuming deployment["endpoints"]
always exists.
---
Nitpick comments:
In `@plugins/nemo-agents/src/nemo_agents_plugin/sdk.py`:
- Around line 217-244: Add tests for the deployment creation method covering
both branches introduced by the image validation: assert that providing image
with deployment_mode="subprocess" raises ValueError, and verify docker and k8s
requests include the expected deployment_mode and image fields in the payload
while preserving other deployment fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f3d742ca-5dd7-4343-9e98-4f8f5beebff7
📒 Files selected for processing (4)
docs/agents/deploy-agents.mdxdocs/agents/index.mdxdocs/fern/versions/latest.ymlplugins/nemo-agents/src/nemo_agents_plugin/sdk.py
|
tylersbray
left a comment
There was a problem hiding this comment.
It makes more sense now, thanks.
Add docs/agents/deploy-agents.mdx covering subprocess, docker, and k8s deployment modes, invocation through the Agents gateway, model access, inspection, and cleanup. Wire it into the Agents nav and index. Add deployment_mode and image parameters to the agents SDK deployments.create() so the Python SDK reaches parity with the CLI for container-mode deployments, matching the examples in the new doc. Signed-off-by: Ben McCown <bmccown@nvidia.com>
Validating the Deploy Agents doc surfaced several bugs that broke docker (and k8s) container-mode deployments. Fix them so the documented workflow works end-to-end: - deployments docker backend: map a container spec's command -> docker entrypoint and args -> docker command, mirroring the k8s compiler. The previous code folded both into docker's command (CMD), leaving a packaged image's baked-in ENTRYPOINT in force so the platform-supplied startup command (which writes the resolved NAT config) was silently dropped. - agents deployments compiler: default config_mount_path to /workspace/config.yaml (under the image's writable WORKDIR) instead of /config/agent.yaml, which the non-root container user cannot create. k8s mounts it read-only via a ConfigMap subPath, so the path is agnostic there. /config was arbitrary and inconsistent with the image's own NAT_CONFIG_FILE convention. - calculator example: add nvidia-nat-langchain dependency so a packaged image actually contains the react_agent workflow and openai LLM it uses. Docs: add the deploy-agents container-mode prerequisites (project-mode packaging with --pyproject, the [container] extra, and gateway reachability from inside the container), fix the SDK snippets to the real client.agents API, and tighten the agents overview wording. Signed-off-by: Ben McCown <bmccown@nvidia.com>
'make vendor' regenerates packages/nemo_platform/pyproject.toml from [tool.bundle-package]. The calculator example gained nvidia-nat-langchain; sync the generated bundle so lint-sdk-vendored passes. Signed-off-by: Ben McCown <bmccown@nvidia.com>
c8f8c82 to
31fc6ee
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/agents/deploy-agents.mdx`:
- Around line 234-236: Update both SDK deployment examples in
docs/agents/deploy-agents.mdx at lines 234-236 and 291-293 to open the
documented workflow YAML path src/calculator_agent/calculator-agent.yml instead
of calculator-agent.yml; keep the deployment calls unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ee62891d-dbdc-4adc-973a-9f2f22147c5c
📒 Files selected for processing (10)
docs/agents/deploy-agents.mdxdocs/agents/index.mdxdocs/fern/versions/latest.ymlpackages/nemo_platform/pyproject.tomlplugins/nemo-agents/examples/calculator-agent/pyproject.tomlplugins/nemo-agents/src/nemo_agents_plugin/config.pyplugins/nemo-agents/src/nemo_agents_plugin/sdk.pyplugins/nemo-agents/tests/unit/test_runner_deployments.pyplugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/backend.pyplugins/nemo-deployments/tests/unit/backends/docker/test_backend_mocked.py
🚧 Files skipped from review as they are similar to previous changes (7)
- docs/fern/versions/latest.yml
- plugins/nemo-agents/src/nemo_agents_plugin/sdk.py
- plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/backend.py
- plugins/nemo-agents/tests/unit/test_runner_deployments.py
- plugins/nemo-deployments/tests/unit/backends/docker/test_backend_mocked.py
- docs/agents/index.mdx
- plugins/nemo-agents/src/nemo_agents_plugin/config.py
Address PR review feedback on deploy-agents.mdx: - Point the docker/k8s Python SDK examples at the documented workflow YAML path (src/calculator_agent/calculator-agent.yml), matching their CLI tabs and the Prerequisites project directory. - Add a blank line between </Tabs> and the Deploy on Kubernetes heading. Signed-off-by: Ben McCown <bmccown@nvidia.com>
|
@coderabbitai acknowledging the remaining nitpick from your review (SDK |
|
Tip For best results, initiate chat on the files or code changes.
|
The calculator example gained nvidia-nat-langchain (commit d2b0cb8) but uv.lock was not regenerated, leaving it out of sync with pyproject. This surfaced as lint-web-sdk failing (its tree-wide regen+diff reported a dirty uv.lock). Re-lock to sync. Signed-off-by: Ben McCown <bmccown@nvidia.com>
Add docs/agents/deploy-agents.mdx covering subprocess, docker, and k8s deployment modes, invocation through the Agents gateway, model access, inspection, and cleanup. Wire it into the Agents nav and index.
Add deployment_mode and image parameters to the agents SDK deployments.create() so the Python SDK reaches parity with the CLI for container-mode deployments, matching the examples in the new doc.
Summary by CodeRabbit
subprocess,docker, ork8smodes via the Agents gateway./workspace/config.yaml) and Docker mapping behavior.