This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
FROM python:3.12.12-slim-trixie AS python-deps
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
CC=clang-19 CXX=clang++-19 \
|
||||
LDFLAGS=-fuse-ld=mold \
|
||||
RUSTFLAGS="-C linker=clang-19 -C link-arg=-fuse-ld=mold" \
|
||||
CARGO_HOME=/opt/cargo RUSTUP_HOME=/opt/rustup \
|
||||
PATH=/opt/raptor/.venv/bin:/opt/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
||||
OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MPLBACKEND=Agg \
|
||||
PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 \
|
||||
HOME=/tmp XDG_CACHE_HOME=/tmp/cache MPLCONFIGDIR=/tmp/matplotlib
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential ca-certificates clang-19 curl git libomp-19-dev \
|
||||
libzstd-dev mold ninja-build pkg-config zlib1g-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/artifact
|
||||
COPY pins.env requirements.lock models.sha256 build.sh ./
|
||||
RUN python -m venv /opt/raptor/.venv \
|
||||
&& /opt/raptor/.venv/bin/python -m pip install --no-cache-dir --only-binary=onnx -r requirements.lock
|
||||
|
||||
FROM python-deps AS artifact
|
||||
ARG BUILD_JOBS
|
||||
RUN . ./pins.env && curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs -o /tmp/rustup.sh \
|
||||
&& sh /tmp/rustup.sh -y --profile minimal --default-toolchain "$RUST_VERSION" \
|
||||
&& rm /tmp/rustup.sh
|
||||
|
||||
COPY source.tar.gz source.sha256 ./
|
||||
RUN sha256sum -c source.sha256 \
|
||||
&& . ./pins.env \
|
||||
&& gzip -dc source.tar.gz > /tmp/raptor-source.tar \
|
||||
&& test "$(git get-tar-commit-id < /tmp/raptor-source.tar)" = "$RAPTOR_COMMIT" \
|
||||
&& tar -xf /tmp/raptor-source.tar -C /opt/raptor \
|
||||
&& rm source.tar.gz /tmp/raptor-source.tar
|
||||
RUN bash build.sh "${BUILD_JOBS:-$(env -u OMP_NUM_THREADS -u OMP_THREAD_LIMIT nproc)}"
|
||||
COPY validation-overlay/ ./validation-overlay/
|
||||
COPY validation-overlay.sha256 ./
|
||||
RUN sha256sum -c validation-overlay.sha256 \
|
||||
&& cp -R validation-overlay/validation/. /opt/raptor/validation/ \
|
||||
&& cp validation-overlay.sha256 /opt/artifact/provenance/
|
||||
COPY run.py plot_ablation.py ./
|
||||
|
||||
WORKDIR /opt/raptor
|
||||
ENTRYPOINT ["/opt/raptor/.venv/bin/python", "/opt/artifact/run.py"]
|
||||
CMD ["reproduce"]
|
||||
Reference in New Issue
Block a user