diff --git a/ci/checks/style.sh b/ci/checks/style.sh index 965f62926..ab026e5aa 100755 --- a/ci/checks/style.sh +++ b/ci/checks/style.sh @@ -1,15 +1,16 @@ #!/bin/bash -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2020, NVIDIA CORPORATION. ################################################################################ # dask-cuda Style Tester ################################################################################ # Ignore errors and set path set +e -PATH=/conda/bin:$PATH +PATH=/opt/conda/bin:$PATH # Activate common conda env -source activate gdf +. /opt/conda/etc/profile.d/conda.sh +conda activate rapids # Run isort and get results/return code ISORT=`isort --recursive --check-only .` diff --git a/ci/cpu/build.sh b/ci/cpu/build.sh index 532f0cbbb..bd71d7e45 100755 --- a/ci/cpu/build.sh +++ b/ci/cpu/build.sh @@ -5,39 +5,48 @@ ################################################################################ set -e -# Logger function for build status output -function logger() { - echo -e "\n>>>> $@\n" -} - # Set path and build parallel level -export PATH=/conda/bin:/usr/local/cuda/bin:$PATH +export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH +export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4} # Set home to the job's workspace export HOME=$WORKSPACE +# Determine CUDA release version +export CUDA_REL=${CUDA_VERSION%.*} + +# Setup 'gpuci_conda_retry' for build retries (results in 2 total attempts) +export GPUCI_CONDA_RETRY_MAX=1 +export GPUCI_CONDA_RETRY_SLEEP=30 + # Switch to project root; also root of repo checkout cd $WORKSPACE -# Get latest tag and number of commits since tag -export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags` -export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count` +# If nightly build, append current YYMMDD to version +if [[ "$BUILD_MODE" = "branch" && "$SOURCE_BRANCH" = branch-* ]] ; then + export VERSION_SUFFIX=`date +%y%m%d` +fi ################################################################################ # SETUP - Check environment ################################################################################ -logger "Get env..." +gpuci_logger "Check environment variables" env -logger "Activate conda env..." -source activate gdf +gpuci_logger "Activate conda env" +. /opt/conda/etc/profile.d/conda.sh +conda activate rapids -logger "Check versions..." +gpuci_logger "Check compiler versions" python --version -gcc --version -g++ --version -conda list +$CC --version +$CXX --version + +gpuci_logger "Check conda environment" +conda info +conda config --show-sources +conda list --show-channel-urls # FIX Added to deal with Anancoda SSL verification issues during conda builds conda config --set ssl_verify False @@ -45,16 +54,12 @@ conda config --set ssl_verify False pip install git+https://github.com/dask/dask.git@master pip install git+https://github.com/dask/distributed.git@master -# If nightly build, append current YYMMDD to version -if [[ "$BUILD_MODE" = "branch" && "$SOURCE_BRANCH" = branch-* ]] ; then - export VERSION_SUFFIX=`date +%y%m%d` -fi - ################################################################################ # BUILD - Package builds ################################################################################ -conda build conda/recipes/dask-cuda --python=${PYTHON} +gpuci_logger "Build conda pkg for libcudf" +gpuci_conda_retry build conda/recipes/dask-cuda --python=${PYTHON} rm -rf dist/ python setup.py sdist bdist_wheel @@ -63,8 +68,8 @@ python setup.py sdist bdist_wheel # UPLOAD - Packages ################################################################################ -logger "Upload conda pkg..." -source ci/cpu/upload-anaconda.sh +gpuci_logger "Upload conda pkg..." +source ci/cpu/upload.sh -logger "Upload pypi pkg..." +gpuci_logger "Upload pypi pkg..." source ci/cpu/upload-pypi.sh diff --git a/ci/cpu/upload-anaconda.sh b/ci/cpu/upload-anaconda.sh deleted file mode 100755 index cf6c34f90..000000000 --- a/ci/cpu/upload-anaconda.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# -# Adopted from https://github.com/tmcdonell/travis-scripts/blob/dfaac280ac2082cd6bcaba3217428347899f2975/update-accelerate-buildbot.sh - -set -e - -export UPLOADFILE=`conda build conda/recipes/dask-cuda --python=$PYTHON --output` -CUDA_REL=${CUDA_VERSION%.*} - - -LABEL_OPTION="--label main" -echo "LABEL_OPTION=${LABEL_OPTION}" - -# Restrict uploads to master branch -if [ ${BUILD_MODE} != "branch" ]; then - echo "Skipping upload" - return 0 -fi - -if [ -z "$MY_UPLOAD_KEY" ]; then - echo "No upload key" - return 0 -fi - -echo "Upload" -echo ${UPLOADFILE} -anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${UPLOADFILE} diff --git a/ci/cpu/upload.sh b/ci/cpu/upload.sh new file mode 100755 index 000000000..0a7f74650 --- /dev/null +++ b/ci/cpu/upload.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Adopted from https://github.com/tmcdonell/travis-scripts/blob/dfaac280ac2082cd6bcaba3217428347899f2975/update-accelerate-buildbot.sh + +set -e + +# Setup 'gpuci_retry' for upload retries (results in 4 total attempts) +export GPUCI_RETRY_MAX=3 +export GPUCI_RETRY_SLEEP=30 + +# Set default label options if they are not defined elsewhere +export LABEL_OPTION=${LABEL_OPTION:-"--label main"} + +# Skip uploads unless BUILD_MODE == "branch" +if [ ${BUILD_MODE} != "branch" ]; then + echo "Skipping upload" + return 0 +fi + +# Skip uploads if there is no upload key +if [ -z "$MY_UPLOAD_KEY" ]; then + echo "No upload key" + return 0 +fi + +################################################################################ +# SETUP - Get conda file output locations +################################################################################ + +gpuci_logger "Get conda file output locations" +export DASKCUDA_FILE=`conda build conda/recipes/dask-cuda --python=$PYTHON --output` + +################################################################################ +# UPLOAD - Conda packages +################################################################################ + +gpuci_logger "Starting conda uploads" + +if [ "$UPLOAD_DASKCUDA" == "1" ]; then + test -e ${DASKCUDA_FILE} + echo "Upload Dask-cuda" + echo ${DASKCUDA_FILE} + gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${DASKCUDA_FILE} +fi diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index 8791346cf..b4a5c71cd 100755 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018, NVIDIA CORPORATION. +# Copyright (c) 2020, NVIDIA CORPORATION. ############################################## # dask-cuda GPU build and test script for CI # ############################################## @@ -7,19 +7,14 @@ set -e NUMARGS=$# ARGS=$* -# Logger function for build status output -function logger() { - echo -e "\n>>>> $@\n" -} - # Arg parsing function function hasArg { (( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ") } # Set path and build parallel level -export PATH=/conda/bin:/usr/local/cuda/bin:$PATH -export PARALLEL_LEVEL=4 +export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH +export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4} export CUDA_REL=${CUDA_VERSION%.*} export CUDA_REL2=${CUDA//./} @@ -44,53 +39,60 @@ export INSTALL_DASK_MASTER=1 # SETUP - Check environment ################################################################################ -logger "Check environment..." +gpuci_logger "Check environment" env -logger "Check GPU usage..." +gpuci_logger "Check GPU usage" nvidia-smi -logger "Activate conda env..." -source activate gdf -conda list +gpuci_logger "Activate conda env" +. /opt/conda/etc/profile.d/conda.sh +conda activate rapids +conda info +conda config --show-sources +conda list --show-channel-urls # Fixing Numpy version to avoid RuntimeWarning: numpy.ufunc size changed, may # indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject -conda install "cudatoolkit=$CUDA_REL" \ +gpuci_conda_retry install "cudatoolkit=$CUDA_REL" \ "cudf=${MINOR_VERSION}" "dask-cudf=${MINOR_VERSION}" \ "ucx-py=$MINOR_VERSION.*" "ucx-proc=*=gpu" \ "rapids-build-env=$MINOR_VERSION.*" # Pin pytest-asyncio because latest versions modify the default asyncio # `event_loop_policy`. See https://github.com/dask/distributed/pull/4212 . -conda install "pytest-asyncio=<0.14.0" +gpuci_conda_retry install "pytest-asyncio=<0.14.0" # https://docs.rapids.ai/maintainers/depmgmt/ -# conda remove -f rapids-build-env -# conda install "your-pkg=1.0.0" +# gpuci_conda_retry remove -f rapids-build-env +# gpuci_conda_retry install "your-pkg=1.0.0" -conda list +conda info +conda config --show-sources +conda list --show-channel-urls # Install the master version of dask and distributed if [[ "${INSTALL_DASK_MASTER}" == 1 ]]; then - logger "pip install git+https://github.com/dask/distributed.git@master --upgrade" + gpuci_logger "pip install git+https://github.com/dask/distributed.git@master --upgrade" pip install "git+https://github.com/dask/distributed.git@master" --upgrade - logger "pip install git+https://github.com/dask/dask.git@master --upgrade" + gpuci_logger "pip install git+https://github.com/dask/dask.git@master --upgrade" pip install "git+https://github.com/dask/dask.git@master" --upgrade fi -logger "Check versions..." +gpuci_logger "Check versions" python --version $CC --version $CXX --version -conda list +conda info +conda config --show-sources +conda list --show-channel-urls ################################################################################ # BUILD - Build dask-cuda ################################################################################ -logger "Build dask-cuda..." +gpuci_logger "Build dask-cuda" cd $WORKSPACE python -m pip install -e . @@ -99,17 +101,17 @@ python -m pip install -e . ################################################################################ if hasArg --skip-tests; then - logger "Skipping Tests..." + gpuci_logger "Skipping Tests" else - logger "Python py.test for dask-cuda..." + gpuci_logger "Python py.test for dask-cuda" cd $WORKSPACE ls dask_cuda/tests/ UCXPY_IFNAME=eth0 UCX_WARN_UNUSED_ENV_VARS=n UCX_MEMTYPE_CACHE=n py.test -vs --cache-clear --basetemp=${WORKSPACE}/dask-cuda-tmp --junitxml=${WORKSPACE}/junit-dask-cuda.xml --cov-config=.coveragerc --cov=dask_cuda --cov-report=xml:${WORKSPACE}/dask-cuda-coverage.xml --cov-report term dask_cuda/tests/ - logger "Running dask.distributed GPU tests" + gpuci_logger "Running dask.distributed GPU tests" # Test downstream packages, which requires Python v3.7 if [ $(python -c "import sys; print(sys.version_info[1])") -ge "7" ]; then - logger "TEST OF DASK/UCX..." + gpuci_logger "TEST OF DASK/UCX" py.test --cache-clear -vs `python -c "import distributed.protocol.tests.test_cupy as m;print(m.__file__)"` py.test --cache-clear -vs `python -c "import distributed.protocol.tests.test_numba as m;print(m.__file__)"` py.test --cache-clear -vs `python -c "import distributed.protocol.tests.test_rmm as m;print(m.__file__)"` diff --git a/ci/local/README.md b/ci/local/README.md index 3dc6e0f51..b121cfc05 100644 --- a/ci/local/README.md +++ b/ci/local/README.md @@ -30,7 +30,8 @@ For a full list of available gpuCI docker images, visit our [DockerHub](https:// Style Check: ```bash $ bash ci/local/build.sh -r ~/rapids/dask-cuda -s -$ source activate gdf #Activate gpuCI conda environment +$ . /opt/conda/etc/profile.d/conda.sh +$ conda activate rapids #Activate gpuCI conda environment $ cd rapids $ flake8 python ``` diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index e08539083..7e5a25286 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2020, NVIDIA CORPORATION. ################################################################################ # dask-cuda version updater ################################################################################