Skip to content

Harbor

Runta integrates with harbor and serve as Harbor environment provider. Harbor still owns the job, task, agent, verifier, and artifact flows. Runta provides the controlled runtime where each trial runs.

The provider import path is:

runta_harbor.environment:RuntaEnvironment

This requires Python 3.12 or later.

Terminal window
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install "runta-sdk[harbor]"

This installs the Runta SDK, the runta_harbor provider module, and Harbor into the same Python environment. Harbor’s Python package provides the harbor CLI.

Set your Runta credentials:

Terminal window
export RUNTA_TOKEN=rt_...

Run one task from a published Harbor dataset:

Terminal window
harbor run \
-d terminal-bench-sample@2.0 \
-a oracle \
-l 1 \
--environment-import-path runta_harbor.environment:RuntaEnvironment \
--ek mode=auto

This runs Harbor’s built-in oracle agent against one task from the terminal-bench-sample@2.0 dataset and prints the trial result when Harbor finishes.

Create a Harbor JobConfig with EnvironmentConfig(import_path=...).

import asyncio
from harbor.job import Job
from harbor.models.job.config import DatasetConfig, JobConfig
from harbor.models.trial.config import AgentConfig, EnvironmentConfig
RUNTA_ENV_IMPORT_PATH = "runta_harbor.environment:RuntaEnvironment"
async def main() -> None:
config = JobConfig(
job_name="runta-harbor-demo",
jobs_dir="jobs",
n_concurrent_trials=2,
agents=[AgentConfig(name="oracle")],
environment=EnvironmentConfig(
import_path=RUNTA_ENV_IMPORT_PATH,
type=None,
kwargs={
"mode": "auto",
},
),
datasets=[
DatasetConfig(name="terminal-bench-sample", version="2.0", n_tasks=1),
],
)
job = await Job.create(config)
result = await job.run()
print(result)
asyncio.run(main())

RuntaEnvironment implements Harbor’s normal environment interface:

  • start creates and starts a Runta runtime.
  • exec runs Harbor agent and verifier commands in that runtime.
  • upload_file and upload_dir copy solutions, tests, and task assets in.
  • download_file and download_dir copy verifier logs and reward artifacts out.
  • Compose sidecar service_exec, sidecar file and directory downloads, and stop_service.
  • set_network_policy maps Harbor network policies onto Runta egress controls.
  • stop deletes the runtime after the trial by default.

Normal Harbor tasks can use Runta for agent execution, verifier execution, task asset upload, solution upload, health checks, main-service logs, main-service artifacts, compose sidecar artifact collection, and direct file or directory copy operations.

The provider selects direct, docker, or compose mode automatically. Set --ek mode=direct, --ek mode=docker, or --ek mode=compose to force a mode.

  • harbor run -e runta is not available until Harbor registers Runta as an upstream environment type. Use --environment-import-path runta_harbor.environment:RuntaEnvironment for now.
  • GPU, TPU, Windows, and mounted-resource task requirements are not supported.
  • Storage override settings are accepted by Harbor but not applied to Runta runtime creation yet.
  • Private registry pulls depend on Docker credentials already being available inside the Runta runtime; there is no Harbor-specific registry login flow yet.

If Harbor fails with No module named 'runta_harbor', the harbor command is running from a Python environment that does not have runta-sdk[harbor] installed. This commonly happens when which harbor points to a global uv tool install, such as ~/.local/bin/harbor.

Use uvx for a quick fix:

Terminal window
uvx --with "runta-sdk[harbor]" harbor run \
-d terminal-bench-sample@2.0 \
-a oracle \
-l 1 \
--environment-import-path runta_harbor.environment:RuntaEnvironment \
--ek mode=auto