← Back to Pull requests

feat(rollout): submit harbor run jobs to a Rollout Server #2

Closed
unknown closed this pull request without merging on Aug 17, 2026 03:50 UTC
View on GitHub
unknown unknown commented on Aug 16, 2026 11:14 UTC
Author

Summary

harbor run can now execute complete trials remotely on a kube-rl Rollout Server instead of locally. Passing --rollout-server <url> keeps the entire job experience intact — CLI, job directory layout, metrics, pass@k, result tables, resume, and harbor view — while the environment, agent, and verifier execute on the server's Kubernetes workers. No local Docker, sandbox credentials, or agent dependencies are required on the submitting machine.

What it does

With --rollout-server set, each trial:

1. Resolves its task directory locally (registry/git tasks downloaded as usual) and archives it as task.tar.gz.
2. Submits the archive plus the resolved run configuration (agent name/import path, model, kwargs + env, verifier settings, timeout multiplier, quota queue) to the server's POST /api/v1/runs/async endpoint.
3. Polls the run's status to a terminal state.
4. Fetches the server-recorded full TrialResult (rewards, timings, step results) and materializes it into the local trial directory, patched with local identity fields — so every downstream consumer keeps working unchanged.

A rollout.json marker next to config.json records the server-side run_id, status, and result URI.

Usage

harbor run --path ./my-task -a <agent> -m <model> \
  --rollout-server http://rollout.example.com:8080 \
  --rollout-token "$ROLLOUT_SERVER_TOKEN" \
  --rollout-queue default

| Flag | Purpose |
|---|---|
| --rollout-server <url> | Enable remote execution |
| --rollout-token <t> | Bearer token (falls back to ROLLOUT_SERVER_TOKEN) |
| --rollout-queue <q> | Spark-style quota queue with its own concurrency/rate limits |
| --rollout-llm-proxy <url> | LLM proxy for RL token/logprob capture |
| --rollout-retries <n> | Server-side retries per trial (defaults to --max-retries) |
| --rollout-detach | Submit all trials and exit; re-run to collect |
| --rollout-fetch-artifacts | Download reward/trajectory files after completion |

The same settings are supported in job config files via a rollout_server: section. A tutorial chapter is added at docs/content/docs/tutorials/rollout-server.mdx.

Resume & detach semantics

  • Interrupted runs (Ctrl-C, crash): the trial directory keeps rollout.json without result.json; re-running the job re-attaches to the same server-side run_id instead of resubmitting.

  • --rollout-detach: fire-and-forget submission; collecting later requires no extra flags.

  • Retry layering: submission failures (network / HTTP 429 queue-full / 5xx) retry locally with exponential backoff inside a per-trial budget; business failures retry server-side only (max_retries). The local queue never re-runs a remote trial, so the layers cannot multiply.

  • Credentials: the token is excluded from the job directory, the job lock, and --print-config output.
  • Implementation notes

  • RolloutServerConfig on JobConfig (+ matching RolloutServerLock in the job lock). Behavior knobs (detach / fetch / polling) are excluded from replay equality so a detached submission can be collected by a later run without the flag; replay inputs (server / queue) still break equality as expected. install_only and regrade jobs are rejected in this mode.

  • harbor/rollout/client.py — async HTTP client for the server's public API: preflight (health + GET /api/v1/capabilities/agents validation), submission, status polling, result fetch, with error classification (retryable vs permanent) driving backoff.

  • harbor/trial/remote.py — RemoteTrial: TrialConfig → AgentRunRequest mapping (agent env ${VAR} templates resolved locally and forwarded via extra_env), tar packaging, terminal-status-driven result materialization with local identity patching, rollout.json marker lifecycle.

  • TrialQueue accepts an injectable trial_factory (local execution path untouched); Job wires it, zeroes local retries in rollout mode, and preserves marker directories across resume.
  • Validation

  • 29 new unit tests: config/lock models (incl. credential exclusion from equality), request mapping (env resolution, empty-field elision), HTTP client error classification via mocked transport, and the full RemoteTrial lifecycle (completion materialization, detach leaves no result.json, resume re-attaches without resubmitting, failure recording, submission rejection).

  • Full models + cli suites pass: 472 tests.

  • End-to-end against a real Rollout Server on ACK: task submission → quota admission → sandbox claim → nop agent → verifier → reward=1.0 materialized locally (~8s wall clock); detach → collect and resume paths verified on the live server.
  • Compatibility notes

  • Multi-step tasks, verifiers, rewards, and token accounting work unchanged (the server runs the same Harbor trial machinery).

  • Custom agents via --agent-import-path must be importable inside the server's worker image.

  • Runnable images depend on the server's backends: E2B sandbox-pool deployments require the task's docker_image to match the pool template; ACK-backed deployments build arbitrary task Dockerfiles in-cluster (GET /api/v1/capabilities/environments reports what a given server accepts).
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: KunWuLuan Review duration: 996m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository