Skip to content

fix(evaluator): guard HarborRunner submissions to be subprocess only - #1062

Merged
ngoncharenko merged 2 commits into
mainfrom
ngoncharenko/aalgo-343-k8s-harbor-guard
Aug 6, 2026
Merged

fix(evaluator): guard HarborRunner submissions to be subprocess only#1062
ngoncharenko merged 2 commits into
mainfrom
ngoncharenko/aalgo-343-k8s-harbor-guard

Conversation

@ngoncharenko

@ngoncharenko ngoncharenko commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Remote Harbor submissions now resolve the selected Jobs execution profile before scheduling. Supported profiles get an explicit subprocess executor; Docker, Kubernetes, and missing subprocess profiles fail with HTTP 422 before a job record is created.

Previously, the guard checked Jobs' merged profile list while executor translation only considered explicitly configured profiles. A default Docker runtime could therefore pass the guard and still run Harbor on Docker. Local Harbor and non-Harbor paths are unchanged.

Tracked by AALGO-343 and AALGO-474.

Review focus

  • plugins/nemo-evaluator/src/nemo_evaluator/jobs/agent_evaluate.py — profile resolution, explicit subprocess routing, and backend rejection
  • plugins/nemo-evaluator/tests/test_agent_evaluate.py — supported/unsupported profile coverage and dependency failure handling
  • plugins/nemo-evaluator/tests/integration/test_agent_evaluate_job.py — Docker-backed rejection and the no-job-record assertion
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/api_factory.py and exceptions.py — HTTP 422 mapping for profile lookup failures

Validation

  • evaluator unit tests — 50 passed
  • platform compiler tests — 5 passed
  • Docker rejection integration and local Harbor smoke — passed
  • scoped Ruff, format, ty, and diff checks — passed

Summary by CodeRabbit

  • New Features

    • Harbor-backed evaluation jobs now resolve execution profiles through the Jobs service.
    • Supported Harbor profiles can run through configured subprocess commands.
  • Bug Fixes

    • Invalid Harbor backends, missing profiles, and empty commands now return clearer HTTP 422 errors.
    • Temporary dependency outages now return retryable HTTP 503 responses with service details.
    • Harbor targets are correctly rejected when the Docker backend does not support them.
  • Documentation

    • Updated Harbor runner prerequisites and subprocess executor setup guidance.

@github-actions github-actions Bot added the fix label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 30785/39281 78.4% 62.8%
Integration Tests 18077/37233 48.5% 21.1%

@ngoncharenko
ngoncharenko force-pushed the ngoncharenko/aalgo-343-k8s-harbor-guard branch 2 times, most recently from e0cc663 to 8526e5f Compare August 5, 2026 00:33
@ngoncharenko
ngoncharenko marked this pull request as ready for review August 5, 2026 00:33
@ngoncharenko
ngoncharenko requested review from a team as code owners August 5, 2026 00:33
@ngoncharenko ngoncharenko self-assigned this Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Harbor agent-evaluation compilation now resolves execution profiles through the Jobs service, routes supported subprocess profiles, rejects incompatible profiles, and reports temporary dependency outages as HTTP 503 responses. Unit and integration tests cover these paths.

Changes

Harbor compilation and dependency errors

Layer / File(s) Summary
Dependency error contract and API mapping
packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/exceptions.py, packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/api_factory.py, packages/nmp_common/tests/api_factory/test_api_factory.py
Adds PlatformJobDependencyUnavailableError and maps it to HTTP 503 with service context and retry guidance.
Harbor profile resolution
plugins/nemo-evaluator/src/nemo_evaluator/jobs/agent_evaluate.py, packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/execution_profiles.py
Resolves Harbor execution profiles, converts supported subprocess profiles into commands, and rejects missing, incompatible, or unavailable profiles.
Harbor validation and integration coverage
plugins/nemo-evaluator/tests/test_agent_evaluate.py, plugins/nemo-evaluator/tests/integration/conftest.py, plugins/nemo-evaluator/tests/integration/test_agent_evaluate_job.py, docs/evaluator/agent-eval/harbor-runner.mdx
Tests profile resolution, error handling, non-Harbor behavior, Docker configuration, and failed Harbor submissions. Documents Harbor and Docker prerequisites.

