Skip to content

Commit 06fc3e5

Browse files
stubbiclaude
andcommitted
fix(agent-image): ship the uv binary in the runtime stage
Second half of the #68 init-uv contract fix. #85 added the lockfiles at /opt/venv-template/, which let `init-uv` get past its `cp` step and reach `uv sync --frozen` — which then failed with exit 127 ("uv: not found"), because the runtime stage copies the resolved venv (/opt/venv) but never the uv binary. (Before #85, init-uv died at the earlier `cp`, masking this.) Copy uv/uvx into the runtime image (mirroring the builder stage) and set deterministic UV_* defaults so the pod-start `uv sync` never tries to download a Python or hardlink across the image-layer -> PVC boundary: - UV_PYTHON_DOWNLOADS=never - UV_PYTHON=/usr/local/bin/python - UV_LINK_MODE=copy Verified locally: building the image and running the exact init-uv command (cp + uv sync --frozen) now completes and populates the per-instance .venv. Refs #68 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 39ef52c commit 06fc3e5

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

images/hermes-agent/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,22 @@ COPY --from=builder --chown=hermes:hermes /opt/venv /opt/venv
9696
# no HermesInstance ever reaches Ready. See #68.
9797
COPY --from=builder --chown=hermes:hermes /build/pyproject.toml /build/uv.lock /opt/venv-template/
9898

99+
# Ship the uv binary in the runtime image too. The operator's `init-uv` init
100+
# container runs `uv sync --frozen` (above) to materialise the env onto the
101+
# per-instance PVC, so uv must be on PATH at runtime — the resolved venv at
102+
# /opt/venv does not include uv. Without this, init-uv exits 127
103+
# ("uv: not found") and no HermesInstance reaches Ready. See #68.
104+
COPY --from=uv /uv /uvx /usr/local/bin/
105+
106+
# UV_* defaults for the init-uv `uv sync` at pod start: pin a deterministic
107+
# interpreter and a PVC-safe link mode so uv never tries to download a Python or
108+
# hardlink across filesystems (image layer -> mounted PVC).
99109
ENV PATH="/opt/venv/bin:${PATH}" \
100110
PYTHONUNBUFFERED=1 \
101111
PYTHONDONTWRITEBYTECODE=1 \
112+
UV_PYTHON_DOWNLOADS=never \
113+
UV_PYTHON=/usr/local/bin/python \
114+
UV_LINK_MODE=copy \
102115
HOME=/home/hermes
103116

104117
# Image metadata. The HERMES_VERSION label is the one the operator's autoupdate

0 commit comments

Comments
 (0)