FROM rust:1.97.1-bookworm ENV DEBIAN_FRONTEND=noninteractive ENV RUSTUP_DIST_SERVER="https://static.rust-lang.org" ENV RUSTUP_UPDATE_ROOT="https://static.rust-lang.org/rustup" ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse ENV CARGO_REGISTRIES_CRATES_IO_INDEX="sparse+https://index.crates.io/" ENV CARGO_NET_GIT_FETCH_WITH_CLI=true ENV GOPROXY="https://proxy.golang.org,direct" ENV GOSUMDB=sum.golang.google.cn ENV GOTOOLCHAIN=auto ENV UV_INSECURE_HOST="" ENV UV_INDEX_URL="https://pypi.org/simple" ENV UV_CACHE_DIR=/workspace/.cache/uv ENV npm_config_registry="https://registry.npmjs.org/" ENV npm_config_strict_ssl=false ENV npm_config_cache=/workspace/.cache/npm ENV PIP_INDEX_URL="https://pypi.org/simple" ENV PIP_TRUSTED_HOST="" ENV HOME=/workspace ENV XDG_CACHE_HOME=/workspace/.cache ENV PIP_CACHE_DIR=/workspace/.cache/pip ENV PYTHONUSERBASE=/workspace/.local ENV CARGO_HOME=/usr/local/cargo ENV RUSTUP_HOME=/usr/local/rustup ENV RUSTUP_TOOLCHAIN=1.97.1 ENV PROGRAMGYM_RUST_TOOLCHAIN=1.97.1 ENV PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV PAGER=cat ENV MANPAGER=cat ENV LESS=-R ENV TQDM_DISABLE=1 RUN apt-get update && apt-get install -y --no-install-recommends apt=2.6.1 bash=5.2.15-2+b13 build-essential=12.9 ca-certificates=20250419~deb12u1 cmake=3.25.1-1 git=1:2.39.5-0+deb12u3 make=4.3-4.1 pkg-config=1.8.1-1 python3=3.11.2-1+b1 python3-pip=23.0.1+dfsg-1 python3-dev=3.11.2-1+b1 autoconf=2.71-3 automake=1:1.16.5-1.3 gettext=0.21-12 file=1:5.44-3 binutils=2.40-2 libtool=2.4.7-7~deb12u1 libncurses-dev=6.4-4 meson=1.0.1-5 ninja-build=1.11.1-2~deb12u1 curl=7.88.1-10+deb12u15 wget=1.21.3-1+deb12u1 xz-utils=5.4.1-1+deb12u1 zstd=1.5.4+dfsg2-5 bzip2=1.0.8-5+b1 zip=3.0-13 unzip=6.0-28+deb12u1 patch=2.7.6-7 grep=3.8-5 python3-pytest python3-pytest-xdist python3-coverage && rm -rf /var/lib/apt/lists/* RUN rustup component add llvm-tools-preview --toolchain 1.97.1 RUN RUST_SYSROOT="$(rustc --print sysroot)"; RUST_HOST="$(rustc -vV | sed -n 's/^host: //p')"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-profdata"; test -x "$RUST_SYSROOT/lib/rustlib/$RUST_HOST/bin/llvm-cov" RUN rustc --version && cargo --version && rustup show active-toolchain WORKDIR /workspace ADD workspace.tar.gz /workspace/ COPY executable /workspace/executable COPY download.sh /tmp/programgym-download.sh RUN chmod 755 /tmp/programgym-download.sh COPY harbor_prepare_download_env.sh /tmp/harbor_prepare_download_env.sh RUN chmod 755 /tmp/harbor_prepare_download_env.sh \ && /bin/bash /tmp/harbor_prepare_download_env.sh \ && rm -f /tmp/programgym-download.sh \ && rm -f /tmp/harbor_prepare_download_env.sh ENV BASH_ENV=/etc/profile.d/programgym_download_env.sh RUN chmod 111 /workspace/executable WORKDIR /workspace # Harbor uses tests/ as the separate verifier build context. Start with the # same toolchain as the agent, then remove every cleanroom workspace artifact. RUN rm -rf /workspace/* /workspace/.[!.]* 2>/dev/null || true \ && mkdir -p /workspace /tests # Synthetic cleanroom Dockerfiles commonly install Ubuntu's pytest-xdist 2.5.0. # Installing a newer pytest alone leaves that apt package importable and creates # an incompatible mixed apt/pip stack (xdist 2.5 imports the removed py.log). # Install and constrain the verifier test runner as one coherent pip toolchain. RUN printf 'pytest<9\n' > /etc/pip-constraint.txt ENV PIP_CONSTRAINT=/etc/pip-constraint.txt RUN python3 -m pip install --break-system-packages \ --no-cache-dir --disable-pip-version-check \ 'pytest<9' 'pytest-xdist>=3,<4' pytest-rerunfailures pytest-timeout COPY test.sh /tests/test.sh COPY programgym_evaluator.py /tests/programgym_evaluator.py COPY programgym_task.json /tests/programgym_task.json COPY blobs/ /tests/blobs/ RUN chmod +x /tests/test.sh