-
Notifications
You must be signed in to change notification settings - Fork 227
Update s390x builder #1802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update s390x builder #1802
Changes from all commits
8c25ced
6576572
0a49514
e4ea976
c073514
02775f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
FROM --platform=linux/s390x docker.io/redhat/ubi9 as base | ||
FROM --platform=linux/s390x docker.io/ubuntu:24.04 as base | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: If it works, we can stick with ubuntu for now. Otherwise, let's use |
||
# earliest available version in ubi9 | ||
ARG DEVTOOLSET_VERSION=12 | ||
|
||
# Language variabes | ||
ENV LC_ALL=en_US.UTF-8 | ||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US.UTF-8 | ||
# Language variables | ||
ENV LC_ALL=C.UTF-8 | ||
ENV LANG=C.UTF-8 | ||
ENV LANGUAGE=C.UTF-8 | ||
|
||
# Installed needed OS packages. This is to support all | ||
# the binary builds (torch, vision, audio, text, data) | ||
RUN dnf -y install redhat-release | ||
RUN dnf -y update | ||
RUN dnf install -y --allowerasing \ | ||
RUN apt update ; apt upgrade -y | ||
RUN apt install -y \ | ||
build-essential \ | ||
autoconf \ | ||
automake \ | ||
bzip2 \ | ||
|
@@ -27,20 +24,19 @@ RUN dnf install -y --allowerasing \ | |
util-linux \ | ||
wget \ | ||
which \ | ||
xz \ | ||
xz-utils \ | ||
less \ | ||
zstd \ | ||
libgomp \ | ||
cmake \ | ||
gcc-toolset-${DEVTOOLSET_VERSION}-gcc \ | ||
gcc-toolset-${DEVTOOLSET_VERSION}-gcc-c++ \ | ||
gcc-toolset-${DEVTOOLSET_VERSION}-gcc-gfortran \ | ||
gcc-toolset-${DEVTOOLSET_VERSION}-binutils | ||
|
||
# Ensure the expected gcc-toolset is used | ||
ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH | ||
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 | ||
|
||
python3 \ | ||
python3-dev \ | ||
python3-setuptools \ | ||
python3-yaml \ | ||
python3-typing-extensions \ | ||
libblas-dev \ | ||
libopenblas-dev \ | ||
liblapack-dev \ | ||
libatlas-base-dev | ||
|
||
# git236+ would refuse to run git commands in repos owned by other users | ||
# Which causes version check to fail, as pytorch repo is bind-mounted into the image | ||
|
@@ -57,9 +53,21 @@ ADD ./common/install_openssl.sh install_openssl.sh | |
RUN bash ./install_openssl.sh && rm install_openssl.sh | ||
ENV SSL_CERT_FILE=/opt/_internal/certs.pem | ||
|
||
# EPEL for cmake | ||
FROM base as patchelf | ||
# Install patchelf | ||
ADD ./common/install_patchelf.sh install_patchelf.sh | ||
RUN bash ./install_patchelf.sh && rm install_patchelf.sh | ||
RUN cp $(which patchelf) /patchelf | ||
|
||
FROM patchelf as python | ||
# build python | ||
COPY manywheel/build_scripts /build_scripts | ||
ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh | ||
RUN bash build_scripts/build.sh && rm -r build_scripts | ||
|
||
FROM openssl as final | ||
# remove unncessary python versions | ||
RUN rm -rf /opt/python/cp26-cp26m /opt/_internal/cpython-2.6.9-ucs2 | ||
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=python /opt/python /opt/python | ||
COPY --from=python /opt/_internal /opt/_internal | ||
COPY --from=python /opt/python/cp37-cp37m/bin/auditwheel /usr/local/bin/auditwheel | ||
COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ case "${GPU_ARCH_TYPE:-BLANK}" in | |
rocm) | ||
bash "${SCRIPTPATH}/build_rocm.sh" | ||
;; | ||
cpu | cpu-cxx11-abi) | ||
cpu | cpu-cxx11-abi | cpu-s390x) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, with this change, I can remove commit pytorch/pytorch@2928b2c Or I can also drop this change and keep it as just "cpu" for s390x. But for aarch64 "cpu-aarch64" is used, so I did similar "cpu-s390x" for s390x. |
||
bash "${SCRIPTPATH}/build_cpu.sh" | ||
;; | ||
*) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a correct understanding that we can now remove this and let Docker pull figure out the correct CPU arch (s390x) corresponding to this change pytorch/pytorch@2928b2c?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, since I couldn't find where I could download built image for s390x, I just built it manually and backed it into my github actions runner docker image. So it's available locally and isn't needed to be built. I'm also fine with actually building it here and downloading it by actions runner, if it's publicly available somewhere.