feat(evaluator-sdk): add Docker Compose sandbox provider (AALGO-330)#777
feat(evaluator-sdk): add Docker Compose sandbox provider (AALGO-330)#777ngoncharenko wants to merge 3 commits into
Conversation
Signed-off-by: Nick Goncharenko <ngoncharenko@nvidia.com>
Signed-off-by: Nick Goncharenko <ngoncharenko@nvidia.com>
21b3909 to
9f0a288
Compare
|
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 ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a Docker Compose-backed sandbox provider with exclusive project locking, topology and readiness validation, command and file-transfer APIs, status inspection, cancellation-safe cleanup, secret redaction, and hermetic/live integration tests. ChangesCompose sandbox runtime
Sequence Diagram(s)sequenceDiagram
participant Client
participant DockerComposeSandboxProvider
participant DockerCompose
participant SandboxServices
Client->>DockerComposeSandboxProvider: create(spec)
DockerComposeSandboxProvider->>DockerCompose: config and preflight
DockerCompose->>SandboxServices: inspect topology and ports
DockerComposeSandboxProvider->>DockerCompose: compose up --wait
DockerCompose->>SandboxServices: start project
SandboxServices-->>DockerComposeSandboxProvider: readiness state
DockerComposeSandboxProvider-->>Client: SandboxHandle
Client->>DockerComposeSandboxProvider: exec or transfer
DockerComposeSandboxProvider->>DockerCompose: service command or cp
DockerCompose->>SandboxServices: execute operation
SandboxServices-->>Client: result
Client->>DockerComposeSandboxProvider: close(handle)
DockerComposeSandboxProvider->>DockerCompose: compose down
DockerCompose->>SandboxServices: remove project resources
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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
`@packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval/runtimes/sandbox/providers/compose.py`:
- Around line 1755-1771: Update _published_port_available to set SO_REUSEADDR on
the probe socket when using SOCK_STREAM, before bind; leave UDP probing
unchanged and preserve detection of ports held by active listeners.
🪄 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: 06fa71a1-6077-4f52-ba0e-43d6b53e4514
⛔ Files ignored due to path filters (1)
sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/agent_eval/runtimes/sandbox/providers/compose.pyis excluded by!sdk/**
📒 Files selected for processing (4)
packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval/runtimes/sandbox/README.mdpackages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval/runtimes/sandbox/providers/compose.pypackages/nemo_evaluator_sdk/tests/agent_eval/test_sandbox_compose_provider.pypackages/nemo_evaluator_sdk/tests/agent_eval/test_sandbox_compose_provider_live.py
|
Signed-off-by: Nick Goncharenko <ngoncharenko@nvidia.com>
There was a problem hiding this comment.
This file is a bit large. It might be helpful if decomposed into smaller modules for clarity?
Summary
Adds a reusable Docker Compose sandbox provider to the evaluator SDK and its generated
nemo-platformmirror. The provider owns one caller-described Compose project and exposes the existing sandbox protocol without moving other app-specific policy into the SDK.What changed
DockerComposeSandboxProviderwith ordered Compose files, profiles, explicit project names/directories, exact long-running and one-shot service topology, and image-first startup (build=Falseby default).compose up --waitreadiness, lifecycle status, diagnostics, teardown hooks, retryingcompose down, optional volume removal, and residual Docker-resource verification.UID:GID, and repair ownership so non-root services can modify transferred files./, validated every scaled service replica, and wrapped lock filesystem failures inSandboxCreateError.make vendor.Why
Other app need a containerized local topology, while the evaluator SDK should own only reusable sandbox mechanics. This keeps the ownership boundary explicit: callers supply Compose topology, build policy, port hints, and optional teardown policy; the SDK supplies lifecycle, transfer, isolation and ownership, diagnostics, and cleanup mechanics.
Root causes addressed
/, while in-containermkdirandchownresolve from the imageWORKDIR.SandboxCreateErrorboundary.Impact
Validation
54 passed— focused Compose provider tests3 passed— live Docker Compose tests266 passed, 2 skipped— fullpackages/nemo_evaluator_sdk/tests/agent_evalsuitety checkmake vendorgit diff --check 8f7743d4bba4e3e065bf18ebad7609e42d64ac98Tracking
AALGO-330
Summary by CodeRabbit
New Features
build=Falseby default (requires explicit source-build intent) and fails early on unsupported/platform-mismatch scenarios.Tests
Documentation