Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b11bdaa
feat(harbor): add openenv harbor build-images for OCI registries and …
burtenshaw Nov 26, 2026
d5dd1d7
style: sort imports with usort
burtenshaw Nov 26, 2026
ff1b9c1
fix(harbor): address Bugbot review on COPY destinations, globs, outpu…
burtenshaw Nov 26, 2026
1505e6e
Fix Harbor image build edge cases
cursoragent Nov 26, 2026
dd71b37
Fix recursive COPY glob builder fallback
cursoragent Nov 26, 2026
6267807
fix(harbor): hash only what build-images copies into the image
younesbelkada Nov 27, 2026
66b5089
fix(harbor): handle tabs, .dockerignore and heredocs in the environme…
younesbelkada Nov 27, 2026
8b81bc3
fix(harbor): parse heredocs in the environment hash instead of hashin…
younesbelkada Nov 27, 2026
8dd2998
fix(harbor): make selective build context hashing explicit
burtenshaw Nov 27, 2026
2e271cf
Merge pull request #1758 from younesbelkada/fix/build-images-hash-cop…
burtenshaw Nov 27, 2026
b715cea
Merge origin/main into feat/harbor-build-images
cursoragent Dec 2, 2026
b401808
fix(harbor): scope explicit registry credentials to the push registry
cursoragent Dec 2, 2026
fc0d581
docs(harbor): document openenv harbor build-images
cursoragent Dec 2, 2026
81a472e
docs(harbor): document build-images in the harbor_env README and sync…
cursoragent Dec 2, 2026
d490611
fix(harbor): drop registry auth on cross-host uploads, fall back from…
cursoragent Dec 2, 2026
191ded6
Fix Harbor image build edge cases
cursoragent Dec 2, 2026
668798d
Merge bugbot autofix; route .dockerignore tasks to a builder instead …
cursoragent Dec 2, 2026
5acc7e7
ci: retrigger checks after uv install timeout on test (3.11)
cursoragent Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion docs/source/environments/harbor.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ What the UI guarantees whatever the settings:

## CLI reference

Four commands. Every flag below is the complete set, with its type and default.
Five commands. Every flag below is the complete set, with its type and default.
`openenv harbor <command> --help` prints the same thing.

Exit codes:
Expand Down Expand Up @@ -531,6 +531,60 @@ openenv harbor push --llm-url $LLM --dataset org/train,org/eval \
at `<space-url>/capture`, and a private Space requires an auth header the sandboxed agent does not
send. Use it only to park a deployment.

### `openenv harbor build-images`

Turn Harbor task directories into tasks whose `task.toml` pins a public, digest-pinned
`linux/amd64` image (`[environment].docker_image = "<repo>@sha256:<digest>"`), as required by
prebuilt-image sandboxes such as HF Sandbox. It pushes to any OCI registry (GHCR, Docker Hub, a
local `registry:2`) and does not need the `harbor` extra.

`PATH` is a single task directory (with `task.toml`) or a dataset directory of tasks. Each task's
`environment/` is audited first (symlinks, `COPY`/`ADD` of `tests/` or `solution/`, files that
duplicate verifier or solution bytes, embedded tokens or private keys), then tasks with the same
build context are deduplicated and routed:

| `environment/Dockerfile` | what runs |
|---|---|
| none, existing `docker_image` | the image is verified and digest-pinned |
| only `FROM`, `COPY`, `WORKDIR`, `ENV`, `LABEL`, `ARG`, `EXPOSE` | pure-Python OCI layer append, no Docker daemon |
| has `RUN` or multiple stages | `--builder kaniko` (Kaniko on HF Jobs) or `--builder docker` (local `docker buildx`) |

| flag | type | default | meaning |
|---|---|---|---|
| `--registry` | str | `""` | Target OCI repository, e.g. `ghcr.io/org/tasks`. Required unless nothing needs pushing |
| `--builder` | str | `auto` | `auto`, `kaniko`, `docker` or `oci-append`. `auto` picks Kaniko when `--namespace` is set or Docker is missing |
| `--plan` | flag | off | Audit, classify and deduplicate only; build and push nothing |
| `--verify-only` | flag | off | Check that every `task.toml` points to a pullable `linux/amd64` image |
| `--require-digest-pin` | flag | off | With `--verify-only`, fail on mutable tags |
| `--output-dir` / `--in-place` | path / flag | none | Write pinned copies of the tasks to a new directory, or rewrite each `task.toml`. Mutually exclusive; without either, only receipts are written |
| `--receipts` | path | none | JSON manifest of resolved digests, also used to resume |
| `--per-task-receipts-dir` | path | none | One `<task_id>.json` receipt per task, written as each finishes |
| `--task` | str | all | Only this task id. Repeatable |
| `--extra-dockerfile` | path | none | Fragment appended to every task's Dockerfile |
| `--tag-prefix` | str | `""` | Prefix for pushed tags |
| `--concurrency` | int | `4` | Parallel builds, appends and registry checks |
| `--namespace`, `--flavor`, `--timeout`, `--kaniko-image`, `--bucket`, `--cache-repo` | str | see `--help` | Kaniko on HF Jobs: namespace, hardware flavor, job timeout, Kaniko image, private bucket holding the temporary build context, optional layer-cache repository |
| `--no-oci-append` | flag | off | Send `COPY`-only Dockerfiles through `--builder` too |
| `--rebuild-pinned` | flag | off | Rebuild tasks that already pin a digest |
| `--strip-dockerfile` | flag | off | Remove `environment/Dockerfile` from shared-image tasks |
| `--assume-static-context` | flag | off | Hash only the files the Dockerfile copies. Use when base images have no `ONBUILD` triggers |
| `--verify-public/--no-verify-public` | flag | on | Verify the pushed image pulls anonymously |
| `--no-push` | flag | off | Build without pushing |
| `--registry-user`, `--registry-password` | str | `""` | Push credentials. Prefer `GHCR_TOKEN`, `DOCKER_PASSWORD` or `REGISTRY_USERNAME`/`REGISTRY_PASSWORD`, or `~/.docker/config.json`. Explicit and `REGISTRY_*` credentials are only sent to the `--registry` host |
| `--json` | flag | off | Machine-readable output |

Kaniko builds authenticate to the Hub with your usual `HF_TOKEN` / `hf auth login`. The push
credential is passed to the job as an HF Jobs secret and written to `/kaniko/.docker/config.json`
inside it. Kaniko is not a sandbox: `RUN` steps can read that file, so only build Dockerfiles you
trust, and use a push token scoped to the target repository.

```bash
openenv harbor build-images tasks/ --plan --registry ghcr.io/org/tasks
openenv harbor build-images tasks/ --registry ghcr.io/org/tasks --builder kaniko \
--namespace org --output-dir tasks-pinned/ --receipts receipts.json
openenv harbor build-images tasks-pinned/ --verify-only --require-digest-pin
```

### Migration notes for the new UI

- `serve` binds `0.0.0.0` by default and therefore uses the network-safe UI defaults. Visitor
Expand Down
1 change: 1 addition & 0 deletions docs/source/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ captures the token ids and logprobs of every model call. Requires
| `openenv harbor rollout` | Runs one or more rollouts end to end without a server. |
| `openenv harbor serve` | Serves Harbor tasks over the Task API and MCP, with a UI at `/web`. |
| `openenv harbor push` | Deploys the same server to a Hugging Face Space. |
| `openenv harbor build-images` | Builds or appends, pushes and digest-pins the OCI images Harbor tasks need for prebuilt-image sandboxes. Does not need the `harbor` extra. |

