-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions Workflows. (#1076)
This PR adds GitHub Actions workflows to `raft`. **Wait until after the 22.12 release is complete (and potentially until other repos are ready to migrate to GHA) to merge.** ### Task list Coverage required for this PR: - [x] C++ tests - [x] Two test failures on ARM? `Result/18: SWoRTests/SWoRTestD; /opt/conda/conda-bld/work/cpp/test/random/sample_without_replacement.cu:269` - [x] Python tests - [x] Codecov - [x] Style checks Future work: - Build Metrics Report (copy from cudf when it is added) - JUnit output annotations? https://github.com/marketplace/actions/junit-report-action - Reduce exit code handling verbosity (use global variable with `trap` function) - Set up `rapids-dependency-file-generator` pre-commit hook - Docs builds Authors: - Bradley Dice (https://github.com/bdice) - AJ Schmidt (https://github.com/ajschmidt8) Approvers: - Corey J. Nolet (https://github.com/cjnolet) - AJ Schmidt (https://github.com/ajschmidt8) URL: #1076
- Loading branch information
Showing
23 changed files
with
596 additions
and
132 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,5 @@ CMake: | |
- '**/CMakeLists.txt' | ||
- '**/cmake/**' | ||
|
||
gpuCI: | ||
ci: | ||
- 'ci/**' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- "branch-*" | ||
tags: | ||
- v[0-9][0-9].[0-9][0-9].[0-9][0-9] | ||
workflow_call: | ||
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: | ||
cpp-build: | ||
secrets: inherit | ||
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-matrix-build.yaml@main | ||
with: | ||
build_type: ${{ inputs.build_type || 'branch' }} | ||
repo: rapidsai/raft | ||
branch: ${{ inputs.branch }} | ||
date: ${{ inputs.date }} | ||
sha: ${{ inputs.sha }} | ||
python-build: | ||
needs: [cpp-build] | ||
secrets: inherit | ||
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-matrix-build.yaml@main | ||
with: | ||
build_type: ${{ inputs.build_type || 'branch' }} | ||
repo: rapidsai/raft | ||
branch: ${{ inputs.branch }} | ||
date: ${{ inputs.date }} | ||
sha: ${{ inputs.sha }} | ||
upload-conda: | ||
needs: [cpp-build, python-build] | ||
secrets: inherit | ||
uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@main | ||
with: | ||
build_type: ${{ inputs.build_type || 'branch' }} | ||
repo: rapidsai/raft | ||
branch: ${{ inputs.branch }} | ||
date: ${{ inputs.date }} | ||
sha: ${{ inputs.sha }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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-cpp-build | ||
- conda-cpp-tests | ||
- conda-python-build | ||
- conda-python-tests | ||
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-cpp-build: | ||
needs: checks | ||
secrets: inherit | ||
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-matrix-build.yaml@main | ||
with: | ||
build_type: pull-request | ||
node_type: cpu16 | ||
conda-cpp-tests: | ||
needs: conda-cpp-build | ||
secrets: inherit | ||
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@main | ||
with: | ||
build_type: pull-request | ||
conda-python-build: | ||
needs: conda-cpp-build | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
date: | ||
required: true | ||
type: string | ||
sha: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
conda-cpp-tests: | ||
secrets: inherit | ||
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@main | ||
with: | ||
build_type: nightly | ||
repo: rapidsai/raft | ||
branch: ${{ inputs.branch }} | ||
date: ${{ inputs.date }} | ||
sha: ${{ inputs.sha }} | ||
conda-python-tests: | ||
secrets: inherit | ||
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@main | ||
with: | ||
build_type: nightly | ||
repo: rapidsai/raft | ||
branch: ${{ inputs.branch }} | ||
date: ${{ inputs.date }} | ||
sha: ${{ inputs.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2022, NVIDIA CORPORATION. | ||
|
||
set -euo pipefail | ||
|
||
source rapids-env-update | ||
|
||
export CMAKE_GENERATOR=Ninja | ||
|
||
rapids-print-env | ||
|
||
rapids-logger "Begin cpp build" | ||
|
||
rapids-mamba-retry mambabuild conda/recipes/libraft | ||
|
||
rapids-upload-conda-to-s3 cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/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" | ||
|
||
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) | ||
|
||
# TODO: Remove `--no-test` flags once importing on a CPU | ||
# node works correctly | ||
rapids-mamba-retry mambabuild \ | ||
--no-test \ | ||
--channel "${CPP_CHANNEL}" \ | ||
conda/recipes/pylibraft | ||
|
||
rapids-mamba-retry mambabuild \ | ||
--no-test \ | ||
--channel "${CPP_CHANNEL}" \ | ||
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ | ||
conda/recipes/raft-dask | ||
|
||
rapids-upload-conda-to-s3 python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2022, NVIDIA CORPORATION. | ||
|
||
set -euo pipefail | ||
|
||
. /opt/conda/etc/profile.d/conda.sh | ||
|
||
rapids-logger "Generate C++ testing dependencies" | ||
rapids-dependency-file-generator \ | ||
--output conda \ | ||
--file_key test_cpp \ | ||
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | 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 | ||
|
||
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 | ||
|
||
rapids-mamba-retry install \ | ||
--channel "${CPP_CHANNEL}" \ | ||
libraft-headers libraft-distance libraft-nn libraft-tests | ||
|
||
rapids-logger "Check GPU usage" | ||
nvidia-smi | ||
|
||
set +e | ||
|
||
# Run libraft gtests from libraft-tests package | ||
rapids-logger "Run gtests" | ||
|
||
# TODO: exit code handling is too verbose. Find a cleaner solution. | ||
|
||
for gt in "$CONDA_PREFIX"/bin/gtests/libraft/* ; 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} |
Oops, something went wrong.