Skip to content

Commit 453da42

Browse files
Revert "ci: Add sccache to manylinux images (pytorch#148419)"
This reverts commit 1099c37. Reverted pytorch#148419 on behalf of https://github.com/atalman due to Breaks triton build ([comment](pytorch#148419 (comment)))
1 parent a439524 commit 453da42

File tree

4 files changed

+15
-71
lines changed

4 files changed

+15
-71
lines changed

.ci/docker/common/install_cache.sh

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,27 @@
22

33
set -ex
44

5-
SCCACHE_VERSION="0.9.1"
6-
7-
CARGO_FLAGS=""
8-
9-
install_prereqs_ubuntu() {
5+
install_ubuntu() {
6+
echo "Preparing to build sccache from source"
107
apt-get update
118
# libssl-dev will not work as it is upgraded to libssl3 in Ubuntu-22.04.
129
# Instead use lib and headers from OpenSSL1.1 installed in `install_openssl.sh``
1310
apt-get install -y cargo
14-
15-
# cleanup after ourselves
16-
trap 'cleanup_ubuntu' EXIT
17-
18-
echo "Downloading old sccache binary from S3 repo for PCH builds"
19-
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache-0.2.14a
20-
chmod 755 /opt/cache/bin/sccache-0.2.14a
21-
}
22-
23-
cleanup_ubuntu() {
11+
echo "Checking out sccache repo"
12+
git clone https://github.com/mozilla/sccache -b v0.9.1
13+
cd sccache
14+
echo "Building sccache"
15+
cargo build --release
16+
cp target/release/sccache /opt/cache/bin
17+
echo "Cleaning up"
18+
cd ..
2419
rm -rf sccache
2520
apt-get remove -y cargo rustc
2621
apt-get autoclean && apt-get clean
27-
}
2822

29-
install_prereqs_almalinux() {
30-
dnf install -y cargo
31-
# use vendored openssl, we're not going to use the dist-server anyways
32-
CARGO_FEATURES="--bin sccache --features openssl/vendored"
33-
}
34-
35-
build_and_install_sccache() {
36-
# modern version of git don't like openssl1.1
37-
wget -q -O sccache.tar.gz "https://github.com/mozilla/sccache/archive/refs/tags/v${SCCACHE_VERSION}.tar.gz"
38-
tar xzf sccache.tar.gz
39-
pushd "sccache-${SCCACHE_VERSION}"
40-
cargo build --release ${CARGO_FEATURES}
41-
cp target/release/sccache /opt/cache/bin
23+
echo "Downloading old sccache binary from S3 repo for PCH builds"
24+
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache-0.2.14a
25+
chmod 755 /opt/cache/bin/sccache-0.2.14a
4226
}
4327

4428
install_binary() {
@@ -51,21 +35,8 @@ mkdir -p /opt/cache/lib
5135
sed -e 's|PATH="\(.*\)"|PATH="/opt/cache/bin:\1"|g' -i /etc/environment
5236
export PATH="/opt/cache/bin:$PATH"
5337

54-
echo "Preparing to build sccache from source"
55-
DIST_ID=$(. /etc/os-release && echo "$ID")
56-
case ${DIST_ID} in
57-
ubuntu)
58-
install_prereqs_ubuntu
59-
;;
60-
almalinux)
61-
install_prereqs_almalinux
62-
;;
63-
*)
64-
echo "ERROR: Unknown distribution ${DIST_ID}"
65-
exit 1
66-
;;
67-
esac
68-
build_and_install_sccache
38+
# Setup compiler cache
39+
install_ubuntu
6940
chmod a+x /opt/cache/bin/sccache
7041

7142
function write_sccache_stub() {

.ci/docker/manywheel/Dockerfile_2_28

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ FROM base as libpng
6060
ADD ./common/install_libpng.sh install_libpng.sh
6161
RUN bash ./install_libpng.sh && rm install_libpng.sh
6262

63-
FROM base as cache
64-
# Install sccache
65-
ADD ./common/install_cache.sh install_cache.sh
66-
RUN bash ./install_cache.sh && rm install_cache.sh
67-
6863
FROM ${GPU_IMAGE} as common
6964
ARG DEVTOOLSET_VERSION=11
7065
ENV LC_ALL en_US.UTF-8
@@ -117,10 +112,6 @@ COPY --from=libpng /usr/local/include/libpng* /usr/local/
117112
COPY --from=libpng /usr/local/lib/libpng* /usr/local/lib/
118113
COPY --from=libpng /usr/local/lib/pkgconfig /usr/local/lib/pkgconfig
119114
COPY --from=jni /usr/local/include/jni.h /usr/local/include/jni.h
120-
COPY --from=cache /opt/cache /opt/cache
121-
122-
# Ensure sccache is included in the path
123-
ENV PATH /opt/cache/bin:$PATH
124115

125116
FROM common as cpu_final
126117
ARG BASE_CUDA_VERSION=11.8

.ci/docker/manywheel/Dockerfile_2_28_aarch64

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ FROM base as openblas
5959
ADD ./common/install_openblas.sh install_openblas.sh
6060
RUN bash ./install_openblas.sh && rm install_openblas.sh
6161

62-
FROM base as cache
63-
# Install sccache
64-
ADD ./common/install_cache.sh install_cache.sh
65-
RUN bash ./install_cache.sh && rm install_cache.sh
66-
6762
FROM base as final
6863

6964
# remove unncessary python versions
@@ -72,8 +67,4 @@ RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4
7267
RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6
7368
RUN rm -rf /opt/python/cp34-cp34m /opt/_internal/cpython-3.4.6
7469
COPY --from=openblas /opt/OpenBLAS/ /opt/OpenBLAS/
75-
COPY --from=cache /opt/cache /opt/cache
76-
7770
ENV LD_LIBRARY_PATH=/opt/OpenBLAS/lib:$LD_LIBRARY_PATH
78-
# Ensure sccache is included in the path
79-
ENV PATH /opt/cache/bin:$PATH

.ci/docker/manywheel/Dockerfile_s390x

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,11 @@ ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh
8686
ENV SSL_CERT_FILE=
8787
RUN bash build_scripts/build.sh && rm -r build_scripts
8888

89-
FROM base as cache
90-
# Install sccache
91-
ADD ./common/install_cache.sh install_cache.sh
92-
RUN bash ./install_cache.sh && rm install_cache.sh
93-
9489
FROM base as final
9590
COPY --from=python /opt/python /opt/python
9691
COPY --from=python /opt/_internal /opt/_internal
9792
COPY --from=python /opt/python/cp39-cp39/bin/auditwheel /usr/local/bin/auditwheel
9893
COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf
99-
COPY --from=cache /opt/cache /opt/cache
100-
101-
# Ensure sccache is included in the path
102-
ENV PATH /opt/cache/bin:$PATH
10394

10495
RUN alternatives --set python /usr/bin/python3.12
10596
RUN alternatives --set python3 /usr/bin/python3.12

0 commit comments

Comments
 (0)