Skip to content

Commit 0a0e422

Browse files
authored
Merge pull request #13 from mogilventures/daytona-runtime-image
build: add pinned Daytona Pi runtime image
2 parents a27261f + 6232d6f commit 0a0e422

9 files changed

Lines changed: 2083 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ docker rm -f $(docker ps -aq --filter 'label=com.docker.compose.project=<exact-l
121121

122122
## Harbor Daytona backend
123123

124+
The credential-free runtime image definition, local conformance checks, and reviewed immutable-digest publish procedure are documented in [`docs/daytona-runtime-image.md`](docs/daytona-runtime-image.md). The intended repository is `ghcr.io/mogilventures/mogil-bench-daytona-runtime`; benchmark packs must reference a published manifest by digest, never by a mutable tag.
125+
124126
Daytona is selected only through the pack's Harbor configuration; Mogil never routes it through a host Pi extension or a standalone sandbox runner. Harbor 0.18.0 creates both the agent sandbox and its separate verifier sandbox. The verifier remains `no-network`, receives no model secret references, and gets only the collected candidate workspace. Daytona's supported organization-secret mapping is the only accepted model-secret transport: the pack stores opaque secret names, while Daytona substitutes secret values only for their configured allowed hosts.
125127

126128
Daytona preflight happens before output publication and requires the optional dependency, `DAYTONA_API_KEY` (or the JWT/organization pair), a digest-pinned image, request-strength CPU and RAM enforcement, explicit disk, allowlist network policy, secret references, `delete: true`, and no mounts. After creation, the adapter refreshes each sandbox from Daytona and records bounded provider-returned CPU, RAM, disk, and network fields. It also executes image prerequisites in each sandbox (Python 3.12 at `/usr/local/bin/python` and `/bin/sh`); the preinstalled agent path separately requires `pi --version` to return exactly `0.80.6` before agent execution. Agent and verifier receipts are bound to the exact expected session and unique sandbox IDs and must satisfy the requested minima and exact network restrictions; duplicate, extra, mismatched, or missing provider fields remain unverified and force insufficient evidence. The receipt separately confirms whether secret references were present in actual create parameters (required for the agent and forbidden for the verifier). Harbor lock serialization is never represented as effective provider state. Evidence uses the blinded `isolated-sandbox` class; provider details remain in private `environment.json` and do not enter reviewer evidence.

docs/daytona-runtime-image.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Daytona runtime image
2+
3+
This repository defines the credential-free runtime image used by Mogil Bench's
4+
**Harbor 0.18.0** Daytona adapter. The intended registry repository is
5+
`ghcr.io/mogilventures/mogil-bench-daytona-runtime`.
6+
7+
The image contract is intentionally narrow:
8+
9+
- Python 3.12.11 is available as `/usr/local/bin/python`;
10+
- `/bin/sh`, Node 22.19.0, and npm 10.9.3 are available;
11+
- `pi --version` returns exactly `0.80.6` (optionally followed by one newline);
12+
- Pi is installed with Mogil's reviewed npm alias,
13+
`@mariozechner/pi-coding-agent@npm:@earendil-works/pi-coding-agent@0.80.6`;
14+
- both upstream image indexes, the Dockerfile frontend, and all named versions
15+
are pinned;
16+
- npm's full production graph is integrity-pinned by `package-lock.json`; and
17+
- the closed build context contains only the Docker definition and npm manifests;
18+
only the non-secret manifests are copied into the image.
19+
20+
No credentials are needed to build or inspect it. Never pass build secrets,
21+
registry credentials, auth files, benchmark fixtures, or repository source as
22+
build arguments or context content.
23+
24+
## Local build and inspection
25+
26+
From the repository root, with Docker available:
27+
28+
```sh
29+
scripts/build-daytona-runtime.sh mogil-bench-daytona-runtime:local
30+
scripts/inspect-daytona-runtime.sh mogil-bench-daytona-runtime:local
31+
pytest -q tests/test_daytona_runtime_image.py
32+
```
33+
34+
The build script does not log in, push, or otherwise publish. It first fails if
35+
anything has been added to the minimal build context. The inspection script runs
36+
the literal Pi version command, validates its exact bytes, checks the Python path
37+
and minor version, exercises Node/npm and the shell, and scans image configuration
38+
and layer commands for credential-like material.
39+
40+
## Reviewed publish workflow
41+
42+
Publishing is a deliberate operator action, not CI behavior. Start from a clean,
43+
reviewed commit and choose a unique release tag (for example a date plus short
44+
source revision). Authenticate Docker to GHCR outside the build; do not put the
45+
token in an environment variable consumed by Dockerfile instructions or in the
46+
build context.
47+
48+
Build and load each target platform locally first, then run the inspection script
49+
against it. After review, publish a multi-platform manifest directly with Buildx:
50+
51+
```sh
52+
REPOSITORY=ghcr.io/mogilventures/mogil-bench-daytona-runtime
53+
RELEASE=2026-07-12-abcdef0
54+
55+
docker buildx build \
56+
--platform linux/amd64,linux/arm64 \
57+
--file runtime/daytona/Dockerfile \
58+
--tag "${REPOSITORY}:${RELEASE}" \
59+
--provenance=true --sbom=true --push \
60+
runtime/daytona
61+
62+
docker buildx imagetools inspect "${REPOSITORY}:${RELEASE}"
63+
```
64+
65+
Copy the resulting manifest digest from the inspection output and form the only
66+
supported runtime reference:
67+
68+
```text
69+
ghcr.io/mogilventures/mogil-bench-daytona-runtime@sha256:<64-hex-manifest-digest>
70+
```
71+
72+
Run `scripts/inspect-daytona-runtime.sh` against that digest (Docker will inspect
73+
the current platform), then use the same immutable reference as
74+
`TERMINAL_DAYTONA_IMAGE` or the pack's `environment_policy.image`. Tags are only
75+
publication handles; never put a tag-only reference in a benchmark pack. Record
76+
the digest in the release/operations record. Do not retag a mutable channel or
77+
configure Daytona from one.
78+
79+
The image contains runtime prerequisites only. Model credentials remain Daytona
80+
organization-secret references attached by the adapter to the agent sandbox;
81+
they are neither build inputs nor image content. The same image can therefore be
82+
used for Harbor's separately created no-network verifier sandbox without exposing
83+
agent credentials.

runtime/daytona/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**
2+
!package.json
3+
!package-lock.json

runtime/daytona/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# syntax=docker/dockerfile:1@sha256:87999aa3d42bdc6bea60565083ee17e86d1f3339802f543c0d03998580f9cb89
2+
FROM node:22.19.0-bookworm-slim@sha256:4a4884e8a44826194dff92ba316264f392056cbe243dcc9fd3551e71cea02b90 AS node-runtime
3+
4+
FROM python:3.12.11-slim-bookworm@sha256:519591d6871b7bc437060736b9f7456b8731f1499a57e22e6c285135ae657bf7
5+
6+
LABEL org.opencontainers.image.source="https://github.com/mogilventures/mogil-bench" \
7+
org.opencontainers.image.description="Credential-free Mogil Bench runtime for Harbor 0.18.0 on Daytona" \
8+
io.mogil.harbor.version="0.18.0" \
9+
io.mogil.pi.version="0.80.6"
10+
11+
COPY --from=node-runtime /usr/local/bin/node /usr/local/bin/node
12+
COPY --from=node-runtime /usr/local/lib/node_modules /usr/local/lib/node_modules
13+
14+
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
15+
&& ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx
16+
17+
WORKDIR /opt/mogil-pi
18+
COPY package.json package-lock.json ./
19+
RUN npm ci --ignore-scripts --omit=dev --no-audit --no-fund \
20+
&& ln -s /opt/mogil-pi/node_modules/.bin/pi /usr/local/bin/pi \
21+
&& test "$(pi --version)" = '0.80.6' \
22+
&& npm cache clean --force \
23+
&& rm -rf /root/.npm /tmp/*
24+
25+
WORKDIR /workspace
26+
CMD ["/bin/sh"]

0 commit comments

Comments
 (0)