Skip to content

WIP: harbor backend v2 - #272

Draft
mathewjhan wants to merge 27 commits into
mainfrom
feat/harbor-backend-v2
Draft

WIP: harbor backend v2#272
mathewjhan wants to merge 27 commits into
mainfrom
feat/harbor-backend-v2

Conversation

@mathewjhan

@mathewjhan mathewjhan commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What

Why

How to Test

Checklist

  • PR title follows [module] type: description format
  • Appropriate labels added (e.g. enhancement, bug, breaking)
  • ruff check . and ruff format --check . pass
  • pyright osmosis_ai/ passes
  • pytest passes (new tests added if applicable)
  • Public API changes are documented
  • No secrets or credentials included

Summary by cubic

Add HarborBackendV2 to run Harbor tasks with pure task images by installing a bundled workflow per trial or using native Harbor agents. Includes a small container I/O contract, diagnostics with secret redaction, artifact relocation, and an end‑to‑end benchmark.

  • New Features

    • HarborBackendV2: runs bundled workflows or native agents (terminus-2, mini-swe-agent, oracle); supports template/dataset modes and per‑phase timing with failure diagnostics; redacted diagnostics exposed via extra_fields on samples.
    • Bundling (osmosis_ai.packaging): builds a wheel from a pyproject.toml harness, injects agent/grader console scripts, caches by content hash in the user cache dir via platformdirs, and exposes inspect_bundle/project_dir_for.
    • Container contract/runner: ContainerInput/ContainerResult plus in‑container runner.agent_main/runner.grader_main; extracts messages from trajectories, writes reward files for Harbor, and adds AgentWorkflowOutput.
    • Task materialization: HarborTask + TaskMode copy per rollout, write instruction.md, patch Dockerfiles to install SDK deps into an isolated venv (/opt/osmosis/venv) bootstrapped with uv (fallback to pip), and generate tests/test.sh to install a grader when needed.
    • Native agent wiring: passes model endpoint via env/kwargs per agent; bundled workflows run from the venv.
    • HarborBackend: content‑addressed image tags to reuse builds; new exports in osmosis_ai.rollout.backend.harbor.__init__.
    • Extras: unit tests for packaging and backend; benchmarks/container_lifecycle to measure cold/warm throughput.
  • Migration

    • Use HarborBackendV2 with tasks_dir; choose a native agent by name or provide a workflow harness (code_dir or a prebuilt bundle).
    • Ensure the harness is a Python project with a pyproject.toml; the bundler creates <package>-agent/<package>-grade scripts automatically.
    • Bundles install into /opt/osmosis/venv; images only need Python. The agent installs uv if missing and then the bundle (falls back to pip). For dataset runs, set task_mode="dataset" and include harbor_task_id in request metadata.

Written for commit c52aa63. Summary will update on new commits.

Review in cubic

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.85938% with 113 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
osmosis_ai/rollout/container/runner.py 0.00% 89 Missing ⚠️
osmosis_ai/packaging.py 88.98% 6 Missing and 7 partials ⚠️
osmosis_ai/rollout/container/trajectories.py 30.76% 9 Missing ⚠️
osmosis_ai/rollout/container/files.py 94.44% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant