Skip to content
Merged
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions src/agent_env/agents/agents/proxy/bake.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh
# Bakes the proxy into an image as it's built, so an install into one of its containers only starts it: a private
# Python and a venv holding requirements.txt in /opt/agentenv-proxy, and a marker naming the requirements it holds,
# which install.sh checks. Plain sh, for images with no bash. A task image's Dockerfile ends with
# Python and a venv holding requirements.txt in /opt/agentenv-proxy, compiled to bytecode so each container doesn't
# compile it on first import, and a marker naming the requirements it holds, which install.sh checks. Plain sh, for
# images with no bash. A task image's Dockerfile ends with
#
# COPY --from=ghcr.io/astral-sh/uv:0.13.1@sha256:4a1f3666816dafadd20ceb71eac9a7d56d7ef30279f7d64048519ab901ada336 /uv /opt/agentenv-proxy/bin/uv
# COPY agentenv-proxy /opt/agentenv-proxy/src
Expand All @@ -15,7 +16,7 @@ here=$(cd "$(dirname "$0")" && pwd)

export UV_PYTHON_PREFERENCE=only-managed UV_PYTHON_INSTALL_DIR="$BAKED/python" UV_CACHE_DIR="$BAKED/cache"
"$BAKED/bin/uv" venv --quiet --python "$PYTHON_VERSION" "$BAKED/venv"
"$BAKED/bin/uv" pip install --quiet --python "$BAKED/venv/bin/python" -r "$here/requirements.txt"
"$BAKED/bin/uv" pip install --quiet --compile-bytecode --python "$BAKED/venv/bin/python" -r "$here/requirements.txt"
rm -rf "$BAKED/cache"
"$BAKED/venv/bin/python" -c 'import hashlib, sys; print(hashlib.sha256(open(sys.argv[1], "rb").read()).hexdigest())' \
"$here/requirements.txt" > "$BAKED/baked"
Loading