[CI] Build a Python wheel for aarch64 platform (#6253)

This commit is contained in:
Philip Hyunsu Cho
2020-10-18 22:35:19 -07:00
committed by GitHub
parent 5037abeb86
commit 7f6ed5780c
7 changed files with 150 additions and 36 deletions

View File

@@ -9,11 +9,7 @@ if [ ${TASK} == "python_sdist_test" ]; then
conda activate python3
python --version
conda install numpy scipy
if [ ${TRAVIS_CPU_ARCH} == "arm64" ]; then
conda install cmake
cmake --version
fi
cmake --version
make pippack
python -m pip install xgboost-*.tar.gz -v --user
@@ -28,34 +24,47 @@ if [ ${TASK} == "python_test" ]; then
fi
set -e
# Build/test
rm -rf build
mkdir build && cd build
cmake .. -DUSE_OPENMP=ON -DCMAKE_VERBOSE_MAKEFILE=ON
make -j$(nproc)
echo "-------------------------------"
conda activate python3
conda --version
python --version
# Build binary wheel
cd ../python-package
python setup.py bdist_wheel
TAG=macosx_10_13_x86_64.macosx_10_14_x86_64.macosx_10_15_x86_64
python ../tests/ci_build/rename_whl.py dist/*.whl ${TRAVIS_COMMIT} ${TAG}
python -m pip install ./dist/xgboost-*-py3-none-${TAG}.whl
if [ ${TRAVIS_CPU_ARCH} == "arm64" ]; then
# Build manylinux2014 wheel on ARM64
tests/ci_build/ci_build.sh aarch64 docker tests/ci_build/build_via_cmake.sh --conda-env=aarch64_test
tests/ci_build/ci_build.sh aarch64 docker bash -c "cd build && ctest --extra-verbose"
tests/ci_build/ci_build.sh aarch64 docker bash -c "cd python-package && rm -rf dist/* && python setup.py bdist_wheel --universal"
TAG=manylinux2014_aarch64
tests/ci_build/ci_build.sh aarch64 docker python tests/ci_build/rename_whl.py python-package/dist/*.whl ${TRAVIS_COMMIT} ${TAG}
else
rm -rf build
mkdir build && cd build
conda activate python3
cmake --version
cmake .. -DUSE_OPENMP=ON -DCMAKE_VERBOSE_MAKEFILE=ON
make -j$(nproc)
cd ../python-package
python setup.py bdist_wheel
cd ..
TAG=macosx_10_13_x86_64.macosx_10_14_x86_64.macosx_10_15_x86_64
python tests/ci_build/rename_whl.py python-package/dist/*.whl ${TRAVIS_COMMIT} ${TAG}
fi
# Run unit tests
cd ..
python -m pip install graphviz pytest pytest-cov codecov
python -m pip install datatable hypothesis
python -m pip install numpy scipy pandas matplotlib scikit-learn dask[complete]
python -m pytest -v --fulltrace -s tests/python --cov=python-package/xgboost || exit -1
echo "------------------------------"
if [ ${TRAVIS_CPU_ARCH} == "arm64" ]; then
tests/ci_build/ci_build.sh aarch64 docker \
bash -c "source activate aarch64_test && python -m pip install ./python-package/dist/xgboost-*-py3-none-${TAG}.whl && python -m pytest -v -s -rxXs --durations=0 --fulltrace tests/python --cov=python-package/xgboost"
else
conda env create -n cpu_test --file=tests/ci_build/conda_env/macos_cpu_test.yml
conda activate cpu_test
python -m pip install ./python-package/dist/xgboost-*-py3-none-${TAG}.whl
conda --version
python --version
python -m pytest -v -s -rxXs --durations=0 --fulltrace tests/python --cov=python-package/xgboost || exit -1
fi
conda activate python3
codecov
# Deploy binary wheel to S3
python -m pip install awscli
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]
then
S3_DEST="s3://xgboost-nightly-builds/PR-${TRAVIS_PULL_REQUEST}/"

View File

@@ -2,11 +2,11 @@
if [ ${TASK} == "python_test" ] || [ ${TASK} == "python_sdist_test" ]; then
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
wget -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
wget --no-verbose -O conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
elif [ ${TRAVIS_CPU_ARCH} == "arm64" ]; then
wget -O conda.sh https://github.com/conda-forge/miniforge/releases/download/4.8.2-1/Miniforge3-4.8.2-1-Linux-aarch64.sh
wget --no-verbose -O conda.sh https://github.com/conda-forge/miniforge/releases/download/4.8.2-1/Miniforge3-4.8.2-1-Linux-aarch64.sh
else
wget -O conda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
wget --no-verbose -O conda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
fi
bash conda.sh -b -p $HOME/miniconda
source $HOME/miniconda/bin/activate
@@ -15,7 +15,9 @@ if [ ${TASK} == "python_test" ] || [ ${TASK} == "python_sdist_test" ]; then
conda update -q conda
# Useful for debugging any issues with conda
conda info -a
conda create -n python3 python=3.7
conda create -n python3 python=3.7 cmake numpy scipy codecov
conda activate python3
python -m pip install awscli
fi
if [ ${TASK} == "s390x_test" ] && [ ${TRAVIS_CPU_ARCH} == "s390x" ]; then
@@ -26,10 +28,3 @@ if [ ${TASK} == "s390x_test" ] && [ ${TRAVIS_CPU_ARCH} == "s390x" ]; then
sudo apt-get install -y --no-install-recommends tar unzip wget git build-essential ninja-build \
time python3 python3-pip python3-numpy python3-scipy python3-sklearn r-base
fi
if [ ${TASK} == "python_sdist_test" ] && [ ${TRAVIS_OS_NAME} == "linux" ] && [ ${TRAVIS_CPU_ARCH} == "amd64" ]; then
wget https://github.com/Kitware/CMake/releases/download/v3.17.1/cmake-3.17.1-Linux-x86_64.sh
sudo bash cmake-3.17.1-Linux-x86_64.sh --prefix=/usr/local --skip-license
sudo rm -rf /usr/local/cmake-3.12.4 # Remove existing CMake
cmake --version
fi