Revert "ci: Add sccache to manylinux images (#148419)"

This reverts commit 1099c37150.

Reverted https://github.com/pytorch/pytorch/pull/148419 on behalf of https://github.com/atalman due to Breaks triton build ([comment](https://github.com/pytorch/pytorch/pull/148419#issuecomment-2748759515))
This commit is contained in:
PyTorch MergeBot 2025-03-24 16:43:26 +00:00
parent a439524be6
commit 453da423d4
4 changed files with 15 additions and 71 deletions

View File

@ -2,45 +2,29 @@
set -ex
SCCACHE_VERSION="0.9.1"
CARGO_FLAGS=""
install_prereqs_ubuntu() {
install_ubuntu() {
echo "Preparing to build sccache from source"
apt-get update
# libssl-dev will not work as it is upgraded to libssl3 in Ubuntu-22.04.
# Instead use lib and headers from OpenSSL1.1 installed in `install_openssl.sh``
apt-get install -y cargo
# cleanup after ourselves
trap 'cleanup_ubuntu' EXIT
echo "Checking out sccache repo"
git clone https://github.com/mozilla/sccache -b v0.9.1
cd sccache
echo "Building sccache"
cargo build --release
cp target/release/sccache /opt/cache/bin
echo "Cleaning up"
cd ..
rm -rf sccache
apt-get remove -y cargo rustc
apt-get autoclean && apt-get clean
echo "Downloading old sccache binary from S3 repo for PCH builds"
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache-0.2.14a
chmod 755 /opt/cache/bin/sccache-0.2.14a
}
cleanup_ubuntu() {
rm -rf sccache
apt-get remove -y cargo rustc
apt-get autoclean && apt-get clean
}
install_prereqs_almalinux() {
dnf install -y cargo
# use vendored openssl, we're not going to use the dist-server anyways
CARGO_FEATURES="--bin sccache --features openssl/vendored"
}
build_and_install_sccache() {
# modern version of git don't like openssl1.1
wget -q -O sccache.tar.gz "https://github.com/mozilla/sccache/archive/refs/tags/v${SCCACHE_VERSION}.tar.gz"
tar xzf sccache.tar.gz
pushd "sccache-${SCCACHE_VERSION}"
cargo build --release ${CARGO_FEATURES}
cp target/release/sccache /opt/cache/bin
}
install_binary() {
echo "Downloading sccache binary from S3 repo"
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache
@ -51,21 +35,8 @@ mkdir -p /opt/cache/lib
sed -e 's|PATH="\(.*\)"|PATH="/opt/cache/bin:\1"|g' -i /etc/environment
export PATH="/opt/cache/bin:$PATH"
echo "Preparing to build sccache from source"
DIST_ID=$(. /etc/os-release && echo "$ID")
case ${DIST_ID} in
ubuntu)
install_prereqs_ubuntu
;;
almalinux)
install_prereqs_almalinux
;;
*)
echo "ERROR: Unknown distribution ${DIST_ID}"
exit 1
;;
esac
build_and_install_sccache
# Setup compiler cache
install_ubuntu
chmod a+x /opt/cache/bin/sccache
function write_sccache_stub() {

View File

@ -60,11 +60,6 @@ FROM base as libpng
ADD ./common/install_libpng.sh install_libpng.sh
RUN bash ./install_libpng.sh && rm install_libpng.sh
FROM base as cache
# Install sccache
ADD ./common/install_cache.sh install_cache.sh
RUN bash ./install_cache.sh && rm install_cache.sh
FROM ${GPU_IMAGE} as common
ARG DEVTOOLSET_VERSION=11
ENV LC_ALL en_US.UTF-8
@ -117,10 +112,6 @@ COPY --from=libpng /usr/local/include/libpng* /usr/local/
COPY --from=libpng /usr/local/lib/libpng* /usr/local/lib/
COPY --from=libpng /usr/local/lib/pkgconfig /usr/local/lib/pkgconfig
COPY --from=jni /usr/local/include/jni.h /usr/local/include/jni.h
COPY --from=cache /opt/cache /opt/cache
# Ensure sccache is included in the path
ENV PATH /opt/cache/bin:$PATH
FROM common as cpu_final
ARG BASE_CUDA_VERSION=11.8

View File

@ -59,11 +59,6 @@ FROM base as openblas
ADD ./common/install_openblas.sh install_openblas.sh
RUN bash ./install_openblas.sh && rm install_openblas.sh
FROM base as cache
# Install sccache
ADD ./common/install_cache.sh install_cache.sh
RUN bash ./install_cache.sh && rm install_cache.sh
FROM base as final
# remove unncessary python versions
@ -72,8 +67,4 @@ RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4
RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6
RUN rm -rf /opt/python/cp34-cp34m /opt/_internal/cpython-3.4.6
COPY --from=openblas /opt/OpenBLAS/ /opt/OpenBLAS/
COPY --from=cache /opt/cache /opt/cache
ENV LD_LIBRARY_PATH=/opt/OpenBLAS/lib:$LD_LIBRARY_PATH
# Ensure sccache is included in the path
ENV PATH /opt/cache/bin:$PATH

View File

@ -86,20 +86,11 @@ ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh
ENV SSL_CERT_FILE=
RUN bash build_scripts/build.sh && rm -r build_scripts
FROM base as cache
# Install sccache
ADD ./common/install_cache.sh install_cache.sh
RUN bash ./install_cache.sh && rm install_cache.sh
FROM base as final
COPY --from=python /opt/python /opt/python
COPY --from=python /opt/_internal /opt/_internal
COPY --from=python /opt/python/cp39-cp39/bin/auditwheel /usr/local/bin/auditwheel
COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf
COPY --from=cache /opt/cache /opt/cache
# Ensure sccache is included in the path
ENV PATH /opt/cache/bin:$PATH
RUN alternatives --set python /usr/bin/python3.12
RUN alternatives --set python3 /usr/bin/python3.12