Skip to content

Commit b121fe6

Browse files
authored
Add manylinux_2_28 image (#1816)
* Add manylinux_2_28 image
1 parent 615571c commit b121fe6

File tree

3 files changed

+166
-0
lines changed

3 files changed

+166
-0
lines changed

.github/workflows/build-manywheel-images.yml

+15
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@ jobs:
107107
- name: Build Docker Image
108108
run: |
109109
manywheel/build_docker.sh
110+
build-docker-cpu-manylinux_2_28:
111+
runs-on: ubuntu-22.04
112+
env:
113+
GPU_ARCH_TYPE: cpu-manylinux_2_28
114+
steps:
115+
- name: Checkout PyTorch
116+
uses: actions/checkout@v3
117+
- name: Authenticate if WITH_PUSH
118+
run: |
119+
if [[ "${WITH_PUSH}" == true ]]; then
120+
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin
121+
fi
122+
- name: Build Docker Image
123+
run: |
124+
manywheel/build_docker.sh
110125
build-docker-cpu-aarch64:
111126
runs-on: linux.arm64.2xlarge
112127
env:

manywheel/Dockerfile_2_28

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# syntax = docker/dockerfile:experimental
2+
ARG ROCM_VERSION=3.7
3+
ARG BASE_CUDA_VERSION=11.8
4+
ARG GPU_IMAGE=amd64/almalinux:8
5+
FROM quay.io/pypa/manylinux_2_28_x86_64 as base
6+
7+
ENV LC_ALL en_US.UTF-8
8+
ENV LANG en_US.UTF-8
9+
ENV LANGUAGE en_US.UTF-8
10+
11+
ARG DEVTOOLSET_VERSION=11
12+
RUN yum install -y wget curl perl util-linux xz bzip2 git patch which perl zlib-devel yum-utils gcc-toolset-${DEVTOOLSET_VERSION}-toolchain
13+
ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH
14+
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib64:/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib:$LD_LIBRARY_PATH
15+
16+
# cmake-3.18.4 from pip
17+
RUN yum install -y python3-pip && \
18+
python3 -mpip install cmake==3.18.4 && \
19+
ln -s /usr/local/bin/cmake /usr/bin/cmake
20+
21+
FROM base as openssl
22+
# Install openssl (this must precede `build python` step)
23+
# (In order to have a proper SSL module, Python is compiled
24+
# against a recent openssl [see env vars above], which is linked
25+
# statically. We delete openssl afterwards.)
26+
ADD ./common/install_openssl.sh install_openssl.sh
27+
RUN bash ./install_openssl.sh && rm install_openssl.sh
28+
29+
30+
# remove unncessary python versions
31+
RUN rm -rf /opt/python/cp26-cp26m /opt/_internal/cpython-2.6.9-ucs2
32+
RUN rm -rf /opt/python/cp26-cp26mu /opt/_internal/cpython-2.6.9-ucs4
33+
RUN rm -rf /opt/python/cp33-cp33m /opt/_internal/cpython-3.3.6
34+
RUN rm -rf /opt/python/cp34-cp34m /opt/_internal/cpython-3.4.6
35+
36+
FROM base as cuda
37+
ARG BASE_CUDA_VERSION=11.8
38+
# Install CUDA
39+
ADD ./common/install_cuda.sh install_cuda.sh
40+
RUN bash ./install_cuda.sh ${BASE_CUDA_VERSION} && rm install_cuda.sh
41+
42+
FROM base as intel
43+
# MKL
44+
ADD ./common/install_mkl.sh install_mkl.sh
45+
RUN bash ./install_mkl.sh && rm install_mkl.sh
46+
47+
FROM base as magma
48+
ARG BASE_CUDA_VERSION=10.2
49+
# Install magma
50+
ADD ./common/install_magma.sh install_magma.sh
51+
RUN bash ./install_magma.sh ${BASE_CUDA_VERSION} && rm install_magma.sh
52+
53+
FROM base as jni
54+
# Install java jni header
55+
ADD ./common/install_jni.sh install_jni.sh
56+
ADD ./java/jni.h jni.h
57+
RUN bash ./install_jni.sh && rm install_jni.sh
58+
59+
FROM base as libpng
60+
# Install libpng
61+
ADD ./common/install_libpng.sh install_libpng.sh
62+
RUN bash ./install_libpng.sh && rm install_libpng.sh
63+
64+
FROM ${GPU_IMAGE} as common
65+
ARG DEVTOOLSET_VERSION=11
66+
ENV LC_ALL en_US.UTF-8
67+
ENV LANG en_US.UTF-8
68+
ENV LANGUAGE en_US.UTF-8
69+
RUN yum -y install epel-release
70+
RUN yum -y update
71+
RUN yum install -y \
72+
autoconf \
73+
automake \
74+
bison \
75+
bzip2 \
76+
curl \
77+
diffutils \
78+
file \
79+
git \
80+
make \
81+
patch \
82+
perl \
83+
unzip \
84+
util-linux \
85+
wget \
86+
which \
87+
xz \
88+
gcc-toolset-${DEVTOOLSET_VERSION}-toolchain
89+
90+
RUN yum install -y \
91+
https://repo.ius.io/ius-release-el7.rpm \
92+
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
93+
RUN yum swap -y git git236-core
94+
# git236+ would refuse to run git commands in repos owned by other users
95+
# Which causes version check to fail, as pytorch repo is bind-mounted into the image
96+
# Override this behaviour by treating every folder as safe
97+
# For more details see https://github.com/pytorch/pytorch/issues/78659#issuecomment-1144107327
98+
RUN git config --global --add safe.directory "*"
99+
100+
ENV SSL_CERT_FILE=/opt/_internal/certs.pem
101+
# Install LLVM version
102+
COPY --from=openssl /opt/openssl /opt/openssl
103+
COPY --from=base /opt/python /opt/python
104+
COPY --from=base /opt/_internal /opt/_internal
105+
COPY --from=base /usr/local/bin/auditwheel /usr/local/bin/auditwheel
106+
COPY --from=intel /opt/intel /opt/intel
107+
COPY --from=base /usr/local/bin/patchelf /usr/local/bin/patchelf
108+
COPY --from=libpng /usr/local/bin/png* /usr/local/bin/
109+
COPY --from=libpng /usr/local/bin/libpng* /usr/local/bin/
110+
COPY --from=libpng /usr/local/include/png* /usr/local/include/
111+
COPY --from=libpng /usr/local/include/libpng* /usr/local/include/
112+
COPY --from=libpng /usr/local/lib/libpng* /usr/local/lib/
113+
COPY --from=libpng /usr/local/lib/pkgconfig /usr/local/lib/pkgconfig
114+
COPY --from=jni /usr/local/include/jni.h /usr/local/include/jni.h
115+
116+
FROM common as cpu_final
117+
ARG BASE_CUDA_VERSION=11.8
118+
ARG DEVTOOLSET_VERSION=11
119+
# Ensure the expected devtoolset is used
120+
ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH
121+
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib64:/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib:$LD_LIBRARY_PATH
122+
# cmake
123+
RUN yum install -y cmake3 && \
124+
ln -s /usr/bin/cmake3 /usr/bin/cmake
125+
126+
127+
FROM cpu_final as cuda_final
128+
RUN rm -rf /usr/local/cuda-${BASE_CUDA_VERSION}
129+
COPY --from=cuda /usr/local/cuda-${BASE_CUDA_VERSION} /usr/local/cuda-${BASE_CUDA_VERSION}
130+
COPY --from=magma /usr/local/cuda-${BASE_CUDA_VERSION} /usr/local/cuda-${BASE_CUDA_VERSION}
131+
132+
FROM common as rocm_final
133+
ARG ROCM_VERSION=3.7
134+
# Install ROCm
135+
ADD ./common/install_rocm.sh install_rocm.sh
136+
RUN bash ./install_rocm.sh ${ROCM_VERSION} && rm install_rocm.sh
137+
# cmake is already installed inside the rocm base image, but both 2 and 3 exist
138+
# cmake3 is needed for the later MIOpen custom build, so that step is last.
139+
RUN yum install -y cmake3 && \
140+
rm -f /usr/bin/cmake && \
141+
ln -s /usr/bin/cmake3 /usr/bin/cmake
142+
ADD ./common/install_miopen.sh install_miopen.sh
143+
RUN bash ./install_miopen.sh ${ROCM_VERSION} && rm install_miopen.sh

manywheel/build_docker.sh

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ case ${GPU_ARCH_TYPE} in
2020
GPU_IMAGE=centos:7
2121
DOCKER_GPU_BUILD_ARG=" --build-arg DEVTOOLSET_VERSION=9"
2222
;;
23+
cpu-manylinux_2_28)
24+
TARGET=cpu_final
25+
DOCKER_TAG=cpu
26+
LEGACY_DOCKER_IMAGE=${DOCKER_REGISTRY}/pytorch/manylinux_2_28-cpu
27+
GPU_IMAGE=amd64/almalinux:8
28+
DOCKER_GPU_BUILD_ARG=" --build-arg DEVTOOLSET_VERSION=11"
29+
MANY_LINUX_VERSION="2_28"
30+
;;
2331
cpu-aarch64)
2432
TARGET=final
2533
DOCKER_TAG=cpu-aarch64

0 commit comments

Comments
 (0)