From c6d06e481fc8aca8b0012231987d41fb850cea22 Mon Sep 17 00:00:00 2001 From: Ajay Thorve Date: Sat, 11 Feb 2023 19:50:41 -0800 Subject: [PATCH 1/2] Reduce error handling verbosity in CI tests scripts (#5219) This PR adds a less verbose [trap method](https://github.com/rapidsai/cugraph/blob/f2b081075704aabc789603e14ce552eac3fbe692/ci/test.sh#L19), for error handling to help ensure that we capture all potential error codes in our test scripts, and works as follows: - setting an environment variable, EXITCODE, with a default value of 0 - setting a trap statement triggered by ERR signals which will set EXITCODE=1 when any commands return a non-zero exit code cc @ajschmidt8 Authors: - Ajay Thorve (https://github.com/AjayThorve) - AJ Schmidt (https://github.com/ajschmidt8) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) URL: https://github.com/rapidsai/cuml/pull/5219 --- ci/test_cpp.sh | 17 +++++------------ ci/test_notebooks.sh | 9 +++++---- ci/test_python_dask.sh | 9 ++++++++- ci/test_python_singlegpu.sh | 9 ++++++++- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index d7a4c2f5af..c90bc590aa 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2023, NVIDIA CORPORATION. set -euo pipefail @@ -21,7 +21,6 @@ set -u CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/ mkdir -p "${RAPIDS_TESTS_DIR}" -SUITEERROR=0 rapids-print-env @@ -32,23 +31,17 @@ rapids-mamba-retry install \ rapids-logger "Check GPU usage" nvidia-smi +EXITCODE=0 +trap "EXITCODE=1" ERR set +e # Run libcuml gtests from libcuml-tests package rapids-logger "Run gtests" - -# TODO: exit code handling is too verbose. Find a cleaner solution. - for gt in "$CONDA_PREFIX"/bin/gtests/libcuml/* ; do test_name=$(basename ${gt}) echo "Running gtest $test_name" ${gt} --gtest_output=xml:${RAPIDS_TESTS_DIR} - - exitcode=$? - if (( ${exitcode} != 0 )); then - SUITEERROR=${exitcode} - echo "FAILED: GTest ${gt}" - fi done -exit ${SUITEERROR} +rapids-logger "Test script exiting with value: $EXITCODE" +exit ${EXITCODE} diff --git a/ci/test_notebooks.sh b/ci/test_notebooks.sh index 4527c44b9e..5b96333f8a 100755 --- a/ci/test_notebooks.sh +++ b/ci/test_notebooks.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2023, NVIDIA CORPORATION. set -euo pipefail . /opt/conda/etc/profile.d/conda.sh @@ -31,6 +31,8 @@ rapids-mamba-retry install \ rapids-logger "Check GPU usage" nvidia-smi +NOTEBOOKS_EXITCODE=0 +trap "NOTEBOOKS_EXITCODE=1" ERR set +e rapids-logger "notebook tests cuml" @@ -38,7 +40,6 @@ rapids-logger "notebook tests cuml" # Add notebooks that should be skipped here # (space-separated list of filenames without paths) SKIPNBS="cuml_benchmarks.ipynb" -NOTEBOOKS_EXITCODE=0 NBTEST="$(realpath "$(dirname "$0")/utils/nbtest.sh")" cd notebooks @@ -56,9 +57,9 @@ for nb in $(find . -name "*.ipynb"); do echo "--------------------------------------------------------------------------------" else nvidia-smi - ${NBTEST} "${nbBasename}" - NOTEBOOKS_EXITCODE=$((NOTEBOOKS_EXITCODE | $?)) + ${NBTEST} "${nbBasename}" fi done +rapids-logger "Test script exiting with value: $NOTEBOOKS_EXITCODE" exit ${NOTEBOOKS_EXITCODE} diff --git a/ci/test_python_dask.sh b/ci/test_python_dask.sh index d32526ef94..17f8a1eda7 100755 --- a/ci/test_python_dask.sh +++ b/ci/test_python_dask.sh @@ -1,9 +1,13 @@ #!/bin/bash -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2023, NVIDIA CORPORATION. # Common setup steps shared by Python test jobs source "$(dirname "$0")/test_python_common.sh" +EXITCODE=0 +trap "EXITCODE=1" ERR +set +e + rapids-logger "pytest cuml-dask" cd python/cuml/tests/dask pytest \ @@ -14,3 +18,6 @@ pytest \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuml-dask-coverage.xml" \ --cov-report=term \ . + +rapids-logger "Test script exiting with value: $EXITCODE" +exit ${EXITCODE} diff --git a/ci/test_python_singlegpu.sh b/ci/test_python_singlegpu.sh index 426cd650a9..a4bbf8d060 100755 --- a/ci/test_python_singlegpu.sh +++ b/ci/test_python_singlegpu.sh @@ -1,9 +1,13 @@ #!/bin/bash -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2023, NVIDIA CORPORATION. # Common setup steps shared by Python test jobs source "$(dirname "$0")/test_python_common.sh" +EXITCODE=0 +trap "EXITCODE=1" ERR +set +e + rapids-logger "pytest cuml single GPU" cd python/cuml/tests pytest \ @@ -16,3 +20,6 @@ pytest \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuml-coverage.xml" \ --cov-report=term \ . + +rapids-logger "Test script exiting with value: $EXITCODE" +exit ${EXITCODE} From 6f2fda7716207ea979781573d64d3cfbfd5cd077 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 13 Feb 2023 10:03:55 -0600 Subject: [PATCH 2/2] Remove gpuCI scripts. (#5208) Since migrating to GitHub Actions, the gpuCI scripts are no longer needed. This PR removes those outdated gpuCI scripts. Authors: - Bradley Dice (https://github.com/bdice) - AJ Schmidt (https://github.com/ajschmidt8) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) - Dante Gama Dessavre (https://github.com/dantegd) URL: https://github.com/rapidsai/cuml/pull/5208 --- CONTRIBUTING.md | 24 +-- README.md | 11 +- ci/checks/changelog.sh | 39 ----- ci/checks/style.sh | 130 -------------- ci/cpu/build.sh | 124 ------------- ci/cpu/prebuild.sh | 11 -- ci/cpu/upload.sh | 42 ----- ci/gpu/build.sh | 329 ----------------------------------- ci/gpu/test-notebooks.sh | 48 ----- ci/local/README.md | 57 ------ ci/local/build.sh | 145 --------------- ci/release/update-version.sh | 1 + conda/recipes/cuml/meta.yaml | 11 +- wiki/cpp/DEVELOPER_GUIDE.md | 2 +- 14 files changed, 18 insertions(+), 956 deletions(-) delete mode 100755 ci/checks/changelog.sh delete mode 100644 ci/checks/style.sh delete mode 100755 ci/cpu/build.sh delete mode 100644 ci/cpu/prebuild.sh delete mode 100644 ci/cpu/upload.sh delete mode 100644 ci/gpu/build.sh delete mode 100755 ci/gpu/test-notebooks.sh delete mode 100644 ci/local/README.md delete mode 100755 ci/local/build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1432e97566..e1f72050f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,11 +38,6 @@ into three categories: 8. Wait for other developers to review your code and update code as needed. 9. Once reviewed and approved, a RAPIDS developer will merge your pull request. -### A note related to our CI process -After you have started a PR (refer to step 6 in the previous section), every time you do a `git push `, it triggers a new CI run on all the commits thus far. Even though GPUCI has mechanisms to deal with this to a certain extent, if you keep `push`ing too frequently, it might just clog our GPUCI servers and slow down every PR and conda package generation! So, please be mindful of this and try not to do many frequent pushes. - -To quantify this, the average check in our CI takes between 80 and 90 minutes on our servers. The GPUCI infrastructure has limited resources, so if the servers get overwhelmed, every current active PR will not be able to correctly schedule CI. - Remember, if you are unsure about anything, don't hesitate to comment on issues and ask for clarifications! ### Managing PR labels @@ -71,16 +66,16 @@ implementation of the issue, ask them in the issue instead of the PR. ### Branches and Versions -The cuML repository has two main branches: +The cuML repository has two main branches: -1. `main` branch: it contains the last released version. Only hotfixes are targeted and merged into it. +1. `main` branch: it contains the last released version. Only hotfixes are targeted and merged into it. 2. `branch-x.y`: it is the development branch which contains the upcoming release. All the new features should be based on this branch and Merge/Pull request should target this branch (with the exception of hotfixes). - + ### Additional details -For every new version `x.y` of cuML there is a corresponding branch called `branch-x.y`, from where new feature development starts and PRs will be targeted and merged before its release. The exceptions to this are the 'hotfixes' that target the `main` branch, which target critical issues raised by Github users and are directly merged to `main` branch, and create a new subversion of the project. While trying to patch an issue which requires a 'hotfix', please state the intent in the PR. +For every new version `x.y` of cuML there is a corresponding branch called `branch-x.y`, from where new feature development starts and PRs will be targeted and merged before its release. The exceptions to this are the 'hotfixes' that target the `main` branch, which target critical issues raised by Github users and are directly merged to `main` branch, and create a new subversion of the project. While trying to patch an issue which requires a 'hotfix', please state the intent in the PR. -For all development, your changes should be pushed into a branch (created using the naming instructions below) in your own fork of cuML and then create a pull request when the code is ready. +For all development, your changes should be pushed into a branch (created using the naming instructions below) in your own fork of cuML and then create a pull request when the code is ready. A few days before releasing version `x.y` the code of the current development branch (`branch-x.y`) will be frozen and a new branch, 'branch-x+1.y' will be created to continue development. @@ -88,18 +83,13 @@ A few days before releasing version `x.y` the code of the current development br Branches used to create PRs should have a name of the form `-` which conforms to the following conventions: -- Type: +- Type: - fea - For if the branch is for a new feature(s) - enh - For if the branch is an enhancement of an existing feature(s) - bug - For if the branch is for fixing a bug(s) or regression(s) -- Name: +- Name: - A name to convey what is being worked on - Please use dashes or underscores between words as opposed to spaces. -### Building and Testing on a gpuCI image locally - -Before submitting a pull request, you can do a local build and test on your machine that mimics our gpuCI environment using the `ci/local/build.sh` script. -For detailed information on usage of this script, see [here](ci/local/README.md). - ## Attribution Portions adopted from https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md diff --git a/README.md b/README.md index e6b1792719..1923428502 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ #
 cuML - GPU Machine Learning Algorithms
-[![Build Status](https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/cuml/job/branches/job/cuml-branch-pipeline/badge/icon)](https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/cuml/job/branches/job/cuml-branch-pipeline/) - cuML is a suite of libraries that implement machine learning algorithms and mathematical primitives functions that share compatible APIs with other [RAPIDS](https://rapids.ai/) projects. cuML enables data scientists, researchers, and software engineers to run @@ -9,10 +7,9 @@ traditional tabular ML tasks on GPUs without going into the details of CUDA programming. In most cases, cuML's Python API matches the API from [scikit-learn](https://scikit-learn.org). - For large datasets, these GPU-based implementations can complete 10-50x faster than their CPU equivalents. For details on performance, see the [cuML Benchmarks -Notebook](https://github.com/rapidsai/cuml/tree/branch-0.14/notebooks/tools). +Notebook](https://github.com/rapidsai/cuml/tree/branch-23.04/notebooks/tools). As an example, the following Python snippet loads input and computes DBSCAN clusters, all on GPU, using cuDF: ```python @@ -77,7 +74,7 @@ neighbors = nn.kneighbors(df) For additional examples, browse our complete [API documentation](https://docs.rapids.ai/api/cuml/stable/), or check out our example [walkthrough -notebooks](https://github.com/rapidsai/cuml/tree/branch-0.15/notebooks). Finally, you +notebooks](https://github.com/rapidsai/cuml/tree/branch-23.04/notebooks). Finally, you can find complete end-to-end examples in the [notebooks-contrib repo](https://github.com/rapidsai/notebooks-contrib). @@ -112,9 +109,9 @@ repo](https://github.com/rapidsai/notebooks-contrib). | **Preprocessing** | Standardization, or mean removal and variance scaling / Normalization / Encoding categorical features / Discretization / Imputation of missing values / Polynomial features generation / and coming soon custom transformers and non-linear transformation | Based on Scikit-Learn preprocessing | **Time Series** | Holt-Winters Exponential Smoothing | | | | Auto-regressive Integrated Moving Average (ARIMA) | Supports seasonality (SARIMA) | -| **Model Explanation** | SHAP Kernel Explainer +| **Model Explanation** | SHAP Kernel Explainer | [Based on SHAP](https://shap.readthedocs.io/en/latest/) | -| | SHAP Permutation Explainer +| | SHAP Permutation Explainer | [Based on SHAP](https://shap.readthedocs.io/en/latest/) | | **Execution device interoperability** | | Run estimators interchangeably from host/cpu or device/gpu with minimal code change [demo](https://docs.rapids.ai/api/cuml/stable/execution_device_interoperability.html) | | **Other** | K-Nearest Neighbors (KNN) Search | Multi-node multi-GPU via Dask+[UCX](https://github.com/rapidsai/ucx-py), uses [Faiss](https://github.com/facebookresearch/faiss) for Nearest Neighbors Query. | diff --git a/ci/checks/changelog.sh b/ci/checks/changelog.sh deleted file mode 100755 index 946c005f68..0000000000 --- a/ci/checks/changelog.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Copyright (c) 2019, NVIDIA CORPORATION. -######################### -# cuML CHANGELOG Tester # -######################### - -# Checkout main for comparison -git checkout --force --quiet main - -# Switch back to tip of PR branch -git checkout --force --quiet current-pr-branch - -# Ignore errors during searching -set +e - -# Get list of modified files between matster and PR branch -CHANGELOG=`git diff --name-only main...current-pr-branch | grep CHANGELOG.md` -# Check if CHANGELOG has PR ID -PRNUM=`cat CHANGELOG.md | grep "$PR_ID"` -RETVAL=0 - -# Return status of check result -if [ "$CHANGELOG" != "" -a "$PRNUM" != "" ] ; then - echo -e "\n\n>>>> PASSED: CHANGELOG.md has been updated with current PR information.\n\nPlease ensure the update meets the following criteria.\n" -else - echo -e "\n\n>>>> FAILED: CHANGELOG.md has not been updated!\n\nPlease add a line describing this PR to CHANGELOG.md in the repository root directory. The line should meet the following criteria.\n" - RETVAL=1 -fi - -cat << EOF - It should be placed under the section for the appropriate release. - It should be placed under "New Features", "Improvements", or "Bug Fixes" as appropriate. - It should be formatted as '- PR # ' - Example format for #491 '- PR #491 Add CI test script to check for updates to CHANGELOG.md in PRs' - - -EOF - -exit $RETVAL diff --git a/ci/checks/style.sh b/ci/checks/style.sh deleted file mode 100644 index 026df58c23..0000000000 --- a/ci/checks/style.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash -# Copyright (c) 2019-2022, NVIDIA CORPORATION. -##################### -# cuML Style Tester # -##################### - -# Ignore errors and set path -set +e -export PATH=/conda/bin:/usr/local/cuda/bin:$PATH - -# Activate common conda env and install any dependencies needed -. /opt/conda/etc/profile.d/conda.sh -conda activate rapids -cd "$WORKSPACE" - -export GIT_DESCRIBE_TAG=`git describe --tags` -export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'` -export UCX_PY_VERSION='0.30.*' -mamba install "ucx-py=${UCX_PY_VERSION}" "ucx-proc=*=gpu" - -# Run flake8 and get results/return code -FLAKE=`flake8 --config=python/setup.cfg` -RETVAL=$? - -# Output results if failure otherwise show pass -if [ "$FLAKE" != "" ]; then - echo -e "\n\n>>>> FAILED: flake8 style check; begin output\n\n" - echo -e "$FLAKE" - echo -e "\n\n>>>> FAILED: flake8 style check; end output\n\n" -else - echo -e "\n\n>>>> PASSED: flake8 style check\n\n" -fi - -# Check for copyright headers in the files modified currently -COPYRIGHT=`python ci/checks/copyright.py --git-modified-only 2>&1` -CR_RETVAL=$? -if [ "$RETVAL" = "0" ]; then - RETVAL=$CR_RETVAL -fi - -# Output results if failure otherwise show pass -if [ "$CR_RETVAL" != "0" ]; then - echo -e "\n\n>>>> FAILED: copyright check; begin output\n\n" - echo -e "$COPYRIGHT" - echo -e "\n\n>>>> FAILED: copyright check; end output\n\n" -else - echo -e "\n\n>>>> PASSED: copyright check\n\n" -fi - -# Check for a consistent #include syntax -# TODO: keep adding more dirs as and when we update the syntax -HASH_INCLUDE=`python cpp/scripts/include_checker.py \ - cpp/bench \ - cpp/comms/mpi/include \ - cpp/comms/mpi/src \ - cpp/comms/std/include \ - cpp/comms/std/src \ - cpp/include \ - cpp/examples \ - cpp/src \ - cpp/src_prims \ - cpp/test \ - 2>&1` -HASH_RETVAL=$? -if [ "$RETVAL" = "0" ]; then - RETVAL=$HASH_RETVAL -fi - -# Output results if failure otherwise show pass -if [ "$HASH_RETVAL" != "0" ]; then - echo -e "\n\n>>>> FAILED: #include check; begin output\n\n" - echo -e "$HASH_INCLUDE" - echo -e "\n\n>>>> FAILED: #include check; end output\n\n" -else - echo -e "\n\n>>>> PASSED: #include check\n\n" -fi - -# Check for a consistent code format -FORMAT=`python cpp/scripts/run-clang-format.py 2>&1` -FORMAT_RETVAL=$? -if [ "$RETVAL" = "0" ]; then - RETVAL=$FORMAT_RETVAL -fi - -# Output results if failure otherwise show pass -if [ "$FORMAT_RETVAL" != "0" ]; then - echo -e "\n\n>>>> FAILED: clang format check; begin output\n\n" - echo -e "$FORMAT" - echo -e "\n\n>>>> FAILED: clang format check; end output\n\n" -else - echo -e "\n\n>>>> PASSED: clang format check\n\n" -fi - -# clang-tidy check -# NOTE: -# explicitly pass GPU_ARCHS flag to avoid having to evaluate gpu archs -# because there's no GPU on the CI machine where this script runs! -# NOTE: -# also, sync all dependencies as they'll be needed by clang-tidy to find -# relevant headers -function setup_and_run_clang_tidy() { - local LD_LIBRARY_PATH_CACHED=$LD_LIBRARY_PATH - export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH - mkdir cpp/build && \ - cd cpp/build && \ - cmake -DGPU_ARCHS=70 \ - -DBLAS_LIBRARIES=${CONDA_PREFIX}/lib/libopenblas.so.0 \ - .. && \ - make treelite && \ - cd ../.. && \ - python cpp/scripts/run-clang-tidy.py - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_CACHED -} -TIDY=`setup_and_run_clang_tidy 2>&1` -TIDY_RETVAL=$? -if [ "$RETVAL" = "0" ]; then - RETVAL=$TIDY_RETVAL -fi - -# Output results if failure otherwise show pass -if [ "$TIDY_RETVAL" != "0" ]; then - echo -e "\n\n>>>> FAILED: clang tidy check; begin output\n\n" - echo -e "$TIDY" - echo -e "\n\n>>>> FAILED: clang tidy check; end output\n\n" -else - echo -e "\n\n>>>> PASSED: clang tidy check\n\n" -fi - - -exit $RETVAL diff --git a/ci/cpu/build.sh b/ci/cpu/build.sh deleted file mode 100755 index 6d70892984..0000000000 --- a/ci/cpu/build.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -# Copyright (c) 2018-2022, NVIDIA CORPORATION. -############################################## -# cuML CPU conda build script for CI # -############################################## -set -ex - -# Set path and build parallel level -export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH -export PARALLEL_LEVEL=${PARALLEL_LEVEL:-8} - -# 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 - -# Workaround to keep Jenkins builds working -# until we migrate fully to GitHub Actions -export RAPIDS_CUDA_VERSION="${CUDA}" -export SCCACHE_BUCKET=rapids-sccache -export SCCACHE_REGION=us-west-2 -export SCCACHE_IDLE_TIMEOUT=32768 - -# Use Ninja to build, setup Conda Build Dir -export CMAKE_GENERATOR="Ninja" -export CONDA_BLD_DIR="$WORKSPACE/.conda-bld" - -# Switch to project root; also root of repo checkout -cd "$WORKSPACE" - -# If nightly build, append current YYMMDD to version -if [ "${IS_STABLE_BUILD}" != "true" ] ; then - export VERSION_SUFFIX=`date +%y%m%d` -fi - -################################################################################ -# SETUP - Check environment -################################################################################ - -gpuci_logger "Check environment variables" -env - -gpuci_logger "Activate conda env" -. /opt/conda/etc/profile.d/conda.sh -conda activate rapids - -# Remove rapidsai-nightly channel if it is stable build -if [ "${IS_STABLE_BUILD}" = "true" ]; then - conda config --system --remove channels rapidsai-nightly -fi - -gpuci_logger "Check compiler versions" -python --version -$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 - -# Build python package in CUDA jobs so they are built on a -# machine with a single CUDA version, then have the gpu/build.sh script simply -# install. This should eliminate a mismatch between different CUDA versions on -# cpu vs. gpu builds that is problematic with CUDA 11.5 Enhanced Compat. -if [ "$BUILD_LIBCUML" == '1' ]; then - echo "BUILD_LIBCUML=1: Setting BUILD_CUML to 1..." - BUILD_CUML=1 - # If we are doing CUDA + Python builds, libcuml package is located at ${CONDA_BLD_DIR} - CONDA_LOCAL_CHANNEL="${CONDA_BLD_DIR}" -else - # If we are doing Python builds only, libcuml package is placed here by Project Flash - CONDA_LOCAL_CHANNEL="ci/artifacts/cuml/cpu/.conda-bld/" -fi - -# FIXME: Remove -gpuci_mamba_retry install -c conda-forge boa - -################################################################################ -# BUILD - Conda package builds (conda deps: libcuml <- cuml) -################################################################################ -if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then - if [ "$BUILD_LIBCUML" == '1' -o "$BUILD_CUML" == '1' ]; then - gpuci_logger "Build conda pkg for libcuml" - gpuci_conda_retry mambabuild --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libcuml - fi -else - if [ "$BUILD_LIBCUML" == '1' ]; then - gpuci_logger "PROJECT FLASH: Build conda pkg for libcuml" - gpuci_conda_retry mambabuild --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libcuml --dirty --no-remove-work-dir - mkdir -p ${CONDA_BLD_DIR}/libcuml - mv ${CONDA_BLD_DIR}/work/ ${CONDA_BLD_DIR}/libcuml/work - fi -fi -gpuci_logger "sccache stats" -sccache --show-stats - -if [ "$BUILD_CUML" == '1' ]; then - if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then - gpuci_logger "Build conda pkg for cuml" - gpuci_conda_retry mambabuild --croot ${CONDA_BLD_DIR} conda/recipes/cuml --python=${PYTHON} - else - gpuci_logger "PROJECT FLASH: Build conda pkg for cuml" - gpuci_conda_retry mambabuild --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/cuml -c ${CONDA_LOCAL_CHANNEL} --dirty --no-remove-work-dir --python=${PYTHON} - mkdir -p ${CONDA_BLD_DIR}/cuml - mv ${CONDA_BLD_DIR}/work/ ${CONDA_BLD_DIR}/cuml/work - fi -fi - -################################################################################ -# UPLOAD - Conda packages -################################################################################ - -# Uploads disabled due to new GH Actions implementation -# gpuci_logger "Upload conda pkgs" -# source ci/cpu/upload.sh diff --git a/ci/cpu/prebuild.sh b/ci/cpu/prebuild.sh deleted file mode 100644 index 37437dbf6c..0000000000 --- a/ci/cpu/prebuild.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2022, NVIDIA CORPORATION. - -export UPLOAD_CUML=1 -export UPLOAD_LIBCUML=1 - -if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then - #If project flash is not activate, always build both - export BUILD_LIBCUML=1 - export BUILD_CUML=1 -fi \ No newline at end of file diff --git a/ci/cpu/upload.sh b/ci/cpu/upload.sh deleted file mode 100644 index 6396cd2073..0000000000 --- a/ci/cpu/upload.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Copyright (c) 2018-2022, NVIDIA CORPORATION. - -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 - -################################################################################ -# UPLOAD - Conda packages -################################################################################ - -gpuci_logger "Starting conda uploads" - -if [[ "$BUILD_LIBCUML" == "1" && "$UPLOAD_LIBCUML" == "1" ]]; then - LIBCUML_FILES=$(conda build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libcuml --output) - echo "Upload libcuml" - gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing --no-progress ${LIBCUML_FILES} -fi - -if [[ "$BUILD_CUML" == "1" && "$UPLOAD_CUML" == "1" ]]; then - CUML_FILE=$(conda build --croot ${CONDA_BLD_DIR} conda/recipes/cuml --python=$PYTHON --output) - test -e ${CUML_FILE} - echo "Upload cuml: ${CUML_FILE}" - gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${CUML_FILE} --no-progress -fi diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh deleted file mode 100644 index 77c6091def..0000000000 --- a/ci/gpu/build.sh +++ /dev/null @@ -1,329 +0,0 @@ -#!/bin/bash -# Copyright (c) 2018-2022, NVIDIA CORPORATION. -############################################## -# cuML GPU build and test script for CI # -############################################## - -set -e -NUMARGS=$# -ARGS=$* - -# Arg parsing function -function hasArg { - (( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ") -} - -# Set path and build parallel level -export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH -export PARALLEL_LEVEL=${PARALLEL_LEVEL:-8} -export CONDA_ARTIFACT_PATH=${WORKSPACE}/ci/artifacts/cuml/cpu/.conda-bld/ - -# Set home to the job's workspace -export HOME=$WORKSPACE - -# Determine CUDA release version -export CUDA_REL=${CUDA_VERSION%.*} - -# Workaround to keep Jenkins builds working -# until we migrate fully to GitHub Actions -export RAPIDS_CUDA_VERSION="${CUDA}" -export SCCACHE_BUCKET=rapids-sccache -export SCCACHE_REGION=us-west-2 -export SCCACHE_IDLE_TIMEOUT=32768 - -# Switch to project root; also root of repo checkout -cd $WORKSPACE - -# Parse git describe -export GIT_DESCRIBE_TAG=`git describe --tags` -export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'` -unset GIT_DESCRIBE_TAG - -# configure numba threading library -export NUMBA_THREADING_LAYER=workqueue - -# Whether to install dask nightly or stable packages -export INSTALL_DASK_MAIN=1 - -# Dask version to install when `INSTALL_DASK_MAIN=0` -export DASK_STABLE_VERSION="2023.1.1" - -################################################################################ -# SETUP - Check environment -################################################################################ - -gpuci_logger "Check environment" -env - -gpuci_logger "Check GPU usage" -nvidia-smi - -gpuci_logger "Activate conda env" -. /opt/conda/etc/profile.d/conda.sh -conda activate rapids - -gpuci_logger "Install dependencies" -gpuci_mamba_retry install -c conda-forge -c rapidsai -c rapidsai-nightly -c nvidia \ - "cudatoolkit=${CUDA_REL}" \ - "cudf=${MINOR_VERSION}" \ - "rmm=${MINOR_VERSION}" \ - "libcumlprims=${MINOR_VERSION}" \ - "libraft-headers=${MINOR_VERSION}" \ - "libraft-distance=${MINOR_VERSION}" \ - "libraft-nn=${MINOR_VERSION}" \ - "pylibraft=${MINOR_VERSION}" \ - "raft-dask=${MINOR_VERSION}" \ - "dask-cudf=${MINOR_VERSION}" \ - "dask-cuda=${MINOR_VERSION}" \ - "ucx-py=${UCX_PY_VERSION}" \ - "ucx-proc=*=gpu" \ - "xgboost=1.7.1dev.rapidsai${MINOR_VERSION}" \ - "rapids-build-env=${MINOR_VERSION}.*" \ - "rapids-notebook-env=${MINOR_VERSION}.*" \ - "shap>=0.37,<=0.39" - -if [ "$(arch)" = "x86_64" ]; then - gpuci_mamba_retry install -c conda-forge -c rapidsai -c rapidsai-nightly -c nvidia \ - "rapids-doc-env=${MINOR_VERSION}.*" -fi - -# https://docs.rapids.ai/maintainers/depmgmt/ -# gpuci_conda_retry remove --force rapids-build-env rapids-notebook-env -# gpuci_mamba_retry install -y "your-pkg=1.0.0" - -gpuci_logger "Check compiler versions" -python --version -$CC --version -$CXX --version - -gpuci_logger "Check conda environment" -conda info -conda config --show-sources -conda list --show-channel-urls - -function install_dask { - # Install the conda-forge or nightly version of dask and distributed - gpuci_logger "Install the conda-forge or nightly version of dask and distributed" - set -x - if [[ "${INSTALL_DASK_MAIN}" == 1 ]]; then - gpuci_logger "gpuci_mamba_retry install -c dask/label/dev 'dask/label/dev::dask' 'dask/label/dev::distributed'" - gpuci_mamba_retry install -c dask/label/dev "dask/label/dev::dask" "dask/label/dev::distributed" - conda list - else - gpuci_logger "gpuci_mamba_retry install conda-forge::dask=={$DASK_STABLE_VERSION} conda-forge::distributed=={$DASK_STABLE_VERSION} conda-forge::dask-core=={$DASK_STABLE_VERSION} --force-reinstall" - gpuci_mamba_retry install conda-forge::dask==$DASK_STABLE_VERSION conda-forge::distributed==$DASK_STABLE_VERSION conda-forge::dask-core==$DASK_STABLE_VERSION --force-reinstall - fi - set +x -} - -if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then - gpuci_logger "Building doxygen C++ docs" - $WORKSPACE/build.sh cppdocs -v - - ################################################################################ - # BUILD - Build libcuml, cuML, and prims from source - ################################################################################ - - gpuci_logger "Build from source" - $WORKSPACE/build.sh clean libcuml cuml prims bench -v --codecov - - cd $WORKSPACE - - ################################################################################ - # TEST - Run GoogleTest and py.tests for libcuml and cuML - ################################################################################ - if hasArg --skip-tests; then - gpuci_logger "Skipping Tests" - exit 0 - fi - - gpuci_logger "Check GPU usage" - nvidia-smi - - gpuci_logger "GoogleTest for libcuml" - set -x - cd $WORKSPACE/cpp/build - GTEST_OUTPUT="xml:${WORKSPACE}/test-results/libcuml_cpp/" ./test/ml - - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_CACHED - export LD_LIBRARY_PATH_CACHED="" - - set -x - install_dask - pip install "git+https://github.com/hdbscan/hdbscan.git@master" --force-reinstall --upgrade --no-deps - set +x - - gpuci_logger "Python pytest for cuml" - cd $WORKSPACE/python - - pytest --cache-clear --basetemp=${WORKSPACE}/cuml-cuda-tmp --junitxml=${WORKSPACE}/junit-cuml.xml -v -s -m "not memleak" --durations=50 --timeout=300 --ignore=cuml/tests/dask --ignore=cuml/raft --cov-config=.coveragerc --cov=cuml --cov-report=xml:${WORKSPACE}/python/cuml/cuml-coverage.xml --cov-report term - - timeout 7200 sh -c "pytest cuml/tests/dask --cache-clear --basetemp=${WORKSPACE}/cuml-mg-cuda-tmp --junitxml=${WORKSPACE}/junit-cuml-mg.xml -v -s -m 'not memleak' --durations=50 --timeout=300 --cov-config=.coveragerc --cov=cuml --cov-report=xml:${WORKSPACE}/python/cuml/cuml-dask-coverage.xml --cov-report term" - - - ################################################################################ - # TEST - Run notebook tests - ################################################################################ - set +e -Eo pipefail - EXITCODE=0 - trap "EXITCODE=1" ERR - - gpuci_logger "Notebook tests" - ${WORKSPACE}/ci/gpu/test-notebooks.sh 2>&1 | tee nbtest.log - python ${WORKSPACE}/ci/utils/nbtestlog2junitxml.py nbtest.log - - ################################################################################ - # TEST - Run GoogleTest for ml-prims - ################################################################################ - - gpuci_logger "Run ml-prims test" - cd $WORKSPACE/cpp/build - GTEST_OUTPUT="xml:${WORKSPACE}/test-results/prims/" ./test/prims - - ################################################################################ - # TEST - Run GoogleTest for ml-prims, but with cuda-memcheck enabled - ################################################################################ - - if [ "$BUILD_MODE" = "branch" ] && [ "$BUILD_TYPE" = "gpu" ]; then - gpuci_logger "GoogleTest for ml-prims with cuda-memcheck enabled..." - cd $WORKSPACE/cpp/build - python ../scripts/cuda-memcheck.py -tool memcheck -exe ./test/prims - fi -else - if hasArg --skip-tests; then - gpuci_logger "Skipping Tests" - exit 0 - fi - - gpuci_logger "Check GPU usage" - nvidia-smi - - gpuci_logger "Installing libcuml and libcuml-tests" - gpuci_mamba_retry install -y -c ${CONDA_ARTIFACT_PATH} libcuml libcuml-tests - - gpuci_logger "Running libcuml test binaries" - GTEST_ARGS="xml:${WORKSPACE}/test-results/libcuml_cpp/" - for gt in "$CONDA_PREFIX/bin/gtests/libcuml/"*; do - test_name=$(basename $gt) - echo "Running gtest $test_name" - ${gt} ${GTEST_ARGS} - echo "Ran gtest $test_name : return code was: $?, test script exit code is now: $EXITCODE" - done - - # TODO: Move boa install to gpuci/rapidsai - gpuci_mamba_retry install boa - - gpuci_logger "Building and installing cuml" - export CONDA_BLD_DIR="$WORKSPACE/.conda-bld" - export VERSION_SUFFIX="" - gpuci_conda_retry mambabuild --croot ${CONDA_BLD_DIR} conda/recipes/cuml -c ${CONDA_ARTIFACT_PATH} --python=${PYTHON} - gpuci_mamba_retry install cuml -c "${CONDA_BLD_DIR}" -c "${CONDA_ARTIFACT_PATH}" - - set -x - - install_dask - pip install "git+https://github.com/dask/dask-glm@main" --force-reinstall --no-deps - pip install "git+https://github.com/scikit-learn-contrib/hdbscan.git@master" --force-reinstall --upgrade --no-deps - pip install sparse - - set +x - - gpuci_logger "Python pytest for cuml" - cd $WORKSPACE/python/cuml/tests - - pytest --cache-clear --basetemp=${WORKSPACE}/cuml-cuda-tmp --junitxml=${WORKSPACE}/junit-cuml.xml -v -s -m "not memleak" --durations=50 --timeout=300 --ignore=dask --cov-config=.coveragerc --cov=cuml --cov-report=xml:${WORKSPACE}/python/cuml/cuml-coverage.xml --cov-report term - - timeout 7200 sh -c "pytest dask --cache-clear --basetemp=${WORKSPACE}/cuml-mg-cuda-tmp --junitxml=${WORKSPACE}/junit-cuml-mg.xml -v -s -m 'not memleak' --durations=50 --timeout=300 --cov-config=.coveragerc --cov=cuml --cov-report=xml:${WORKSPACE}/python/cuml/cuml-dask-coverage.xml --cov-report term" - - ################################################################################ - # TEST - Run notebook tests - ################################################################################ - - gpuci_logger "Notebook tests" - set +e -Eo pipefail - EXITCODE=0 - trap "EXITCODE=1" ERR - - ${WORKSPACE}/ci/gpu/test-notebooks.sh 2>&1 | tee nbtest.log - python ${WORKSPACE}/ci/utils/nbtestlog2junitxml.py nbtest.log - - ################################################################################ - # TEST - Run GoogleTest for ml-prims - ################################################################################ - - gpuci_logger "Run ml-prims test" - GTEST_ARGS="xml:${WORKSPACE}/test-results/prims/" - for gt in "$CONDA_PREFIX/bin/gtests/libcuml_prims/"*; do - test_name=$(basename $gt) - echo "Running gtest $test_name" - ${gt} ${GTEST_ARGS} - echo "Ran gtest $test_name : return code was: $?, test script exit code is now: $EXITCODE" - done - - - ################################################################################ - # TEST - Run GoogleTest for ml-prims, but with cuda-memcheck enabled - ################################################################################ - - if [ "$BUILD_MODE" = "branch" ] && [ "$BUILD_TYPE" = "gpu" ]; then - logger "GoogleTest for ml-prims with cuda-memcheck enabled..." - cd $WORKSPACE/ci/artifacts/cuml/cpu/conda_work/cpp/build - python ../scripts/cuda-memcheck.py -tool memcheck -exe ./test/prims - fi - - if [ "$(arch)" = "x86_64" ]; then - gpuci_logger "Building doxygen C++ docs" - #Need to run in standard directory, not our artifact dir - unset LIBCUML_BUILD_DIR - $WORKSPACE/build.sh cppdocs -v - - if [ "$CUDA_REL" != "11.0" ]; then - gpuci_logger "Building python docs" - $WORKSPACE/build.sh pydocs - fi - fi - -fi - -if [ -n "${CODECOV_TOKEN}" ]; then - - # NOTE: The code coverage upload needs to work for both PR builds and normal - # branch builds (aka `branch-0.XX`). Ensure the following settings to the - # codecov CLI will work with and without a PR - gpuci_logger "Uploading Code Coverage to codecov.io" - - # Directory containing reports - REPORT_DIR="${WORKSPACE}/python/cuml" - - # Base name to use in Codecov UI - CODECOV_NAME=${JOB_BASE_NAME:-"${OS},py${PYTHON},cuda${CUDA}"} - - # Codecov args needed by both calls - EXTRA_CODECOV_ARGS="-c" - - # Save the OS PYTHON and CUDA flags - EXTRA_CODECOV_ARGS="${EXTRA_CODECOV_ARGS} -e OS,PYTHON,CUDA" - - # If we have REPORT_HASH, use that instead. This fixes an issue where - # CodeCov uses a local merge commit created by Jenkins. Since this commit - # never gets pushed, it causes issues in Codecov - if [ -n "${REPORT_HASH}" ]; then - EXTRA_CODECOV_ARGS="${EXTRA_CODECOV_ARGS} -C ${REPORT_HASH}" - fi - - # Append the PR ID. This is needed when running the build inside docker for - # PR builds - if [ -n "${PR_ID}" ]; then - EXTRA_CODECOV_ARGS="${EXTRA_CODECOV_ARGS} -P ${PR_ID}" - fi - - # Set the slug since this does not work in jenkins. - export CODECOV_SLUG="${PR_AUTHOR:-"rapidsai"}/cuml" - - # Upload the two reports with separate flags. Delete the report on success - # to prevent further CI steps from re-uploading - curl -s https://codecov.io/bash | bash -s -- -F non-dask -f ${REPORT_DIR}/cuml-coverage.xml -n "$CODECOV_NAME,non-dask" ${EXTRA_CODECOV_ARGS} - curl -s https://codecov.io/bash | bash -s -- -F dask -f ${REPORT_DIR}/cuml-dask-coverage.xml -n "$CODECOV_NAME,dask" ${EXTRA_CODECOV_ARGS} -fi - -return ${EXITCODE} diff --git a/ci/gpu/test-notebooks.sh b/ci/gpu/test-notebooks.sh deleted file mode 100755 index fe167d548f..0000000000 --- a/ci/gpu/test-notebooks.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# Copyright (c) 2020-2021, NVIDIA CORPORATION. - -NOTEBOOKS_DIR="$WORKSPACE/notebooks" -NBTEST="$WORKSPACE/ci/utils/nbtest.sh" -LIBCUDF_KERNEL_CACHE_PATH="$WORKSPACE/.jitcache" - -cd ${NOTEBOOKS_DIR} -TOPLEVEL_NB_FOLDERS=$(find . -name *.ipynb |cut -d'/' -f2|sort -u) - -# Add notebooks that should be skipped here -# (space-separated list of filenames without paths) - -SKIPNBS="cuml_benchmarks.ipynb" - -## Check env -env - -NOTEBOOKS_EXITCODE=0 - -# Always run nbtest in all TOPLEVEL_NB_FOLDERS, set EXITCODE to failure -# if any run fails - -cd ${NOTEBOOKS_DIR} -for nb in $(find . -name "*.ipynb"); do - nbBasename=$(basename ${nb}) - # Skip all NBs that use dask (in the code or even in their name) - if ((echo ${nb}|grep -qi dask) || \ - (grep -q dask ${nb})); then - echo "--------------------------------------------------------------------------------" - echo "SKIPPING: ${nb} (suspected Dask usage, not currently automatable)" - echo "--------------------------------------------------------------------------------" - elif (echo " ${SKIPNBS} " | grep -q " ${nbBasename} "); then - echo "--------------------------------------------------------------------------------" - echo "SKIPPING: ${nb} (listed in skip list)" - echo "--------------------------------------------------------------------------------" - else - nvidia-smi - ${NBTEST} ${nbBasename} - NOTEBOOKS_EXITCODE=$((NOTEBOOKS_EXITCODE | $?)) - rm -rf ${LIBCUDF_KERNEL_CACHE_PATH}/* - fi -done - - -nvidia-smi - -exit ${NOTEBOOKS_EXITCODE} diff --git a/ci/local/README.md b/ci/local/README.md deleted file mode 100644 index 0c46bff8fe..0000000000 --- a/ci/local/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## Purpose - -This script is designed for developer and contributor use. This tool mimics the actions of gpuCI on your local machine. This allows you to test and even debug your code inside a gpuCI base container before pushing your code as a GitHub commit. -The script can be helpful in locally triaging and debugging RAPIDS continuous integration failures. - -## Requirements - -``` -nvidia-docker -``` - -## Usage - -``` -bash build.sh [-h] [-H] [-s] [-r ] [-i ] -Build and test your local repository using a base gpuCI Docker image - -where: - -H Show this help text - -r Path to repository (defaults to working directory) - -i Use Docker image (default is gpuci/rapidsai:${NIGHTLY_VERSION}-cuda10.1-devel-ubuntu16.04-py3.7) - -s Skip building and testing and start an interactive shell in a container of the Docker image -``` - -Example Usage: -`bash build.sh -r ~/rapids/cuml -i gpuci/rapidsai:0.16-cuda10.2-devel-ubuntu16.04-py3.7` - -For a full list of available gpuCI docker images, visit our [DockerHub](https://hub.docker.com/r/gpuci/rapidsai/tags) page. - -Style Check: -```bash -$ bash ci/local/build.sh -r ~/rapids/cuml -s -$ source activate rapids # Activate gpuCI conda environment -$ cd rapids -$ flake8 --config=python/setup.cfg -``` - -## Information - -There are some caveats to be aware of when using this script, especially if you plan on developing from within the container itself. - - -### Docker Image Build Repository - -The docker image will generate build artifacts in a folder on your machine located in the `root` directory of the repository you passed to the script. For the above example, the directory is named `~/rapids/cuml/build_rapidsai_cuda10.1-ubuntu16.04-py3.7/`. Feel free to remove this directory after the script is finished. - -*Note*: The script *will not* override your local build repository. Your local environment stays in tact. - - -### Where The User is Dumped - -The script will build your repository and run all tests. If any tests fail, it dumps the user into the docker container itself to allow you to debug from within the container. If all the tests pass as expected the container exits and is automatically removed. Remember to exit the container if tests fail and you do not wish to debug within the container itself. - - -### Container File Structure - -Your repository will be located in the `/rapids/` folder of the container. This folder is volume mounted from the local machine. Any changes to the code in this repository are replicated onto the local machine. The `cpp/build` and `python/build` directories within your repository is on a separate mount to avoid conflicting with your local build artifacts. diff --git a/ci/local/build.sh b/ci/local/build.sh deleted file mode 100755 index 644647e038..0000000000 --- a/ci/local/build.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2018-2021, NVIDIA CORPORATION. -############################################## -# cuML local build and test script for CI # -############################################## - - -GIT_DESCRIBE_TAG=`git describe --tags` -MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'` - -DOCKER_IMAGE="gpuci/rapidsai:${MINOR_VERSION}-cuda10.1-devel-ubuntu16.04-py3.7" -REPO_PATH=${PWD} -RAPIDS_DIR_IN_CONTAINER="/rapids" -CPP_BUILD_DIR="cuML/build" -PYTHON_BUILD_DIR="python/build" -CONTAINER_SHELL_ONLY=0 - -SHORTHELP="$(basename "$0") [-h] [-H] [-s] [-r ] [-i ]" -LONGHELP="${SHORTHELP} -Build and test your local repository using a base gpuCI Docker image - -where: - -H Show this help text - -r Path to repository (defaults to working directory) - -i Use Docker image (default is ${DOCKER_IMAGE}) - -s Skip building and testing and start an interactive shell in a container of the Docker image -" - -# Limit GPUs available to container based on CUDA_VISIBLE_DEVICES -if [[ -z "${CUDA_VISIBLE_DEVICES}" ]]; then - NVIDIA_VISIBLE_DEVICES="all" -else - NVIDIA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES} -fi - -while getopts ":hHr:i:s" option; do - case ${option} in - r) - REPO_PATH=${OPTARG} - ;; - i) - DOCKER_IMAGE=${OPTARG} - ;; - s) - CONTAINER_SHELL_ONLY=1 - ;; - h) - echo "${SHORTHELP}" - exit 0 - ;; - H) - echo "${LONGHELP}" - exit 0 - ;; - *) - echo "ERROR: Invalid flag" - echo "${SHORTHELP}" - exit 1 - ;; - esac -done - -REPO_PATH_IN_CONTAINER="${RAPIDS_DIR_IN_CONTAINER}/$(basename "${REPO_PATH}")" -CPP_BUILD_DIR_IN_CONTAINER="${RAPIDS_DIR_IN_CONTAINER}/$(basename "${REPO_PATH}")/${CPP_BUILD_DIR}" -PYTHON_BUILD_DIR_IN_CONTAINER="${RAPIDS_DIR_IN_CONTAINER}/$(basename "${REPO_PATH}")/${PYTHON_BUILD_DIR}" - - -# BASE_CONTAINER_BUILD_DIR is named after the image name, allowing for -# multiple image builds to coexist on the local filesystem. This will -# be mapped to the typical BUILD_DIR inside of the container. Builds -# running in the container generate build artifacts just as they would -# in a bare-metal environment, and the host filesystem is able to -# maintain the host build in BUILD_DIR as well. -# shellcheck disable=SC2001,SC2005,SC2046 -BASE_CONTAINER_BUILD_DIR=${REPO_PATH}/build_$(echo $(basename "${DOCKER_IMAGE}")|sed -e 's/:/_/g') -CPP_CONTAINER_BUILD_DIR=${BASE_CONTAINER_BUILD_DIR}/cpp -PYTHON_CONTAINER_BUILD_DIR=${BASE_CONTAINER_BUILD_DIR}/python - - -BUILD_SCRIPT="#!/bin/bash -set -e -WORKSPACE=${REPO_PATH_IN_CONTAINER} -PREBUILD_SCRIPT=${REPO_PATH_IN_CONTAINER}/ci/gpu/prebuild.sh -BUILD_SCRIPT=${REPO_PATH_IN_CONTAINER}/ci/gpu/build.sh -cd \${WORKSPACE} -if [ -f \${PREBUILD_SCRIPT} ]; then - source \${PREBUILD_SCRIPT} -fi -yes | source \${BUILD_SCRIPT} -" - -if (( CONTAINER_SHELL_ONLY == 0 )); then - COMMAND="${CPP_BUILD_DIR_IN_CONTAINER}/build.sh || bash" -else - COMMAND="bash" -fi - -# Create the build dir for the container to mount, generate the build script inside of it -mkdir -p "${BASE_CONTAINER_BUILD_DIR}" -mkdir -p "${CPP_CONTAINER_BUILD_DIR}" -mkdir -p "${PYTHON_CONTAINER_BUILD_DIR}" -# Create build directories. This is to ensure correct owner for directories. If -# directories don't exist there is side effect from docker volume mounting creating build -# directories owned by root(volume mount point(s)) -mkdir -p "${REPO_PATH}/${CPP_BUILD_DIR}" -mkdir -p "${REPO_PATH}/${PYTHON_BUILD_DIR}" - -echo "${BUILD_SCRIPT}" > "${CPP_CONTAINER_BUILD_DIR}/build.sh" -chmod ugo+x "${CPP_CONTAINER_BUILD_DIR}/build.sh" -PASSWD_FILE="/etc/passwd" -GROUP_FILE="/etc/group" - -USER_FOUND=$(grep -wc "$(whoami)" < "$PASSWD_FILE") -if [ "$USER_FOUND" == 0 ]; then - echo "Local User not found, LDAP WAR for docker mounts activated. Creating dummy passwd and group" - echo "files to allow docker resolve username and group" - cp "$PASSWD_FILE" /tmp/passwd - PASSWD_FILE="/tmp/passwd" - cp "$GROUP_FILE" /tmp/group - GROUP_FILE="/tmp/group" - echo "$(whoami):x:$(id -u):$(id -g):$(whoami),,,:$HOME:$SHELL" >> "$PASSWD_FILE" - echo "$(whoami):x:$(id -g):" >> "$GROUP_FILE" -fi - -# Run the generated build script in a container -docker pull "${DOCKER_IMAGE}" - -DOCKER_MAJOR=$(docker -v|sed 's/[^[0-9]*\([0-9]*\).*/\1/') -GPU_OPTS="--gpus device=${NVIDIA_VISIBLE_DEVICES}" -if [ "$DOCKER_MAJOR" -lt 19 ] -then - GPU_OPTS="--runtime=nvidia -e NVIDIA_VISIBLE_DEVICES='${NVIDIA_VISIBLE_DEVICES}'" -fi - -docker run --rm -it ${GPU_OPTS} \ - --user "$(id -u)":"$(id -g)" \ - -v "${REPO_PATH}:${REPO_PATH_IN_CONTAINER}" \ - -v "${CPP_CONTAINER_BUILD_DIR}:${CPP_BUILD_DIR_IN_CONTAINER}" \ - -v "${PYTHON_CONTAINER_BUILD_DIR}:${PYTHON_BUILD_DIR_IN_CONTAINER}" \ - -v "$PASSWD_FILE":/etc/passwd:ro \ - -v "$GROUP_FILE":/etc/group:ro \ - --cap-add=SYS_PTRACE \ - "${DOCKER_IMAGE}" bash -c "${COMMAND}" - diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 1add780bee..435fac1bcc 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -60,6 +60,7 @@ for FILE in dependencies.yaml conda/environments/*.yaml; do sed_runner "s/rapids-doc-env=${CURRENT_SHORT_TAG}/rapids-doc-env=${NEXT_SHORT_TAG}/g" ${FILE}; done +sed_runner "s|/branch-.*?/|/branch-${NEXT_SHORT_TAG}/|g" README.md sed_runner "s|/branch-.*?/|/branch-${NEXT_SHORT_TAG}/|g" python/README.md # Wheel builds clone cumlprims_mg, update its branch diff --git a/conda/recipes/cuml/meta.yaml b/conda/recipes/cuml/meta.yaml index deadc31314..1ed4db293d 100644 --- a/conda/recipes/cuml/meta.yaml +++ b/conda/recipes/cuml/meta.yaml @@ -78,12 +78,11 @@ requirements: - raft-dask ={{ minor_version }} - treelite {{ treelite_version }} -# TODO: Remove the linux64 tags on tests after disabling gpuCI / Jenkins -tests: # [linux64] - requirements: # [linux64] - - cudatoolkit ={{ cuda_version }} # [linux64] - imports: # [linux64] - - cuml # [linux64] +tests: + requirements: + - cudatoolkit ={{ cuda_version }} + imports: + - cuml about: home: https://rapids.ai/ diff --git a/wiki/cpp/DEVELOPER_GUIDE.md b/wiki/cpp/DEVELOPER_GUIDE.md index adf3954836..d30910478f 100644 --- a/wiki/cpp/DEVELOPER_GUIDE.md +++ b/wiki/cpp/DEVELOPER_GUIDE.md @@ -161,7 +161,7 @@ The reasons behind these deviations from the Google style guide are given in com All formatting checks are done by this python script: [run-clang-format.py](../../cpp/scripts/run-clang-format.py) which is effectively a wrapper over `clang-format`. An error is raised if the code diverges from the format suggested by clang-format. It is expected that the developers run this script to detect and fix formatting violations before creating PR. #### As part of CI -[run-clang-format.py](../../cpp/scripts/run-clang-format.py) is executed as part of our `gpuCI/cuml/style-check` CI test. If there are any formatting violations, PR author is expected to fix those to get CI passing. Steps needed to fix the formatting violations are described in the subsequent sub-section. +[run-clang-format.py](../../cpp/scripts/run-clang-format.py) is executed as part of our CI tests. If there are any formatting violations, PR author is expected to fix those to get CI passing. Steps needed to fix the formatting violations are described in the subsequent sub-section. #### Manually Developers can also manually (or setup this command as part of git pre-commit hook) run this check by executing: