File size: 4,156 Bytes
59e6862
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
02bbe23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM rust:1.97.1-bookworm
ARG PROGRAMGYM_APT_REPOSITORY_BASE_URL=""
ARG PROGRAMGYM_GOPROXY="https://proxy.golang.org,direct"
ARG PROGRAMGYM_NPM_REGISTRY="https://registry.npmjs.org/"
ARG PROGRAMGYM_NPM_STRICT_SSL="true"
ARG PROGRAMGYM_PYPI_INDEX_URL="https://pypi.org/simple"
ARG PROGRAMGYM_PYPI_TRUSTED_HOST=""
ARG PROGRAMGYM_UV_INSECURE_HOST=""
ENV GOPROXY=${PROGRAMGYM_GOPROXY}
ENV PIP_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
ENV PIP_TRUSTED_HOST=${PROGRAMGYM_PYPI_TRUSTED_HOST}
ENV UV_INDEX_URL=${PROGRAMGYM_PYPI_INDEX_URL}
ENV UV_INSECURE_HOST=${PROGRAMGYM_UV_INSECURE_HOST}
ENV npm_config_registry=${PROGRAMGYM_NPM_REGISTRY}
ENV npm_config_strict_ssl=${PROGRAMGYM_NPM_STRICT_SSL}
COPY harbor_configure_apt_mirror.sh /tmp/harbor_configure_apt_mirror.sh
RUN chmod 0755 /tmp/harbor_configure_apt_mirror.sh \
 && /bin/bash /tmp/harbor_configure_apt_mirror.sh "${PROGRAMGYM_APT_REPOSITORY_BASE_URL}" \
 && rm -f /tmp/harbor_configure_apt_mirror.sh
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 GOSUMDB=sum.golang.google.cn
ENV GOTOOLCHAIN=auto
ENV UV_CACHE_DIR=/workspace/.cache/uv
ENV npm_config_cache=/workspace/.cache/npm
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 synthetic ProgramGym adapter: run the agent as an unprivileged user.
# Keep tool/runtime state under /home/agent and reserve /workspace for the
# submission handed to the separate verifier. Keep the reference executable
# execute-only; the oracle temporarily restores owner read permission.
RUN id -u agent >/dev/null 2>&1 || useradd -m -s /bin/bash agent
RUN mkdir -p /home/agent \
 && chown -R agent:agent /home/agent /workspace \
 && chown agent:agent /workspace/executable \
 && chmod 111 /workspace/executable
ENV HOME=/home/agent
WORKDIR /workspace
RUN ["bash","-lc","rm -f -- /workspace/download.sh /tmp/programgym-download.sh /tmp/download.sh /workspace/reference/build.sh && rm -rf -- /workspace/.programgym_build_env"]