onnxruntime/tools/ci_build/github/linux/docker/manylinux.patch
Changming Sun 7b4ce0c1e1
Delete the build scripts that were copied from manylinux project (#12358)
1. Delete the build scripts that were copied from manylinux project. Use "git checkout" instead.
2. Update manylinux version to get python 3.11. Related issue: Python 3.11 support #12343
3. Change the cuda version of linux gpu build job of nuget packaging pipeline from cuda 11.4 to cuda 11.6 to match the TRT job within the same pipeline.. (A lot other places need be updated as well, but I'd prefer to put them in another PR)
4. Make dockerfile names static. For example, replace tools/ci_build/github/linux/docker/$(DockerFile) to tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cpu . The former one relies on a runtime variable $(DockerFile), Template Parameters are expanded early in processing a pipeline run when most variables are not available. It like C++ macros vs variables.
2022-07-29 18:24:19 -07:00

195 lines
10 KiB
Diff

diff -ur /home/chasun/manylinux/docker/build_scripts/build-cpython.sh ./build-cpython.sh
--- /home/chasun/manylinux/docker/build_scripts/build-cpython.sh 2022-07-29 02:19:20.983860581 +0000
+++ ./build-cpython.sh 2022-07-29 02:19:30.831732784 +0000
@@ -52,7 +52,7 @@
CFLAGS_NODIST="${MANYLINUX_CFLAGS} ${MANYLINUX_CPPFLAGS}" \
LDFLAGS_NODIST="${MANYLINUX_LDFLAGS}" \
--prefix=${PREFIX} --disable-shared --with-ensurepip=no > /dev/null
-make > /dev/null
+make -j$(nproc) > /dev/null
make install > /dev/null
if [ "${AUDITWHEEL_POLICY}" == "manylinux2010" ]; then
rm -f /usr/include/ffi.h /usr/include/ffitarget.h
diff -ur /home/chasun/manylinux/docker/build_scripts/build-git.sh ./build-git.sh
--- /home/chasun/manylinux/docker/build_scripts/build-git.sh 2022-07-29 02:19:20.983860581 +0000
+++ ./build-git.sh 2022-07-29 02:19:46.127533315 +0000
@@ -27,7 +27,7 @@
check_sha256sum ${GIT_ROOT}.tar.gz ${GIT_HASH}
tar -xzf ${GIT_ROOT}.tar.gz
pushd ${GIT_ROOT}
-make install prefix=/usr/local NO_GETTEXT=1 NO_TCLTK=1 DESTDIR=/manylinux-rootfs CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS}" CXXFLAGS="${MANYLINUX_CXXFLAGS}" LDFLAGS="${MANYLINUX_LDFLAGS}"
+make -j$(nproc) install prefix=/usr/local NO_GETTEXT=1 NO_TCLTK=1 DESTDIR=/manylinux-rootfs CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS}" CXXFLAGS="${MANYLINUX_CXXFLAGS}" LDFLAGS="${MANYLINUX_LDFLAGS}"
popd
rm -rf ${GIT_ROOT} ${GIT_ROOT}.tar.gz
diff -ur /home/chasun/manylinux/docker/build_scripts/build-openssl.sh ./build-openssl.sh
--- /home/chasun/manylinux/docker/build_scripts/build-openssl.sh 2022-07-29 02:19:20.983860581 +0000
+++ ./build-openssl.sh 2022-07-29 02:19:46.127533315 +0000
@@ -42,7 +42,7 @@
tar -xzf ${OPENSSL_ROOT}.tar.gz
pushd ${OPENSSL_ROOT}
./config no-shared --prefix=/usr/local/ssl --openssldir=/usr/local/ssl CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS} -fPIC" CXXFLAGS="${MANYLINUX_CXXFLAGS} -fPIC" LDFLAGS="${MANYLINUX_LDFLAGS} -fPIC" > /dev/null
-make > /dev/null
+make -j$(nproc) > /dev/null
make install_sw > /dev/null
popd
rm -rf ${OPENSSL_ROOT} ${OPENSSL_ROOT}.tar.gz
diff -ur /home/chasun/manylinux/docker/build_scripts/build_utils.sh ./build_utils.sh
--- /home/chasun/manylinux/docker/build_scripts/build_utils.sh 2022-07-29 02:19:20.983860581 +0000
+++ ./build_utils.sh 2022-07-29 02:19:58.119376443 +0000
@@ -33,6 +33,7 @@
if [ -f ${file} ]; then
echo "${file} exists, skipping fetch"
else
+ apt-get update && apt-get install -y curl gpg-agent
curl -fsSL -o ${file} ${url}/${file}
fi
}
@@ -52,7 +53,7 @@
function do_standard_install {
./configure "$@" CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS}" "CXXFLAGS=${MANYLINUX_CXXFLAGS}" LDFLAGS="${MANYLINUX_LDFLAGS}" > /dev/null
- make > /dev/null
+ make -j$(nproc) > /dev/null
make install > /dev/null
}
diff -ur /home/chasun/manylinux/docker/build_scripts/install-build-packages.sh ./install-build-packages.sh
--- /home/chasun/manylinux/docker/build_scripts/install-build-packages.sh 2022-07-29 02:19:20.983860581 +0000
+++ ./install-build-packages.sh 2022-07-29 02:19:58.119376443 +0000
@@ -20,7 +20,7 @@
else
COMPILE_DEPS="${COMPILE_DEPS} libdb-devel"
fi
-elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ]; then
+elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_27" ]; then
PACKAGE_MANAGER=apt
COMPILE_DEPS="libbz2-dev libncurses5-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev liblzma-dev openssl libssl-dev libkeyutils-dev libkrb5-dev comerr-dev libidn2-0-dev libcurl4-openssl-dev uuid-dev libffi-dev linux-kernel-headers"
elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then
diff -ur /home/chasun/manylinux/docker/build_scripts/install-entrypoint.sh ./install-entrypoint.sh
--- /home/chasun/manylinux/docker/build_scripts/install-entrypoint.sh 2022-07-19 21:37:58.452393854 +0000
+++ ./install-entrypoint.sh 2022-07-29 02:19:58.119376443 +0000
@@ -11,18 +11,24 @@
if [ "${AUDITWHEEL_PLAT}" = "manylinux2010_i686" ] || [ "${AUDITWHEEL_PLAT}" = "manylinux2014_i686" ]; then
- echo "i386" > /etc/yum/vars/basearch
- fixup-mirrors
- yum -y update
- fixup-mirrors
- yum install -y util-linux-ng
- # update system packages, we already updated them but
- # the following script takes care of cleaning-up some things
- # and since it's also needed in the finalize step, everything's
- # centralized in this script to avoid code duplication
- LC_ALL=C "${MY_DIR}/update-system-packages.sh"
+ echo "i386" > /etc/yum/vars/basearch
+ fixup-mirrors
+ yum -y update
+ fixup-mirrors
+ yum install -y util-linux-ng
+ # update system packages, we already updated them but
+ # the following script takes care of cleaning-up some things
+ # and since it's also needed in the finalize step, everything's
+ # centralized in this script to avoid code duplication
+ LC_ALL=C "${MY_DIR}/update-system-packages.sh"
fi
if [ "${AUDITWHEEL_POLICY}" = "musllinux_1_1" ]; then
- apk add --no-cache bash
+ apk add --no-cache bash
+fi
+
+# https://www.shellcheck.net/wiki/SC3020
+if command -v yum 2>&1 ; then
+ yum install -y yum-plugin-versionlock
+ yum versionlock cuda* libcudnn* libnccl*
fi
diff -ur /home/chasun/manylinux/docker/build_scripts/install-runtime-packages.sh ./install-runtime-packages.sh
--- /home/chasun/manylinux/docker/build_scripts/install-runtime-packages.sh 2022-07-29 02:19:20.983860581 +0000
+++ ./install-runtime-packages.sh 2022-07-29 02:19:58.119376443 +0000
@@ -34,7 +34,7 @@
# MANYLINUX_DEPS: Install development packages (except for libgcc which is provided by gcc install)
if [ "${AUDITWHEEL_POLICY}" == "manylinux2010" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then
MANYLINUX_DEPS="glibc-devel libstdc++-devel glib2-devel libX11-devel libXext-devel libXrender-devel mesa-libGL-devel libICE-devel libSM-devel zlib-devel expat-devel"
-elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ]; then
+elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_27" ]; then
MANYLINUX_DEPS="libc6-dev libstdc++-6-dev libglib2.0-dev libx11-dev libxext-dev libxrender-dev libgl1-mesa-dev libice-dev libsm-dev libz-dev libexpat1-dev"
elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then
MANYLINUX_DEPS="musl-dev libstdc++ glib-dev libx11-dev libxext-dev libxrender-dev mesa-dev libice-dev libsm-dev zlib-dev expat-dev"
@@ -53,6 +53,9 @@
fi
elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ]; then
RUNTIME_DEPS="zlib1g libbz2-1.0 libexpat1 libncurses5 libreadline7 tk libgdbm3 libdb5.3 libpcap0.8 liblzma5 libssl1.1 libkeyutils1 libkrb5-3 libcomerr2 libidn2-0 libcurl3 uuid libffi6"
+elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_27" ]; then
+ # remove libgdbm3
+ RUNTIME_DEPS="zlib1g libbz2-1.0 libexpat1 libncurses5 libreadline7 tk libdb5.3 libpcap0.8 liblzma5 libssl1.1 libkeyutils1 libkrb5-3 libcomerr2 libidn2-0 libcurl3 uuid libffi6"
elif [ "${AUDITWHEEL_POLICY}" == "musllinux_1_1" ]; then
RUNTIME_DEPS="zlib bzip2 expat ncurses5-libs readline tk gdbm db xz openssl keyutils-libs krb5-libs libcom_err libidn2 libcurl libuuid libffi"
else
@@ -96,12 +99,22 @@
yum -y update
yum -y install yum-utils curl
yum-config-manager --enable extras
- TOOLCHAIN_DEPS="devtoolset-10-binutils devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-gcc-gfortran"
+
+ #Added by @snnn
+ if [ -d "/usr/local/cuda-10.2" ]; then
+ TOOLCHAIN_DEPS="devtoolset-8-binutils devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-gcc-gfortran"
+ elif [ -d "/usr/local/cuda-11.1" ]; then
+ TOOLCHAIN_DEPS="devtoolset-9-binutils devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-gcc-gfortran"
+ else
+ TOOLCHAIN_DEPS="devtoolset-10-binutils devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-gcc-gfortran"
+ fi
if [ "${AUDITWHEEL_ARCH}" == "x86_64" ]; then
# Software collection (for devtoolset-10)
yum -y install centos-release-scl-rh
# EPEL support (for yasm)
- yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+ if ! rpm -q --quiet epel-release ; then
+ yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+ fi
TOOLCHAIN_DEPS="${TOOLCHAIN_DEPS} yasm"
elif [ "${AUDITWHEEL_ARCH}" == "aarch64" ] || [ "${AUDITWHEEL_ARCH}" == "ppc64le" ] || [ "${AUDITWHEEL_ARCH}" == "s390x" ]; then
# Software collection (for devtoolset-10)
@@ -111,7 +124,7 @@
# Install mayeut/devtoolset-10 repo to get devtoolset-10
curl -fsSLo /etc/yum.repos.d/mayeut-devtoolset-10.repo https://copr.fedorainfracloud.org/coprs/mayeut/devtoolset-10/repo/custom-1/mayeut-devtoolset-10-custom-1.repo
fi
-elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ]; then
+elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_27" ]; then
PACKAGE_MANAGER=apt
BASETOOLS="${BASETOOLS} hardlink hostname"
export DEBIAN_FRONTEND=noninteractive
diff -ur /home/chasun/manylinux/docker/build_scripts/python-tag-abi-tag.py ./python-tag-abi-tag.py
--- /home/chasun/manylinux/docker/build_scripts/python-tag-abi-tag.py 2022-07-19 21:37:58.452393854 +0000
+++ ./python-tag-abi-tag.py 2022-07-29 02:19:58.119376443 +0000
@@ -4,7 +4,6 @@
from wheel.vendored.packaging.tags import sys_tags
-
# first tag is always the more specific tag
tag = next(sys_tags())
print("{0}-{1}".format(tag.interpreter, tag.abi))
diff -ur /home/chasun/manylinux/docker/build_scripts/update-system-packages.sh ./update-system-packages.sh
--- /home/chasun/manylinux/docker/build_scripts/update-system-packages.sh 2022-07-29 02:19:20.987860529 +0000
+++ ./update-system-packages.sh 2022-07-29 02:19:58.119376443 +0000
@@ -20,7 +20,7 @@
fi
yum clean all
rm -rf /var/cache/yum
-elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ]; then
+elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_27" ]; then
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get upgrade -qq -y
@@ -60,7 +60,7 @@
if [ "${AUDITWHEEL_POLICY}" == "manylinux2010" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then
mv -f ${LOCALE_ARCHIVE} ${LOCALE_ARCHIVE}.tmpl
build-locale-archive --install-langs="en_US.utf8"
- elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ]; then
+ elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_24" ] || [ "${AUDITWHEEL_POLICY}" == "manylinux_2_27" ]; then
rm ${LOCALE_ARCHIVE}
localedef -i en_US -f UTF-8 en_US.UTF-8
update-locale LANG=en_US.UTF-8