diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 23d0af35f..9bfa630e1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,8 +2,9 @@ dask_cuda/ @rapidsai/daskcuda-python-codeowners #build/ops code owners -.github/ @rapidsai/ops-codeowners +.github/ @rapidsai/ops-codeowners ci/ @rapidsai/ops-codeowners conda/ @rapidsai/ops-codeowners **/Dockerfile @rapidsai/ops-codeowners **/.dockerignore @rapidsai/ops-codeowners +dependencies.yaml @rapidsai/ops-codeowners diff --git a/.github/ops-bot.yaml b/.github/ops-bot.yaml index 5808edbd4..2d1444c59 100644 --- a/.github/ops-bot.yaml +++ b/.github/ops-bot.yaml @@ -5,5 +5,5 @@ auto_merger: true branch_checker: true label_checker: true release_drafter: true -external_contributors: false copy_prs: true +recently_updated: true diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..46ba42843 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,63 @@ +name: build + +on: + push: + branches: + - "branch-*" + tags: + - v[0-9][0-9].[0-9][0-9].[0-9][0-9] + workflow_dispatch: + inputs: + branch: + required: true + type: string + date: + required: true + type: string + sha: + required: true + type: string + build_type: + type: string + default: nightly + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + conda-python-build: + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-matrix-build.yaml@main + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + sha: ${{ inputs.sha }} + upload-conda: + needs: [conda-python-build] + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@main + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + sha: ${{ inputs.sha }} + wheel-build: + runs-on: ubuntu-latest + container: + image: rapidsai/ci:latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Build wheel + run: ci/build_python_pypi.sh + - name: Publish distribution 📦 to PyPI + if: inputs.build_type == 'nightly' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.RAPIDSAI_PYPI_TOKEN }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 000000000..c48c8f7b7 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,49 @@ +name: pr + +on: + push: + branches: + - "pull-request/[0-9]+" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + pr-builder: + needs: + - checks + - conda-python-build + - conda-python-tests + - wheel-build + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@main + checks: + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@main + conda-python-build: + needs: checks + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-matrix-build.yaml@main + with: + build_type: pull-request + conda-python-tests: + needs: conda-python-build + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@main + with: + build_type: pull-request + wheel-build: + needs: checks + runs-on: ubuntu-latest + container: + image: rapidsai/ci:latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Build wheel + run: ci/build_python_pypi.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..44dbd99a5 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,24 @@ +name: test + +on: + workflow_dispatch: + inputs: + branch: + required: true + type: string + date: + required: true + type: string + sha: + required: true + type: string + +jobs: + conda-python-tests: + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@main + with: + build_type: nightly + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + sha: ${{ inputs.sha }} diff --git a/ci/build_python.sh b/ci/build_python.sh new file mode 100755 index 000000000..4124a4c5a --- /dev/null +++ b/ci/build_python.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright (c) 2022, NVIDIA CORPORATION. + +set -euo pipefail + +source rapids-env-update + +export CMAKE_GENERATOR=Ninja + +rapids-print-env + +rapids-logger "Begin py build" + +rapids-mamba-retry mambabuild \ + conda/recipes/dask-cuda + +rapids-upload-conda-to-s3 python diff --git a/ci/build_python_pypi.sh b/ci/build_python_pypi.sh new file mode 100755 index 000000000..5fea926cd --- /dev/null +++ b/ci/build_python_pypi.sh @@ -0,0 +1,18 @@ +#!/bin/bash + + +python -m pip install build --user + +# While conda provides these during conda-build, they are also necessary during +# the setup.py build for PyPI +export GIT_DESCRIBE_TAG=$(git describe --abbrev=0 --tags) +export GIT_DESCRIBE_NUMBER=$(git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count) + +# Compute/export VERSION_SUFFIX +source rapids-env-update + +python -m build \ + --sdist \ + --wheel \ + --outdir dist/ \ + . diff --git a/ci/check_style.sh b/ci/check_style.sh new file mode 100755 index 000000000..be3ac3f4b --- /dev/null +++ b/ci/check_style.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright (c) 2020-2022, NVIDIA CORPORATION. + +set -euo pipefail + +rapids-logger "Create checks conda environment" +. /opt/conda/etc/profile.d/conda.sh + +rapids-dependency-file-generator \ + --output conda \ + --file_key checks \ + --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml + +rapids-mamba-retry env create --force -f env.yaml -n checks +conda activate checks + +# Run pre-commit checks +pre-commit run --hook-stage manual --all-files --show-diff-on-failure diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index e71b89e42..b9661f522 100755 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -26,7 +26,7 @@ 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_PATH=$CONDA_PREFIX -export UCXPY_VERSION=0.30.* +export UCXPY_VERSION=0.30 unset GIT_DESCRIBE_TAG # Enable NumPy's __array_function__ protocol (needed for NumPy 1.16.x, diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index afd907b53..0938bff0d 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -22,7 +22,7 @@ CURRENT_SHORT_TAG=${CURRENT_MAJOR}.${CURRENT_MINOR} NEXT_MAJOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[1]}') NEXT_MINOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[2]}') NEXT_SHORT_TAG=${NEXT_MAJOR}.${NEXT_MINOR} -NEXT_UCXPY_VERSION="$(curl -s https://version.gpuci.io/rapids/${NEXT_SHORT_TAG}).*" +NEXT_UCXPY_VERSION="$(curl -s https://version.gpuci.io/rapids/${NEXT_SHORT_TAG})" echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG" @@ -33,3 +33,8 @@ function sed_runner() { # Update UCX-Py version sed_runner "s/export UCXPY_VERSION=.*/export UCXPY_VERSION="${NEXT_UCXPY_VERSION}"/g" ci/gpu/build.sh + +# Bump cudf and dask-cudf testing dependencies +sed_runner "s/cudf=.*/cudf=${NEXT_SHORT_TAG}/g" dependencies.yaml +sed_runner "s/dask-cudf=.*/dask-cudf=${NEXT_SHORT_TAG}/g" dependencies.yaml +sed_runner "s/ucx-py=.*/ucx-py=${NEXT_UCXPY_VERSION}/g" dependencies.yaml diff --git a/ci/test_python.sh b/ci/test_python.sh new file mode 100755 index 000000000..25e19cca7 --- /dev/null +++ b/ci/test_python.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# Copyright (c) 2022, NVIDIA CORPORATION. + +set -euo pipefail + +. /opt/conda/etc/profile.d/conda.sh + +rapids-logger "Generate Python testing dependencies" +rapids-dependency-file-generator \ + --output conda \ + --file_key test_python \ + --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml + +rapids-mamba-retry env create --force -f env.yaml -n test + +# Temporarily allow unbound variables for conda activation. +set +u +conda activate test +set -u + +rapids-logger "Downloading artifacts from previous jobs" +PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python) + +RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"} +RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"} +mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}" +SUITEERROR=0 + +rapids-print-env + +rapids-mamba-retry install \ + -c "${PYTHON_CHANNEL}" \ + dask-cuda + +rapids-logger "Check GPU usage" +nvidia-smi + +set +e + +rapids-logger "pytest dask-cuda" +pushd dask_cuda +DASK_CUDA_TEST_SINGLE_GPU=1 \ +UCXPY_IFNAME=eth0 \ +UCX_WARN_UNUSED_ENV_VARS=n \ +UCX_MEMTYPE_CACHE=n \ +pytest \ + --capture=no \ + --cache-clear \ + --junitxml="${RAPIDS_TESTS_DIR}/junit-dask-cuda.xml" \ + --cov-config=../pyproject.toml \ + --cov=dask_cuda \ + --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/dask-cuda-coverage.xml" \ + --cov-report=term \ + tests +exitcode=$? + +if (( ${exitcode} != 0 )); then + SUITEERROR=${exitcode} + echo "FAILED: 1 or more tests in dask-cuda" +fi +popd + +rapids-logger "Run local benchmark" +python dask_cuda/benchmarks/local_cudf_shuffle.py \ + --partition-size="1 KiB" \ + -d 0 \ + --runs 1 \ + --backend dask +exitcode=$? + +if (( ${exitcode} != 0 )); then + SUITEERROR=${exitcode} + echo "FAILED: Local benchmark with dask comms" +fi + +python dask_cuda/benchmarks/local_cudf_shuffle.py \ + --partition-size="1 KiB" \ + -d 0 \ + --runs 1 \ + --backend explicit-comms +exitcode=$? + +if (( ${exitcode} != 0 )); then + SUITEERROR=${exitcode} + echo "FAILED: Local benchmark with explicit comms" +fi + +exit ${SUITEERROR} diff --git a/conda/recipes/dask-cuda/meta.yaml b/conda/recipes/dask-cuda/meta.yaml index a31628b23..b0b02cb2e 100644 --- a/conda/recipes/dask-cuda/meta.yaml +++ b/conda/recipes/dask-cuda/meta.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-2022, NVIDIA CORPORATION. # Usage: # conda build -c conda-forge . @@ -6,7 +6,7 @@ {% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set number = environ.get('GIT_DESCRIBE_NUMBER', 0) %} -{% set py_version = environ.get('CONDA_PY', 36) %} +{% set py_version = environ['CONDA_PY'] %} {% set git_hash = environ.get('GIT_DESCRIBE_HASH', '') %} package: @@ -42,9 +42,8 @@ test: imports: - dask_cuda - about: - home: http://rapids.ai/ + home: https://rapids.ai/ license: Apache-2.0 license_file: ../../../LICENSE summary: dask-cuda library diff --git a/dependencies.yaml b/dependencies.yaml new file mode 100644 index 000000000..663fd2161 --- /dev/null +++ b/dependencies.yaml @@ -0,0 +1,103 @@ +# Dependency list for https://github.com/rapidsai/dependency-file-generator +files: + all: + output: none + includes: + - build_python + - cudatoolkit + - develop + - py_version + - run_python + - test_python + test_python: + output: none + includes: + - cudatoolkit + - py_version + - test_python + checks: + output: none + includes: + - develop + - py_version +channels: + - rapidsai + - rapidsai-nightly + - dask/label/dev + - conda-forge + - nvidia +dependencies: + build_python: + common: + - output_types: [conda, requirements] + packages: + - setuptools>=64.0.0 + cudatoolkit: + specific: + - output_types: conda + matrices: + - matrix: + cuda: "11.2" + packages: + - cudatoolkit=11.2 + - matrix: + cuda: "11.4" + packages: + - cudatoolkit=11.4 + - matrix: + cuda: "11.5" + packages: + - cudatoolkit=11.5 + develop: + common: + - output_types: [conda, requirements] + packages: + - pre-commit + py_version: + specific: + - output_types: conda + matrices: + - matrix: + py: "3.8" + packages: + - python=3.8 + - matrix: + py: "3.9" + packages: + - python=3.9 + - matrix: + packages: + - python>=3.8,<3.10 + run_python: + common: + - output_types: [conda, requirements] + packages: + - dask>=2022.12.0 + - distributed>=2022.12.0 + - numba>=0.54 + - numpy>=1.18.0 + - pandas>=1.0 + - pynvml>=11.0.0 + - zict>=0.1.3 + test_python: + common: + - output_types: [conda] + packages: + - cucim + - cudf=23.02 + - dask-cudf=23.02 + - pytest + - pytest-cov + - ucx-proc=*=gpu + - ucx-py=0.30 + specific: + - output_types: conda + matrices: + - matrix: + arch: x86_64 + packages: + - numactl-devel-cos7-x86_64 + - matrix: + arch: aarch64 + packages: + - numactl-devel-cos7-aarch64