```bash
openenv harbor info --llm-url $LLM --dataset AdithyaSK/data_agent_rl_environment_eval
Expand Down
56 changes: 55 additions & 1 deletion envs/harbor_env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ What the UI guarantees whatever the settings:

## CLI reference

Four commands. Every flag below is the complete set, with its type and default.
Five commands. Every flag below is the complete set, with its type and default.
`openenv harbor <command> --help` prints the same thing.

Exit codes:
Expand Down Expand Up @@ -543,6 +543,60 @@ openenv harbor push --llm-url $LLM --dataset org/train,org/eval \
at `<space-url>/capture`, and a private Space requires an auth header the sandboxed agent does not
send. Use it only to park a deployment.

### `openenv harbor build-images`

Turn Harbor task directories into tasks whose `task.toml` pins a public, digest-pinned
`linux/amd64` image (`[environment].docker_image = "<repo>@sha256:<digest>"`), as required by
prebuilt-image sandboxes such as HF Sandbox. It pushes to any OCI registry (GHCR, Docker Hub, a
local `registry:2`) and does not need the `harbor` extra.

`PATH` is a single task directory (with `task.toml`) or a dataset directory of tasks. Each task's
`environment/` is audited first (symlinks, `COPY`/`ADD` of `tests/` or `solution/`, files that
duplicate verifier or solution bytes, embedded tokens or private keys), then tasks with the same
build context are deduplicated and routed:

| `environment/Dockerfile` | what runs |
|---|---|
| none, existing `docker_image` | the image is verified and digest-pinned |
| only `FROM`, `COPY`, `WORKDIR`, `ENV`, `LABEL`, `ARG`, `EXPOSE` | pure-Python OCI layer append, no Docker daemon |
| has `RUN` or multiple stages | `--builder kaniko` (Kaniko on HF Jobs) or `--builder docker` (local `docker buildx`) |

| flag | type | default | meaning |
|---|---|---|---|
| `--registry` | str | `""` | Target OCI repository, e.g. `ghcr.io/org/tasks`. Required unless nothing needs pushing |
| `--builder` | str | `auto` | `auto`, `kaniko`, `docker` or `oci-append`. `auto` picks Kaniko when `--namespace` is set or Docker is missing |
| `--plan` | flag | off | Audit, classify and deduplicate only; build and push nothing |
| `--verify-only` | flag | off | Check that every `task.toml` points to a pullable `linux/amd64` image |
| `--require-digest-pin` | flag | off | With `--verify-only`, fail on mutable tags |
| `--output-dir` / `--in-place` | path / flag | none | Write pinned copies of the tasks to a new directory, or rewrite each `task.toml`. Mutually exclusive; without either, only receipts are written |
| `--receipts` | path | none | JSON manifest of resolved digests, also used to resume |
| `--per-task-receipts-dir` | path | none | One `<task_id>.json` receipt per task, written as each finishes |
| `--task` | str | all | Only this task id. Repeatable |
| `--extra-dockerfile` | path | none | Fragment appended to every task's Dockerfile |
| `--tag-prefix` | str | `""` | Prefix for pushed tags |
| `--concurrency` | int | `4` | Parallel builds, appends and registry checks |
| `--namespace`, `--flavor`, `--timeout`, `--kaniko-image`, `--bucket`, `--cache-repo` | str | see `--help` | Kaniko on HF Jobs: namespace, hardware flavor, job timeout, Kaniko image, private bucket holding the temporary build context, optional layer-cache repository |
| `--no-oci-append` | flag | off | Send `COPY`-only Dockerfiles through `--builder` too |
| `--rebuild-pinned` | flag | off | Rebuild tasks that already pin a digest |
| `--strip-dockerfile` | flag | off | Remove `environment/Dockerfile` from shared-image tasks |
| `--assume-static-context` | flag | off | Hash only the files the Dockerfile copies. Use when base images have no `ONBUILD` triggers |
| `--verify-public/--no-verify-public` | flag | on | Verify the pushed image pulls anonymously |
| `--no-push` | flag | off | Build without pushing |
| `--registry-user`, `--registry-password` | str | `""` | Push credentials. Prefer `GHCR_TOKEN`, `DOCKER_PASSWORD` or `REGISTRY_USERNAME`/`REGISTRY_PASSWORD`, or `~/.docker/config.json`. Explicit and `REGISTRY_*` credentials are only sent to the `--registry` host |
| `--json` | flag | off | Machine-readable output |

Kaniko builds authenticate to the Hub with your usual `HF_TOKEN` / `hf auth login`. The push
credential is passed to the job as an HF Jobs secret and written to `/kaniko/.docker/config.json`
inside it. Kaniko is not a sandbox: `RUN` steps can read that file, so only build Dockerfiles you
trust, and use a push token scoped to the target repository.

```bash
openenv harbor build-images tasks/ --plan --registry ghcr.io/org/tasks
openenv harbor build-images tasks/ --registry ghcr.io/org/tasks --builder kaniko \
--namespace org --output-dir tasks-pinned/ --receipts receipts.json
openenv harbor build-images tasks-pinned/ --verify-only --require-digest-pin
```

### Migration notes for the new UI

- `serve` binds `0.0.0.0` by default and therefore uses the network-safe UI defaults. Visitor
Expand Down
Loading