New strategy - do not preinstall libtorch - but try to cache it by placing it under ~/work (#8039).

This commit is contained in:
Andreas Ländle 2026-06-14 20:54:05 +02:00
parent 12bff3a2cd
commit cbae8ca357
2 changed files with 3 additions and 13 deletions

View File

@ -9,10 +9,6 @@ RUN /tmp/01-build-server.sh && rm /tmp/01-build-server.sh
COPY docker/02-apt-get-install.sh /tmp/02-apt-get-install.sh
RUN /tmp/02-apt-get-install.sh && rm /tmp/02-apt-get-install.sh
ENV LIBTORCH_VERSION=2.5.0
ENV LIBTORCH_CUDA_VERSION=cpu
ENV LIBTORCH_SKIP_DOWNLOAD=1
COPY docker/03-custom-install.sh /tmp/03-custom-install.sh
RUN /tmp/03-custom-install.sh && rm /tmp/03-custom-install.sh
@ -21,3 +17,6 @@ RUN /tmp/04-cleanup.sh && rm /tmp/04-cleanup.sh
# Include file path
ENV CPATH=/usr/lib/jvm/java-8-openjdk-amd64/include:/usr/lib/jvm/java-8-openjdk-amd64/include/linux:/usr/lib/llvm-3.7/include
# Download libtorch into mounted work volume (so that artifact is shared on rebuilds)
ENV LIBTORCH_HOME=~/work/libtorch

View File

@ -65,12 +65,3 @@ Z3_VER=4.13.4
&& rm z3-${Z3_VER}-x64-glibc-2.35.zip \
&& ln -s /usr/local/z3-${Z3_VER}-x64-glibc-2.35/bin/z3 /usr/bin/z3
)
# Install libtorch
curl -OL https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-$LIBTORCH_VERSION%2Bcpu.zip
unzip libtorch-shared-with-deps-$LIBTORCH_VERSION%2Bcpu.zip -d /usr/local/
cp -rf /usr/local/libtorch/lib/* /usr/lib/
cp -rf /usr/local/libtorch/include/* /usr/include/
cp -rf /usr/local/libtorch/include/torch/csrc/api/include/* /usr/include/
rm libtorch-shared-with-deps-$LIBTORCH_VERSION%2Bcpu.zip
rm -rf /usr/local/libtorch