Skip to content

Commit

Permalink
[v1.x] Update CI build scripts to install python 3.6 from deadsnakes …
Browse files Browse the repository at this point in the history
…repo (apache#19788)

* Install python3.6 from deadsnakes repo, since 3.5 is EOL'd and get-pip.py no longer works with 3.5.

* Set symlink for python3 to point to newly installed 3.6 version.

* Setting symlink or using update-alternatives causes add-apt-repository to fail, so instead just set alias in environment to call the correct python version.

* Setup symlinks in /usr/local/bin, since it comes first in the path.

* Don't use absolute path for python3 executable, just use python3 from path.

Co-authored-by: Joe Evans <joeev@amazon.com>
  • Loading branch information
josephevans and Joe Evans committed Feb 24, 2021
1 parent 7e38dcb commit 65ae3a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
7 changes: 6 additions & 1 deletion ci/docker/install/ubuntu_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
set -ex
# install libraries for mxnet's python package on ubuntu
apt-get update || true
apt-get install -y python-dev python3-dev virtualenv wget
apt-get install -y software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update || true
apt-get install -y python3.6-dev virtualenv wget
# setup symlink in /usr/local/bin to override python3 version
ln -sf /usr/bin/python3.6 /usr/local/bin/python3

# the version of the pip shipped with ubuntu may be too lower, install a recent version here
wget -nv https://bootstrap.pypa.io/get-pip.py
Expand Down
18 changes: 9 additions & 9 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ build_ubuntu_cpu_cmake_debug() {
cmake \
-DUSE_CUDA=OFF \
-DUSE_TVM_OP=ON \
-DPython3_EXECUTABLE=/usr/bin/python3 \
-DPython3_EXECUTABLE=python3 \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_OPENMP=OFF \
-DUSE_OPENCV=ON \
Expand All @@ -538,7 +538,7 @@ build_ubuntu_cpu_cmake_no_tvm_op() {
cmake \
-DUSE_CUDA=OFF \
-DUSE_TVM_OP=OFF \
-DPython3_EXECUTABLE=/usr/bin/python3 \
-DPython3_EXECUTABLE=python3 \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_OPENMP=OFF \
-DUSE_OPENCV=ON \
Expand Down Expand Up @@ -874,7 +874,7 @@ build_ubuntu_gpu_cmake_mkldnn() {
-DUSE_CUDA=1 \
-DUSE_CUDNN=1 \
-DUSE_TVM_OP=0 \
-DPython3_EXECUTABLE=/usr/bin/python3 \
-DPython3_EXECUTABLE=python3 \
-DUSE_MKLML_MKL=1 \
-DCMAKE_BUILD_TYPE=Release \
-DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \
Expand All @@ -892,8 +892,8 @@ build_ubuntu_gpu_cmake() {
-DUSE_SIGNAL_HANDLER=ON \
-DUSE_CUDA=ON \
-DUSE_CUDNN=ON \
-DUSE_TVM_OP=OFF \
-DPython3_EXECUTABLE=/usr/bin/python3 \
-DUSE_TVM_OP=OFF \
-DPython3_EXECUTABLE=python3 \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_MKLML_MKL=OFF \
-DUSE_MKLDNN=OFF \
Expand All @@ -915,8 +915,8 @@ build_ubuntu_gpu_cmake_no_rtc() {
-DUSE_SIGNAL_HANDLER=ON \
-DUSE_CUDA=ON \
-DUSE_CUDNN=ON \
-DUSE_TVM_OP=OFF \
-DPython3_EXECUTABLE=/usr/bin/python3 \
-DUSE_TVM_OP=OFF \
-DPython3_EXECUTABLE=python3 \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_MKLML_MKL=OFF \
-DUSE_MKLDNN=ON \
Expand Down Expand Up @@ -956,8 +956,8 @@ build_ubuntu_gpu_large_tensor() {
-DUSE_SIGNAL_HANDLER=ON \
-DUSE_CUDA=ON \
-DUSE_CUDNN=ON \
-DUSE_TVM_OP=OFF \
-DPython3_EXECUTABLE=/usr/bin/python3 \
-DUSE_TVM_OP=OFF \
-DPython3_EXECUTABLE=python3 \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DUSE_MKLML_MKL=OFF \
-DUSE_MKLDNN=OFF \
Expand Down

0 comments on commit 65ae3a8

Please sign in to comment.