rycerzes/frontier-swe-postgres
0
1# Notebook Compression — Task Image2#3# Extends openenv-base with compression tooling, scientific Python deps,4# the vendored upstream verifier, and a build-time-synthesized visible5# corpus.6#7# Build (must build base first):8# podman build -f docker/Dockerfile.base -t openenv-base:latest .9# podman build -f docker/Dockerfile.notebook -t frontier-swe-notebook:latest .10#11# Run:12# podman run -p 8000:8000 frontier-swe-notebook:latest13 14ARG BASE_IMAGE=openenv-base:latest15FROM ${BASE_IMAGE}16 17ENV DEBIAN_FRONTEND=noninteractive18ENV DATA_ROOT=/mnt/notebook-data19ENV TASK_BUDGET_SECS=360020ENV FSWE_TASK_NAME=notebook21ENV FSWE_TASK_MODE=training22 23# System compression tools + unzip (for bundle extraction) + jq (debug)24RUN apt-get update && apt-get install -y --no-install-recommends \25 zstd \26 brotli \27 lz4 \28 zlib1g-dev \29 liblzma-dev \30 libbz2-dev \31 unzip \32 jq \33 && rm -rf /var/lib/apt/lists/*34 35# Scientific Python + compression bindings (installed into the OpenEnv venv36# that Dockerfile.base set up at /opt/openenv-venv)37RUN pip install --no-cache-dir \38 numpy \39 pandas \40 scipy \41 pyarrow \42 joblib \43 tqdm \44 nbformat \45 jsonschema \46 datasketch \47 zstandard \48 brotli \49 lz450 51# Workspace stub (upstream run script — fails on any invocation until the52# agent edits it)53COPY tasks/notebook-compression/environment/workspace/run /app/run54RUN chmod +x /app/run55 56# Verifier scripts + hidden bundle live at /opt/verifier/57RUN mkdir -p /opt/verifier /logs/verifier /mnt/notebook-data58COPY tasks/notebook-compression/tests/compute_reward.py /opt/verifier/59COPY tasks/notebook-compression/tests/scoring_core.py /opt/verifier/60COPY tasks/notebook-compression/tests/test.sh /opt/verifier/61COPY tasks/notebook-compression/tests/hidden_test_set_bundle.zip /opt/verifier/62RUN chmod +x /opt/verifier/test.sh63 64# Build-time visible-corpus synthesis (see decision-log D-009)65COPY scripts/split_visible_corpus.py /tmp/split_visible_corpus.py66RUN python3 /tmp/split_visible_corpus.py \67 --bundle /opt/verifier/hidden_test_set_bundle.zip \68 --out /mnt/notebook-data/visible \69 --manifest /mnt/notebook-data/manifest.json \70 --ratio 0.75 --seed 17 \71 && rm /tmp/split_visible_corpus.py72 73# Gate checks74COPY scripts/notebook_gate_checks.sh /app/gate_checks.sh75RUN chmod +x /app/gate_checks.sh76 77# OpenEnv core code (overwrites what's in the base so rubric changes land)78COPY frontier_swe_env/ /opt/openenv/frontier_swe_env/79COPY pyproject.toml /opt/openenv/pyproject.toml80COPY scripts/ /opt/openenv/scripts/81ENV PYTHONPATH="/opt/openenv"82 83# Git baseline for L2 diff tracking84RUN cd /app \85 && git config --global user.email "agent@frontier-swe-openenv" \86 && git config --global user.name "agent" \87 && git init && git add -A && git commit -m "initial stub"88 89# Patch PiHarnessAdapter: remove --no-session so pi persists session .jsonl files.90# Without this, pi runs in-memory-only mode and no trajectory data is saved.91RUN find /opt/openenv-venv -path '*/harnesses/adapters/pi.py' -exec \92 sed -i '/if "--no-session" not in cmd:/,/cmd.append("--no-session")/d' {} \;93 94# Re-copy entrypoint (matches Dockerfile.pg pattern for explicitness;95# also picks up any local changes since base was built)96COPY docker/openenv_entrypoint.sh /app/openenv_entrypoint.sh97RUN chmod +x /app/openenv_entrypoint.sh98 99HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \100 CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1101 