Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions Workflows #1062

Merged
merged 41 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
56f84a4
Add GitHub Actions Workflows [skip gpuci]
bdice Dec 5, 2022
47678e8
Merge remote-tracking branch 'upstream/branch-23.02' into gha
bdice Dec 5, 2022
f645d8a
Add style check script.
bdice Dec 5, 2022
151568f
Update coverage config.
bdice Dec 5, 2022
dbfeb96
Add numactl-libs-cos7-ARCH to testing dependencies.
bdice Dec 5, 2022
52fe124
Try devel instead of libs for numactl.
bdice Dec 5, 2022
6ea6272
Add dask-cudf to testing dependencies.
bdice Dec 5, 2022
b89b7f8
Add needs.
bdice Dec 5, 2022
4503a1f
Update CODEOWNERS.
bdice Dec 5, 2022
7737c68
Run CI with newer image containing libnuma.
bdice Dec 7, 2022
5bf3c68
Retest with gpuCI enabled.
bdice Dec 7, 2022
05b601c
Minor updates.
bdice Dec 13, 2022
712b565
Require CONDA_PY.
bdice Dec 14, 2022
18412ae
Add dependencies.yaml to update-version.sh.
bdice Dec 21, 2022
c49f3a6
Add basic wheel build job.
bdice Dec 21, 2022
d5c08da
Add environment variables.
bdice Dec 21, 2022
20b154b
Fix YAML syntax.
bdice Dec 21, 2022
1d2b497
Fix YAML again.
bdice Dec 21, 2022
a0e2299
Use fetch-depth: 0.
bdice Dec 21, 2022
bb0e90f
Add version suffix.
bdice Dec 21, 2022
1461cb3
Try new wheels workflow.
bdice Dec 21, 2022
2dbeb2c
Redo workflow.
bdice Dec 21, 2022
9145f2a
Use source.
bdice Dec 21, 2022
ef673b9
Use bash.
bdice Dec 21, 2022
1e4dad2
Add wheel build workflow to build.yaml.
bdice Dec 21, 2022
8e4cfbb
clean up GHA job syntax
ajschmidt8 Jan 1, 2023
8a07c21
rm `standardize repository information` steps
ajschmidt8 Jan 1, 2023
5840b12
update `bash` command substitution syntax
ajschmidt8 Jan 1, 2023
de20ceb
rm PyPI upload step from PR workflow
ajschmidt8 Jan 1, 2023
7c2b129
rm references to `CURRENT_SHORT_TAG` in `update-version.sh
ajschmidt8 Jan 1, 2023
c7c484f
rerun `update-version.sh` to sync versions
ajschmidt8 Jan 1, 2023
2e2c9d9
rm extraneous matrix key from `output: none` file entry
ajschmidt8 Jan 1, 2023
e681811
mv common build steps to `build_python_pypi.sh`
ajschmidt8 Jan 1, 2023
6ae8ccb
fix `build_python_pypi.sh`
ajschmidt8 Jan 1, 2023
6c9d26e
Merge branch 'branch-23.02' into gha
ajschmidt8 Jan 1, 2023
d9af730
enable `recently_updated` plugin
ajschmidt8 Jan 1, 2023
297accb
update nightly workflows [skip ci]
ajschmidt8 Jan 2, 2023
0b874d3
Merge branch 'branch-23.02' into gha
bdice Jan 3, 2023
2a3eaff
Update .github/workflows/build.yaml
ajschmidt8 Jan 3, 2023
80bf6db
Apply suggestions from code review
ajschmidt8 Jan 3, 2023
5712a8b
fix YAML spacing
ajschmidt8 Jan 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/ops-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
63 changes: 63 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: build

on:
push:
branches:
- "branch-*"
tags:
- v[0-9][0-9].[0-9][0-9].[0-9][0-9]
ajschmidt8 marked this conversation as resolved.
Show resolved Hide resolved
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 == 'branch'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: inputs.build_type == 'branch'
if: inputs.build_type == 'nightly'

For parity with the Jenkins setup, we should only publish this once a day (at night).

We'll also need to add this repo to the RAPIDS nightly pipeline below

uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.RAPIDSAI_PYPI_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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:
ajschmidt8 marked this conversation as resolved.
Show resolved Hide resolved
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:
ajschmidt8 marked this conversation as resolved.
Show resolved Hide resolved
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
24 changes: 24 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
17 changes: 17 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions ci/build_python_pypi.sh
Original file line number Diff line number Diff line change
@@ -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/ \
.
18 changes: 18 additions & 0 deletions ci/check_style.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
88 changes: 88 additions & 0 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
@@ -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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only capture the latest error, which may or may not be fine depending on how this is handled outside. Since we can't return multiple error codes on a single script, I think it might make sense to:

  1. Have one script per executed test (in this particular case we would need 3, the first pytest and two benchmarks); or
  2. Logging the error code for each failing test and returning a generic error code that the caller of this script will be able to parse (e.g., 0 for "success" and 1 for "error(s) occurred").

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have plans to revisit and simplify some of this logic in follow-up PRs, but ultimately I think we only care to distinguish zero (success) from non-zero (failure) exit codes for the purposes of GitHub Actions calling this script.

7 changes: 3 additions & 4 deletions conda/recipes/dask-cuda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Copyright (c) 2019-2022, NVIDIA CORPORATION.

# Usage:
# conda build -c conda-forge .
{% set data = load_file_data("pyproject.toml") %}

{% 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'] %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand probably now we are sure that CONDA_PY is set, but what if there's a regression, wouldn't be better to keep a safe default like other variables have?

Copy link
Contributor Author

@bdice bdice Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is set by conda, not by RAPIDS. This should be safe -- and if it's not, we want to have a hard failure. Also we want to avoid setting defaults that need continually updated in the recipes as we change Python version support.

{% set git_hash = environ.get('GIT_DESCRIBE_HASH', '') %}

package:
Expand Down Expand Up @@ -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
Loading