|
1 | | -FROM --platform=linux/ppc64le docker.io/ubuntu:24.04 as base |
| 1 | + FROM --platform=linux/ppc64le docker.io/ubuntu:24.04 as base |
2 | 2 |
|
3 | | -# Language variables |
4 | | -ENV LC_ALL=C.UTF-8 |
5 | | -ENV LANG=C.UTF-8 |
6 | | -ENV LANGUAGE=C.UTF-8 |
| 3 | + # Language variables |
| 4 | + ENV LC_ALL=C.UTF-8 |
| 5 | + ENV LANG=C.UTF-8 |
| 6 | + ENV LANGUAGE=C.UTF-8 |
7 | 7 |
|
8 | | -# Installed needed OS packages. This is to support all |
9 | | -# the binary builds (torch, vision, audio, text, data) |
10 | | -RUN apt update && apt upgrade -y && \ |
11 | | - apt install -y \ |
12 | | - build-essential \ |
13 | | - sudo \ |
14 | | - autoconf \ |
15 | | - automake \ |
16 | | - bzip2 \ |
17 | | - curl \ |
18 | | - diffutils \ |
19 | | - file \ |
20 | | - git \ |
21 | | - make \ |
22 | | - patch \ |
23 | | - perl \ |
24 | | - unzip \ |
25 | | - util-linux \ |
26 | | - wget \ |
27 | | - which \ |
28 | | - xz-utils \ |
29 | | - less \ |
30 | | - zstd \ |
31 | | - cmake \ |
32 | | - python3 \ |
33 | | - python3-dev \ |
34 | | - python3-setuptools \ |
35 | | - python3-yaml \ |
36 | | - python3-typing-extensions \ |
37 | | - libblas-dev \ |
38 | | - libopenblas-dev \ |
39 | | - liblapack-dev \ |
40 | | - libatlas-base-dev \ |
41 | | - linux-headers-generic \ |
42 | | - zlib1g-dev \ |
43 | | - libbz2-1.0 \ |
44 | | - libncurses5-dev \ |
45 | | - libsqlite3-dev \ |
46 | | - libdb-dev \ |
47 | | - libpcap-dev \ |
48 | | - liblzma-dev \ |
49 | | - libffi-dev || echo "Some packages could not be installed but are non-critical." |
| 8 | + # Installed needed OS packages. This is to support all |
| 9 | + # the binary builds (torch, vision, audio, text, data) |
| 10 | + RUN apt update && apt upgrade -y && \ |
| 11 | + apt install -y \ |
| 12 | + build-essential \ |
| 13 | + sudo \ |
| 14 | + autoconf \ |
| 15 | + automake \ |
| 16 | + bzip2 \ |
| 17 | + curl \ |
| 18 | + diffutils \ |
| 19 | + file \ |
| 20 | + git \ |
| 21 | + make \ |
| 22 | + patch \ |
| 23 | + perl \ |
| 24 | + unzip \ |
| 25 | + util-linux \ |
| 26 | + wget \ |
| 27 | + which \ |
| 28 | + xz-utils \ |
| 29 | + less \ |
| 30 | + zstd \ |
| 31 | + cmake \ |
| 32 | + python3 \ |
| 33 | + python3-dev \ |
| 34 | + python3-setuptools \ |
| 35 | + python3-yaml \ |
| 36 | + python3-typing-extensions \ |
| 37 | + libblas-dev \ |
| 38 | + libopenblas-dev \ |
| 39 | + liblapack-dev \ |
| 40 | + libatlas-base-dev \ |
| 41 | + linux-headers-generic \ |
| 42 | + zlib1g-dev \ |
| 43 | + libbz2-1.0 \ |
| 44 | + libncurses5-dev \ |
| 45 | + libsqlite3-dev \ |
| 46 | + libdb-dev \ |
| 47 | + libpcap-dev \ |
| 48 | + liblzma-dev \ |
| 49 | + libffi-dev || echo "Some packages could not be installed but are non-critical." |
50 | 50 |
|
51 | | -# Handle linux-headers installation gracefully |
52 | | -RUN apt-get update && \ |
53 | | - (apt install -y linux-headers-$(uname -r) || apt install -y linux-headers-generic || \ |
54 | | - echo "Skipping linux-headers installation as it is not critical") && \ |
55 | | - apt-get clean && rm -rf /var/lib/apt/lists/* |
| 51 | + # Handle linux-headers installation gracefully |
| 52 | + RUN apt-get update && \ |
| 53 | + (apt install -y linux-headers-$(uname -r) || apt install -y linux-headers-generic || \ |
| 54 | + echo "Skipping linux-headers installation as it is not critical") && \ |
| 55 | + apt-get clean && rm -rf /var/lib/apt/lists/* |
56 | 56 |
|
57 | | -# git236+ would refuse to run git commands in repos owned by other users |
58 | | -# Which causes version check to fail, as pytorch repo is bind-mounted into the image |
59 | | -# Override this behaviour by treating every folder as safe |
60 | | -# For more details see https://github.com/pytorch/pytorch/issues/78659#issuecomment-1144107327 |
61 | | -# Confirm git installation to prevent further issues |
62 | | -RUN git --version || (echo "Git installation failed!" && exit 1) |
63 | | -RUN git config --global --add safe.directory "*" |
| 57 | + # git236+ would refuse to run git commands in repos owned by other users |
| 58 | + # Which causes version check to fail, as pytorch repo is bind-mounted into the image |
| 59 | + # Override this behaviour by treating every folder as safe |
| 60 | + # For more details see https://github.com/pytorch/pytorch/issues/78659#issuecomment-1144107327 |
| 61 | + # Confirm git installation to prevent further issues |
| 62 | + RUN git --version || (echo "Git installation failed!" && exit 1) |
| 63 | + RUN git config --global --add safe.directory "*" |
64 | 64 |
|
65 | | -FROM base as openssl |
66 | | -# Install openssl (this must precede `build python` step) |
67 | | -# (In order to have a proper SSL module, Python is compiled |
68 | | -# against a recent openssl [see env vars above], which is linked |
69 | | -# statically. We delete openssl afterwards.) |
| 65 | + FROM base as openssl |
| 66 | + # Install openssl (this must precede `build python` step) |
| 67 | + # (In order to have a proper SSL module, Python is compiled |
| 68 | + # against a recent openssl [see env vars above], which is linked |
| 69 | + # statically. We delete openssl afterwards.) |
70 | 70 |
|
71 | | -# Set ulimit to avoid segmentation fault due to resource limits |
72 | | -RUN ulimit -s unlimited |
| 71 | + # Set ulimit to avoid segmentation fault due to resource limits |
| 72 | + RUN ulimit -s unlimited |
73 | 73 |
|
74 | | -ADD ./common/install_openssl-ppc64le.sh install_openssl.sh |
75 | | -RUN export CFLAGS="-O0" && \ |
76 | | - bash ./install_openssl.sh && rm install_openssl.sh |
77 | | -ENV SSL_CERT_FILE=/opt/_internal/certs.pem |
| 74 | + ADD ./common/install_openssl-ppc64le.sh install_openssl.sh |
| 75 | + RUN export CFLAGS="-O0" && \ |
| 76 | + bash ./install_openssl.sh && rm install_openssl.sh |
| 77 | + ENV SSL_CERT_FILE=/opt/_internal/certs.pem |
78 | 78 |
|
79 | | -# EPEL for cmake |
80 | | -FROM base as patchelf |
81 | | -# Install patchelf |
82 | | -ADD ./common/install_patchelf.sh install_patchelf.sh |
83 | | -RUN bash ./install_patchelf.sh && rm install_patchelf.sh |
84 | | -RUN cp $(which patchelf) /patchelf |
| 79 | + # EPEL for cmake |
| 80 | + FROM base as patchelf |
| 81 | + # Install patchelf |
| 82 | + ADD ./common/install_patchelf.sh install_patchelf.sh |
| 83 | + RUN bash ./install_patchelf.sh && rm install_patchelf.sh |
| 84 | + RUN cp $(which patchelf) /patchelf |
85 | 85 |
|
86 | | -FROM patchelf as python |
87 | | -# build python |
88 | | -COPY manywheel/build_scripts /build_scripts |
89 | | -ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh |
90 | | -RUN bash build_scripts/build.sh && rm -r build_scripts |
| 86 | + FROM patchelf as python |
| 87 | + # build python |
| 88 | + COPY manywheel/build_scripts /build_scripts |
| 89 | + ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh |
| 90 | + RUN bash build_scripts/build.sh && rm -r build_scripts |
91 | 91 |
|
92 | | -FROM openssl as final |
93 | | -COPY --from=python /opt/python /opt/python |
94 | | -COPY --from=python /opt/_internal /opt/_internal |
95 | | -COPY --from=python /opt/python/cp39-cp39/bin/auditwheel /usr/local/bin/auditwheel |
96 | | -COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf |
| 92 | + FROM openssl as final |
| 93 | + COPY --from=python /opt/python /opt/python |
| 94 | + COPY --from=python /opt/_internal /opt/_internal |
| 95 | + COPY --from=python /opt/python/cp39-cp39/bin/auditwheel /usr/local/bin/auditwheel |
| 96 | + COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf |
0 commit comments