feat(nemo-agents): stage Fabric agent.yaml artifacts into Docker/K8s deployments - #1007
feat(nemo-agents): stage Fabric agent.yaml artifacts into Docker/K8s deployments#1007tylersbray wants to merge 1 commit into
Conversation
|
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 (7)
📝 WalkthroughWalkthroughFabric deployments now propagate agent and creator identifiers, stage and validate agent filesets, and support multi-file configuration materialization in Docker and Kubernetes. Staging failures return failed deployments without creating deployment entities. ChangesFabric deployment artifacts
Sequence Diagram(s)sequenceDiagram
participant Controller
participant DeploymentsRunnerBackend
participant FabricArtifactStaging
participant DeploymentRuntime
Controller->>DeploymentsRunnerBackend: Forward agent and creator identifiers
DeploymentsRunnerBackend->>FabricArtifactStaging: Stage Fabric fileset
FabricArtifactStaging-->>DeploymentsRunnerBackend: Return resolved ConfigFile list
DeploymentsRunnerBackend->>DeploymentRuntime: Configure Docker or Kubernetes files
DeploymentRuntime-->>DeploymentsRunnerBackend: Materialize files and start agent
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
plugins/nemo-agents/src/nemo_agents_plugin/runner/deployments_backend.py (1)
384-404: 🚀 Performance & Scalability | 🔵 TrivialMulti-file payload transported entirely via one env var.
All staged file contents are base64-encoded into a single JSON env var. Docker/OS environment-size limits could be hit for filesets with many or large skill/prompt files, causing container start failures that are hard to diagnose from the deployment status alone. Worth a sanity check on typical fileset sizes, or a size guard/clear error before this path is hit at scale.
🤖 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/runner/deployments_backend.py` around lines 384 - 404, The multi-file branch in the Docker backend can exceed environment-size limits by placing the entire staged fileset in one `_STAGED_CONFIG_FILES_ENV` variable. Add a preflight size check before appending that env var, using the serialized base64 payload size and an appropriate documented limit; raise a clear deployment error when exceeded, while preserving the existing materialization flow for payloads within the limit.
🤖 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/runner/deployments_backend.py`:
- Around line 247-256: Update _materialize_staged_config_files_and_exec to
invoke the staging inline script with python instead of python3, keeping the
existing exec {quoted_argv} behavior unchanged so Fabric Docker deployments
consistently use the available interpreter.
In
`@plugins/nemo-agents/src/nemo_agents_plugin/runner/fabric_artifact_staging.py`:
- Around line 96-102: Guard the file read in the staging loop around
path.read_text within the artifact staging function, handling UnicodeDecodeError
alongside the existing file-related exceptions. Convert it into a clear staging
error that identifies the unreadable file, while preserving the special
rewritten_agent_yaml path and normal UTF-8 content behavior.
- Around line 70-77: Ensure the fileset-missing fallback in the staging flow
still invokes _validate_referenced_skill_paths before returning the inline
agent.yaml configuration, so configured skills.paths entries fail deployment
immediately when unavailable. Add coverage in test_fabric_artifact_staging.py
for a missing fileset with skills.paths configured, asserting validation raises
or otherwise reports the missing skill rather than allowing staging to succeed.
---
Nitpick comments:
In `@plugins/nemo-agents/src/nemo_agents_plugin/runner/deployments_backend.py`:
- Around line 384-404: The multi-file branch in the Docker backend can exceed
environment-size limits by placing the entire staged fileset in one
`_STAGED_CONFIG_FILES_ENV` variable. Add a preflight size check before appending
that env var, using the serialized base64 payload size and an appropriate
documented limit; raise a clear deployment error when exceeded, while preserving
the existing materialization flow for payloads within the limit.
🪄 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: db4c4926-279e-40cf-9861-3dea1c445f9e
📒 Files selected for processing (7)
plugins/nemo-agents/src/nemo_agents_plugin/runner/backend.pyplugins/nemo-agents/src/nemo_agents_plugin/runner/controller.pyplugins/nemo-agents/src/nemo_agents_plugin/runner/deployments_backend.pyplugins/nemo-agents/src/nemo_agents_plugin/runner/fabric_artifact_staging.pyplugins/nemo-agents/src/nemo_agents_plugin/runner/in_memory.pyplugins/nemo-agents/tests/unit/test_fabric_artifact_staging.pyplugins/nemo-agents/tests/unit/test_runner_deployments.py
…deployments Download the agent-spec fileset at deploy time and materialize sibling files (skills, prompts, etc.) under /workspace so Fabric relative paths resolve in containers the same way they do locally. Closes AIRCORE-966. Signed-off-by: Tyler Bray <tbray@nvidia.com>
1d5cdc2 to
e982a03
Compare
|
Summary
{agent}-specfileset into multi-fileconfig_filesat Fabric Docker/K8s deploy time so relative paths (skills.paths, sibling prompt assets) resolve under/workspace.STAGED_CONFIG_FILES_B64_JSON; K8s continues to use ConfigMap multi-file mounts.agent.yamlwhen the fileset is missing; fail deploy early when referencedskills.pathsentries are absent after staging.Closes AIRCORE-966.
Test plan
uv run --frozen pytest plugins/nemo-agents/tests/unit/test_fabric_artifact_staging.py plugins/nemo-agents/tests/unit/test_runner_deployments.py -v(56 passed)uv run ruff check/uv run --frozen ty checkon runner packageSummary by CodeRabbit