-
Notifications
You must be signed in to change notification settings - Fork 66
Vendor blank, coding, and cua presets into the hud wheel #515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jdchawla29
wants to merge
2
commits into
jaideep/vendor-environment-templates
Choose a base branch
from
jaideep/vendored-init-presets
base: jaideep/vendor-environment-templates
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM python:3.11-slim | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends curl \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /app | ||
| COPY pyproject.toml uv.lock* ./ | ||
| RUN pip install uv && uv sync --frozen --no-dev 2>/dev/null || uv sync --no-dev | ||
| COPY . . | ||
|
|
||
| # Serve the Environment's control channel (tcp JSON-RPC) on 8765. | ||
| EXPOSE 8765 | ||
| CMD ["uv", "run", "hud", "serve", "env:env", "--host", "0.0.0.0", "--port", "8765"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [project] | ||
| name = "blank-env" | ||
| version = "0.1.0" | ||
| requires-python = ">=3.11" | ||
| dependencies = ["hud"] | ||
|
|
||
| [tool.uv] | ||
| package = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| """Tasks for blank — run with: hud eval tasks.py <agent> (e.g. claude).""" | ||
|
|
||
| from env import count | ||
|
|
||
| # ``hud eval`` collects these Tasks — each is the ``count`` task bound to | ||
| # concrete args. Add your own, or build them in a loop. | ||
| tasks = [ | ||
| count(sentence="Strawberry world", letter="r"), | ||
| count(sentence="banana", letter="a"), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # The build context is this directory; keep it to what the images COPY, plus | ||
| # the Dockerfile itself (remote builders read it from the context). | ||
| * | ||
| !Dockerfile.hud | ||
| !env.py | ||
| !coding | ||
| !instances | ||
| **/__pycache__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Python | ||
| __pycache__/ | ||
| *.py[cod] | ||
| .pytest_cache/ | ||
| .ruff_cache/ | ||
| .coverage | ||
| .venv | ||
| .env | ||
| build/ | ||
| dist/ | ||
| *.egg-info/ | ||
|
|
||
| # OS / IDE | ||
| .DS_Store | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
|
|
||
| # HUD | ||
| hud.lock.yaml | ||
| .hud | ||
| .hud_local/ | ||
| .hud_eval.toml | ||
| .hud-images.json | ||
|
|
||
| # SWE-bench Pro instance assets are fetched per-user (swe_tasks.py) and carry | ||
| # the golden patches; only the empty .none dir (generic image builds) ships. | ||
| instances/* | ||
| !instances/.none/ | ||
|
|
||
| # The SDK repo ignores uv.lock at its root; this template pins its own so the | ||
| # example resolves reproducibly. | ||
| !uv.lock | ||
|
|
||
| # Logs | ||
| *.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # syntax=docker/dockerfile:1 | ||
| # One image definition for both flavors. | ||
| # | ||
| # Generic (default) — the repo-clone stage bakes your target repo into /app: | ||
| # docker build -f Dockerfile.hud --build-arg REPO_URL=https://github.com/you/repo . | ||
| # (private repos: --secret id=CODING_GITHUB_TOKEN,env=CODING_GITHUB_TOKEN) | ||
| # | ||
| # SWE-bench Pro (driven by swe_tasks.py) — BASE selects the instance's | ||
| # prebuilt image (repo already at /app) and INSTANCE_ID bakes its assets: | ||
| # docker build -f Dockerfile.hud --build-arg BASE=jefzda/sweap-images:<tag> \ | ||
| # --build-arg INSTANCE_ID=<id> . | ||
| ARG BASE=repo-clone | ||
|
|
||
| # ─── generic head: toolchain + target repo at /app ─── | ||
| FROM ubuntu:24.04 AS repo-clone | ||
|
|
||
| RUN apt-get update -y \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| bash build-essential ca-certificates curl git openssl \ | ||
| python-is-python3 python3 python3-dev python3-pip python3-venv util-linux \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && update-ca-certificates | ||
|
|
||
| # The sample tasks' test command uses the image's python; adjust per repo. | ||
| RUN pip3 install --break-system-packages pytest | ||
|
|
||
| ARG REPO_URL="https://github.com/hud-evals/coding-template-sample" | ||
| # chown in the same RUN as the clone (a separate layer would duplicate /app): | ||
| # env.py serves agent shells as uid 1000, so the baked tree must be theirs. | ||
| # Doing it at build makes it free at runtime, whatever the repo's size. | ||
| RUN --mount=type=secret,id=CODING_GITHUB_TOKEN \ | ||
| if [ -f /run/secrets/CODING_GITHUB_TOKEN ]; then \ | ||
| git clone "https://$(cat /run/secrets/CODING_GITHUB_TOKEN)@${REPO_URL#https://}" /app; \ | ||
| else \ | ||
| git clone ${REPO_URL} /app; \ | ||
| fi \ | ||
| && chown -R 1000:1000 /app | ||
| # Add a build step for the target repo here if it needs one (deps, compile). | ||
|
|
||
| # ─── the served image: BASE + hud serving layer (+ instance assets) ─── | ||
| FROM ${BASE} | ||
|
|
||
| # ".none" is a committed empty dir, so generic builds bake no instance and | ||
| # env.py serves only the generic coding-task template. | ||
| ARG INSTANCE_ID=".none" | ||
| COPY env.py /hud/env.py | ||
| COPY coding /hud/coding | ||
| COPY instances/${INSTANCE_ID}/ /hud/instance/ | ||
|
|
||
| # Self-contained hud venv under /hud: bootstrap uv (with its own managed | ||
| # Python), never touching the base image's Python or site-packages. chmod 700 | ||
| # keeps the vault and instance assets out of the uid-dropped agent's reach. | ||
| RUN <<'INSTALL' | ||
| set -eu | ||
| export PATH="$HOME/.local/bin:$PATH" UV_INSTALL_DIR="$HOME/.local/bin" | ||
| command -v uv >/dev/null 2>&1 || { | ||
| { command -v curl >/dev/null 2>&1 || command -v wget >/dev/null 2>&1; } \ | ||
| || { apt-get update -qq && apt-get install -y -qq curl ca-certificates; } \ | ||
| || apk add --no-cache curl ca-certificates | ||
| { command -v curl >/dev/null 2>&1 && curl -LsSf https://astral.sh/uv/install.sh | sh; } \ | ||
| || { command -v wget >/dev/null 2>&1 && wget -qO- https://astral.sh/uv/install.sh | sh; } \ | ||
| || pip install -q -U uv | ||
| } | ||
| uv python install 3.12 | ||
| uv venv /hud/venv --python 3.12 | ||
| uv pip install --python /hud/venv/bin/python 'hud>=0.6.11' | ||
| chmod -R go-rwx /hud | ||
| INSTALL | ||
| ENV REPO_DIR=/app PYTHONPATH=/hud | ||
| EXPOSE 8765 | ||
| ENTRYPOINT [] | ||
| CMD ["/hud/venv/bin/hud", "serve", "/hud/env.py", "--host", "0.0.0.0", "--port", "8765"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
hud init my-envorhud init my-env --preset blankcopies this template, it now writes the literalblankinstead of deriving the environment name from the requested target as the previous scaffold did.hud deploytreats the declaredEnvironmentname as the platform identity and uses get-or-rebuild semantics, so independently named blank projects all deploy asblankand later deployments can rebuild the same registry rather than create the intended environments. Restore target-name substitution for the blank scaffold and its project metadata.AGENTS.md reference: AGENTS.md:L76-L78
Useful? React with 👍 / 👎.