mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Upgrade old Python version in packaging pipeline (#16667)
- Upgrade from Python 3.6 to 3.8 in packaging pipeline. - Raise build.py minimum required Python version.
This commit is contained in:
parent
b8c40b7813
commit
df8843c4a7
8 changed files with 30 additions and 22 deletions
|
|
@ -1,12 +0,0 @@
|
|||
:: Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
:: Licensed under the MIT License.
|
||||
|
||||
rem This will setup the VC env vars to use the 14.11 (VS2017 ver15.3) toolchain which is supported by CUDA 9.2 prior to running build.py.
|
||||
rem It currently defaults to amd64 but that could be made configurable if that would be useful to developers running this locally.
|
||||
@echo off
|
||||
|
||||
rem Use 14.11 toolset
|
||||
call "%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" amd64 -vcvars_ver=14.11
|
||||
|
||||
rem Requires a python 3.6 or higher install to be available in your PATH
|
||||
python %~dp0\tools\ci_build\build.py --build_dir %~dp0\build\Windows %*
|
||||
|
|
@ -2,5 +2,5 @@
|
|||
:: Licensed under the MIT License.
|
||||
|
||||
@echo off
|
||||
rem Requires a python 3.6 or higher install to be available in your PATH
|
||||
rem Requires a Python install to be available in your PATH
|
||||
python "%~dp0\tools\ci_build\build.py" --build_dir "%~dp0\build\Windows" %*
|
||||
|
|
|
|||
1
build.sh
1
build.sh
|
|
@ -18,5 +18,4 @@ elif [[ "$*" == *"--android"* ]]; then
|
|||
DIR_OS="Android"
|
||||
fi
|
||||
|
||||
#requires python3.6 or higher
|
||||
python3 $DIR/tools/ci_build/build.py --build_dir $DIR/build/$DIR_OS "$@"
|
||||
|
|
|
|||
|
|
@ -46,8 +46,7 @@ class UsageError(BaseError):
|
|||
|
||||
|
||||
def _check_python_version():
|
||||
# TODO Upgrade this, Python 3.6 is no longer supported. However, some packaging pipelines are still using it.
|
||||
required_minor_version = 6
|
||||
required_minor_version = 7
|
||||
if (sys.version_info.major, sys.version_info.minor) < (3, required_minor_version):
|
||||
raise UsageError(
|
||||
f"Invalid Python version. At least Python 3.{required_minor_version} is required. "
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ os_major_version=$(cat /etc/redhat-release | tr -dc '0-9.'|cut -d \. -f1)
|
|||
|
||||
echo "installing for CentOS version : $os_major_version"
|
||||
yum install -y centos-release-scl-rh
|
||||
yum install -y which gdb redhat-lsb-core expat-devel tar unzip zlib-devel make libunwind bzip2 bzip2-devel java-11-openjdk-devel graphviz devtoolset-10-binutils devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-gcc-gfortran python3 python3-pip
|
||||
yum install -y which gdb redhat-lsb-core expat-devel tar unzip zlib-devel make libunwind bzip2 bzip2-devel java-11-openjdk-devel graphviz devtoolset-10-binutils devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-gcc-gfortran
|
||||
|
||||
pip3 install --upgrade pip
|
||||
localedef -i en_US -f UTF-8 en_US.UTF-8
|
||||
|
|
|
|||
|
|
@ -45,10 +45,11 @@ tar -zxf /tmp/src/cmake-3.26.3-linux-`uname -m`.tar.gz --strip=1 -C /usr
|
|||
echo "Installing Ninja"
|
||||
GetFile https://github.com/ninja-build/ninja/archive/v1.10.0.tar.gz /tmp/src/ninja-linux.tar.gz
|
||||
tar -zxf ninja-linux.tar.gz
|
||||
cd ninja-1.10.0
|
||||
pushd ninja-1.10.0
|
||||
cmake -Bbuild-cmake -H.
|
||||
cmake --build build-cmake
|
||||
mv ./build-cmake/ninja /usr/bin
|
||||
popd
|
||||
|
||||
echo "Installing Node.js"
|
||||
CPU_ARCH=`uname -m`
|
||||
|
|
@ -62,5 +63,16 @@ fi
|
|||
GetFile https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-${NODEJS_ARCH}.tar.gz /tmp/src/node-v16.14.2-linux-${NODEJS_ARCH}.tar.gz
|
||||
tar --strip 1 -xf /tmp/src/node-v16.14.2-linux-${NODEJS_ARCH}.tar.gz -C /usr
|
||||
|
||||
# The Python version in CentOS 7's python3 package is no longer supported (3.6) so we will build Python from source.
|
||||
echo "Installing Python"
|
||||
PYTHON_VERSION="3.8.17"
|
||||
GetFile https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz /tmp/src/Python-${PYTHON_VERSION}.tgz
|
||||
tar -zxf Python-${PYTHON_VERSION}.tgz
|
||||
pushd Python-${PYTHON_VERSION}
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
popd
|
||||
|
||||
cd /
|
||||
rm -rf /tmp/src
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ os_major_version=$(cat /etc/redhat-release | tr -dc '0-9.'|cut -d \. -f1)
|
|||
|
||||
echo "installing for CentOS version : $os_major_version"
|
||||
yum install -y centos-release-scl-rh
|
||||
yum install -y which gdb redhat-lsb-core expat-devel tar unzip zlib-devel make libunwind bzip2 bzip2-devel java-11-openjdk-devel graphviz devtoolset-11-binutils devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-gcc-gfortran python3 python3-pip
|
||||
yum install -y which gdb redhat-lsb-core expat-devel tar unzip zlib-devel make libunwind bzip2 bzip2-devel java-11-openjdk-devel graphviz devtoolset-11-binutils devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-gcc-gfortran
|
||||
|
||||
pip3 install --upgrade pip
|
||||
localedef -i en_US -f UTF-8 en_US.UTF-8
|
||||
|
|
|
|||
|
|
@ -45,10 +45,11 @@ tar -zxf /tmp/src/cmake-3.26.3-linux-`uname -m`.tar.gz --strip=1 -C /usr
|
|||
echo "Installing Ninja"
|
||||
GetFile https://github.com/ninja-build/ninja/archive/v1.10.0.tar.gz /tmp/src/ninja-linux.tar.gz
|
||||
tar -zxf ninja-linux.tar.gz
|
||||
cd ninja-1.10.0
|
||||
pushd ninja-1.10.0
|
||||
cmake -Bbuild-cmake -H.
|
||||
cmake --build build-cmake
|
||||
mv ./build-cmake/ninja /usr/bin
|
||||
popd
|
||||
|
||||
echo "Installing Node.js"
|
||||
CPU_ARCH=`uname -m`
|
||||
|
|
@ -62,5 +63,16 @@ fi
|
|||
GetFile https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-${NODEJS_ARCH}.tar.gz /tmp/src/node-v16.14.2-linux-${NODEJS_ARCH}.tar.gz
|
||||
tar --strip 1 -xf /tmp/src/node-v16.14.2-linux-${NODEJS_ARCH}.tar.gz -C /usr
|
||||
|
||||
# The Python version in CentOS 7's python3 package is no longer supported (3.6) so we will build Python from source.
|
||||
echo "Installing Python"
|
||||
PYTHON_VERSION="3.8.17"
|
||||
GetFile https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz /tmp/src/Python-${PYTHON_VERSION}.tgz
|
||||
tar -zxf Python-${PYTHON_VERSION}.tgz
|
||||
pushd Python-${PYTHON_VERSION}
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
popd
|
||||
|
||||
cd /
|
||||
rm -rf /tmp/src
|
||||
|
|
|
|||
Loading…
Reference in a new issue