Sequence Diagram(s)

sequenceDiagram
  participant AgentEvalJob
  participant JobsClient
  participant ExecutionProfile
  AgentEvalJob->>JobsClient: Retrieve Harbor execution profile
  JobsClient-->>AgentEvalJob: Return execution profile
  AgentEvalJob->>ExecutionProfile: Validate backend and commands
  ExecutionProfile-->>AgentEvalJob: Provide subprocess command
Loading

Possibly related PRs

Suggested reviewers: sandychapman, gabwow

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the evaluator change that restricts HarborRunner submissions to the subprocess executor.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch ngoncharenko/aalgo-343-k8s-harbor-guard
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ngoncharenko/aalgo-343-k8s-harbor-guard

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_platform_plugin/src/nemo_platform_plugin/jobs/api_factory.py`:
- Around line 692-696: Update the PlatformJobDependencyUnavailableError handler
in
packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/api_factory.py:692-696
to raise status.HTTP_503_SERVICE_UNAVAILABLE, and document HTTPException(503) at
packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/api_factory.py:672-673.
Rename the related test and assert status code 503 in
packages/nmp_common/tests/api_factory/test_api_factory.py:1748-1773.
🪄 Autofix

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: b4446be3-474b-47a3-8126-c3679b4dac19

📥 Commits

Reviewing files that changed from the base of the PR and between a6904bd and 8526e5f.

📒 Files selected for processing (7)
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/api_factory.py
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/exceptions.py
  • packages/nmp_common/tests/api_factory/test_api_factory.py
  • plugins/nemo-evaluator/src/nemo_evaluator/jobs/agent_evaluate.py
  • plugins/nemo-evaluator/tests/integration/conftest.py
  • plugins/nemo-evaluator/tests/integration/test_agent_evaluate_job.py
  • plugins/nemo-evaluator/tests/test_agent_evaluate.py

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/evaluator/agent-eval/harbor-runner.mdx`:
- Around line 25-27: Update the Harbor runner documentation to scope the
subprocess executor requirement exclusively to Evaluator plugin submissions
using `nemo evaluator agent-evaluate submit`. Clarify that standalone SDK runs
through `run_harbor_eval()` and `HarborAgentTaskRunner` do not require
`NMP_JOBS_ENABLE_SUBPROCESS_EXECUTOR` or a NeMo Platform restart.
🪄 Autofix

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: e8860f33-1bd4-415e-89c0-f23f8f155a32

📥 Commits

Reviewing files that changed from the base of the PR and between 8526e5f and 13d5ad9.

📒 Files selected for processing (1)
  • docs/evaluator/agent-eval/harbor-runner.mdx

Comment thread docs/evaluator/agent-eval/harbor-runner.mdx Outdated
@ngoncharenko ngoncharenko changed the title fix(evaluator): guard Harbor backend submissions fix(evaluator): guard HarborRunner submissions to be subprocess only Aug 5, 2026
Comment thread plugins/nemo-evaluator/src/nemo_evaluator/jobs/agent_evaluate.py Outdated
Comment thread plugins/nemo-evaluator/src/nemo_evaluator/jobs/agent_evaluate.py Outdated
@ngoncharenko
ngoncharenko force-pushed the ngoncharenko/aalgo-343-k8s-harbor-guard branch from 9df81ef to 4eb9f9d Compare August 5, 2026 22:35
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Signed-off-by: Nick Goncharenko <ngoncharenko@nvidia.com>
@ngoncharenko
ngoncharenko force-pushed the ngoncharenko/aalgo-343-k8s-harbor-guard branch from 7b362c5 to d8804c6 Compare August 6, 2026 00:16
Signed-off-by: Nick Goncharenko <ngoncharenko@nvidia.com>
@ngoncharenko
ngoncharenko added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit f2d5603 Aug 6, 2026
54 checks passed
@ngoncharenko
ngoncharenko deleted the ngoncharenko/aalgo-343-k8s-harbor-guard branch August 6, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants