feat(nemo-agents): one shot local invocation support for fabric backed agents - #838
Conversation
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe APIs, CLI, Fabric invocation helper, and in-memory runner now support ChangesFabric agent support
Runtime metadata updates
Sequence Diagram(s)sequenceDiagram
participant CLI
participant invoke_agent_config_once
participant run_fabric_agent_once
CLI->>invoke_agent_config_once: submit config and inputs
invoke_agent_config_once->>run_fabric_agent_once: invoke once per input
run_fabric_agent_once-->>invoke_agent_config_once: return runtime results
invoke_agent_config_once-->>CLI: print ordered results
sequenceDiagram
participant DeploymentsAPI
participant InMemoryRunnerBackend
participant AgentDeploymentController
DeploymentsAPI->>InMemoryRunnerBackend: create deployment
InMemoryRunnerBackend->>InMemoryRunnerBackend: validate and prepare Fabric config
InMemoryRunnerBackend-->>AgentDeploymentController: return running DeploymentInfo
AgentDeploymentController->>AgentDeploymentController: persist backend status
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@plugins/nemo-agents/src/nemo_agents_plugin/cli.py`:
- Around line 1276-1279: Update the result-processing loop in the CLI command so
it emits every item from results before deciding the exit status. Track whether
any result has a non-"succeeded" status during iteration, then raise
typer.Exit(code=1) only after the loop completes when a failure was observed.
In `@plugins/nemo-agents/src/nemo_agents_plugin/runner/in_memory.py`:
- Around line 241-267: Update _create_fabric_deployment to remove the created
base_dir when validate_platform_agent_config raises, and update
delete_deployment to remove the directory referenced by info.extra["base_dir"].
In plugins/nemo-agents/tests/unit/test_runner_in_memory.py lines 222-241, extend
test_delete_deployment_removes_prepared_fabric_deployment to assert base_dir is
absent after deletion, and add coverage verifying validation failures clean up
the directory.
🪄 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: 51efa317-c9b4-4683-9d19-d08d945697b1
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (19)
packages/nemo_platform/pyproject.tomlplugins/nemo-agents/pyproject.tomlplugins/nemo-agents/src/nemo_agents_plugin/api/v2/agents.pyplugins/nemo-agents/src/nemo_agents_plugin/api/v2/deployments.pyplugins/nemo-agents/src/nemo_agents_plugin/cli.pyplugins/nemo-agents/src/nemo_agents_plugin/fabric/invocation.pyplugins/nemo-agents/src/nemo_agents_plugin/runner/controller.pyplugins/nemo-agents/src/nemo_agents_plugin/runner/in_memory.pyplugins/nemo-agents/tests/unit/test_agents_api.pyplugins/nemo-agents/tests/unit/test_cli.pyplugins/nemo-agents/tests/unit/test_controller.pyplugins/nemo-agents/tests/unit/test_deployments_api.pyplugins/nemo-agents/tests/unit/test_fabric_invocation.pyplugins/nemo-agents/tests/unit/test_fabric_runtime.pyplugins/nemo-agents/tests/unit/test_runner_controller.pyplugins/nemo-agents/tests/unit/test_runner_in_memory.pythird_party/licenses.jsonlthird_party/osv-licenses.jsonthird_party/requirements-main.txt
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
third_party/osv-licenses.json (3)
4735-4739: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winPinned
setuptools==82.0.1affected by GHSA-h35f-9h28-mq5c (sdist MANIFEST.in exclusion bypass).Fixed in 83.0.0. Bump upstream and regenerate.
🤖 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 `@third_party/osv-licenses.json` around lines 4735 - 4739, Update the pinned setuptools dependency from 82.0.1 to 83.0.0 in the affected license data and regenerate the upstream OSV licenses artifact so the generated metadata reflects the fixed version.
919-922: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy liftRefreshed scan flags three pinned deps on vulnerable versions. Shared root cause: each package is pinned below its fixed release; remediate at the source manifest/lockfile and regenerate this artifact.
third_party/osv-licenses.json#L919-L922: bumpgitpython3.1.50 → ≥3.1.53 (four HIGH RCE/exfil advisories).third_party/osv-licenses.json#L3824-L3828: bumppyasn10.6.3 → ≥0.6.4 (two HIGH DoS).third_party/osv-licenses.json#L4735-L4739: bumpsetuptools82.0.1 → ≥83.0.0 (sdist exclusion bypass).🤖 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 `@third_party/osv-licenses.json` around lines 919 - 922, Update the source dependency manifest/lockfile to use gitpython at least 3.1.53, pyasn1 at least 0.6.4, and setuptools at least 83.0.0, then regenerate third_party/osv-licenses.json at lines 919-922, 3824-3828, and 4735-4739; all three artifact sites require refreshed versions matching the source updates.
3824-3828: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winPinned
pyasn1==0.6.3affected by two HIGH DoS advisories.GHSA-8ppf-4f7h-5ppj and GHSA-hm4w-wwcw-mr6r (quadratic OID decode / unbounded REAL conversion) both fixed in 0.6.4. Bump the pin upstream and regenerate.
🤖 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 `@third_party/osv-licenses.json` around lines 3824 - 3828, Update the upstream dependency pin for pyasn1 from 0.6.3 to 0.6.4, then regenerate third_party/osv-licenses.json so its package metadata reflects the updated version.
🤖 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.
Outside diff comments:
In `@third_party/osv-licenses.json`:
- Around line 4735-4739: Update the pinned setuptools dependency from 82.0.1 to
83.0.0 in the affected license data and regenerate the upstream OSV licenses
artifact so the generated metadata reflects the fixed version.
- Around line 919-922: Update the source dependency manifest/lockfile to use
gitpython at least 3.1.53, pyasn1 at least 0.6.4, and setuptools at least
83.0.0, then regenerate third_party/osv-licenses.json at lines 919-922,
3824-3828, and 4735-4739; all three artifact sites require refreshed versions
matching the source updates.
- Around line 3824-3828: Update the upstream dependency pin for pyasn1 from
0.6.3 to 0.6.4, then regenerate third_party/osv-licenses.json so its package
metadata reflects the updated version.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 434abac4-195c-452a-bb4c-14d53a0495b0
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
plugins/nemo-agents/openapi/openapi.yamlthird_party/osv-licenses.jsonthird_party/requirements-main.txt
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
plugins/nemo-agents/src/nemo_agents_plugin/cli.py (1)
208-208: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep NAT-only commands explicit.
runandpackagestill have NAT-specific behavior, but these help strings imply support for all agent formats, includingnemo-agents-spec-v1. Restore NAT-specific wording or add the corresponding execution path.
plugins/nemo-agents/src/nemo_agents_plugin/cli.py#L208-L208: restore NAT-specific help forrun.plugins/nemo-agents/src/nemo_agents_plugin/cli.py#L261-L261: restore NAT-specific help forpackage.🤖 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/cli.py` at line 208, Restore NAT-specific wording in the help strings for the run and package CLI commands, rather than implying support for all agent formats. Update both plugins/nemo-agents/src/nemo_agents_plugin/cli.py lines 208-208 and 261-261, covering the command definitions associated with run and package; no execution-path changes are needed.
🤖 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.
Outside diff comments:
In `@plugins/nemo-agents/src/nemo_agents_plugin/cli.py`:
- Line 208: Restore NAT-specific wording in the help strings for the run and
package CLI commands, rather than implying support for all agent formats. Update
both plugins/nemo-agents/src/nemo_agents_plugin/cli.py lines 208-208 and
261-261, covering the command definitions associated with run and package; no
execution-path changes are needed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ffc299ec-5330-4c99-91d5-344a51a76d5b
📒 Files selected for processing (4)
plugins/nemo-agents/src/nemo_agents_plugin/cli.pyplugins/nemo-agents/src/nemo_agents_plugin/runner/in_memory.pyplugins/nemo-agents/tests/unit/test_cli.pyplugins/nemo-agents/tests/unit/test_runner_in_memory.py
🚧 Files skipped from review as they are similar to previous changes (2)
- plugins/nemo-agents/src/nemo_agents_plugin/runner/in_memory.py
- plugins/nemo-agents/tests/unit/test_runner_in_memory.py
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
…d agents (#838) * adding fabric[runtime] dep Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * adding cli/api support for new agent config formats Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * adding deploy support and tests for fabric configs Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * add one-shot fabric invocation for agent configs Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * scope creep Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * add workspace creation Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * undo fabric-runtime dep Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * lint Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * nits Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * fix e2e test Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * update wording Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * e2e test patch Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> * addressing feedback Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> --------- Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com> Signed-off-by: Sam Oluwalana <soluwalana@nvidia.com>
Summary
This PR adds the first usable Platform flow for Fabric-backed NeMo Agents across AIRCORE-899, AIRCORE-900, and AIRCORE-901.
The main flow is:
The Platform still owns the persisted
nemo-agents-spec-v1config shape. Fabric remains the execution layer used after the plugin translates the Platform-owned config into a typed in-memoryFabricConfig.Changes
nemo agents create --agent-config ...support fornemo-agents-spec-v1.AgentConfig -> FabricConfig -> Fabric plan/doctor.nemo agents invoke --agent-config ....Scope Notes
Fabric-backed deploy does not start or retain a durable runtime in this PR. For this milestone, deploy means the Platform config can be translated and validated through Fabric planning/preflight.
nemo agents invoke --agent <registered-agent-name>is also out of scope for Fabric-backed agents in this PR. That path still relies on a deployed server/chat-completions endpoint. Follow-up work will define the remote runtime/session model where a Platform connection maps to a Fabric runtime.Out Of Scope
nemo agents invoke --agent ....Manual Validation
Platform setup and create:
Local macOS Fabric runtime setup used for smoke validation:
# macOS only, until Fabric runtime macOS wheels exist. uv pip install -e /Users/mmogallapall/workspace/NeMo-Fabric/pythonFabric runtime is not included in the default Platform image yet because the current alpha runtime wheels target
manylinux_2_39, while the Platform Docker base ismanylinux_2_36. Runtime dependency/image wiring is deferred until Fabric publishes a compatible wheel or Platform updates its base image.Hermes harness setup used by the example config:
Local one-shot invocation:
nemo agents invoke \ --agent-config plugins/nemo-agents/examples/nemo-agent-config/agent.yaml \ --input "Say hello in one sentence."Result: succeeded. The command returned a normalized Platform result with
response, artifacts, events, metadata,runtime_id,invocation_id, andrequest_id.Automated Validation
Passed:
Also previously passed focused unit coverage for Fabric runtime, Fabric invocation, CLI, runner, controller, deployments API, and runner in-memory behavior.
Summary by CodeRabbit