FROM ubuntu:22.04 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 PAGER=cat ENV MANPAGER=cat ENV LESS=-R ENV TQDM_DISABLE=1 RUN apt-get update && apt-get install -y --no-install-recommends bash build-essential ca-certificates git make pkg-config python3 python3-pip autoconf automake gettext file binutils g++ libtool libncurses-dev meson ninja-build unzip wget curl xz-utils bzip2 zip zstd patch python3-pytest python3-pytest-xdist python3-coverage tar && rm -rf /var/lib/apt/lists/* ARG CMAKE_VERSION=3.31.12 RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) CMAKE_ARCH="x86_64" ;; arm64) CMAKE_ARCH="aarch64" ;; *) echo "unsupported architecture for CMake: ${ARCH}" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.tar.gz"; rm -rf /opt/cmake; mkdir -p /opt/cmake; tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /opt/cmake; ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake; ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest; ln -sf /opt/cmake/bin/cpack /usr/local/bin/cpack; rm -f /tmp/cmake.tar.gz; cmake --version ARG GCC_VERSION=13.3.0 RUN set -eux; ARCH="$(dpkg --print-architecture)"; case "${ARCH}" in amd64) GCC_ARCH="x64" ;; arm64) GCC_ARCH="arm64" ;; *) echo "unsupported architecture for GCC 13: ${ARCH}" >&2; exit 1 ;; esac; wget -O /tmp/gcc.tar.gz "https://github.com/xpack-dev-tools/gcc-xpack/releases/download/v13.3.0-2/xpack-gcc-13.3.0-2-linux-${GCC_ARCH}.tar.gz"; rm -rf /opt/gcc-13; mkdir -p /opt/gcc-13; tar -xzf /tmp/gcc.tar.gz --strip-components=1 -C /opt/gcc-13; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/c++; ln -sf /opt/gcc-13/bin/gcc /usr/local/bin/gcc-13; ln -sf /opt/gcc-13/bin/g++ /usr/local/bin/g++-13; for PROGRAMGYM_GCOV_TOOL in gcov gcov-dump gcov-tool; do if [ -x "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" ]; then ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/local/bin/${PROGRAMGYM_GCOV_TOOL}-13"; ln -sf "/opt/gcc-13/bin/${PROGRAMGYM_GCOV_TOOL}" "/usr/bin/${PROGRAMGYM_GCOV_TOOL}"; fi; done; ln -sf /opt/gcc-13/bin/gcc /usr/bin/gcc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/g++; ln -sf /opt/gcc-13/bin/gcc /usr/bin/cc; ln -sf /opt/gcc-13/bin/g++ /usr/bin/c++; rm -f /tmp/gcc.tar.gz; gcc --version; g++ --version; gcov --version; command -v gcov-dump >/dev/null && gcov-dump --version | head -n 1 || true WORKDIR /workspace ADD workspace.tar.gz /workspace/ COPY executable /workspace/executable COPY download.sh /workspace/download.sh RUN chmod 755 /workspace/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 /workspace/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"]