-
Notifications
You must be signed in to change notification settings - Fork 60
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. (#471)
This PR adds GitHub Actions workflows to `cucim`. ### Task list Coverage required for this PR: - [x] C++ build - [x] ~C++ tests~ (There are no C++ tests.) - [x] Python build - [x] Python tests - Some tests have been marked as `xfail` on ARM following discussion with @jakirkham and @grlee77. Those will be addressed in follow-up work. - [x] Style checks Authors: - Bradley Dice (https://github.com/bdice) - AJ Schmidt (https://github.com/ajschmidt8) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) - https://github.com/jakirkham URL: #471
- Loading branch information
Showing
28 changed files
with
617 additions
and
153 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 |
---|---|---|
|
@@ -7,3 +7,4 @@ label_checker: true | |
release_drafter: true | ||
external_contributors: false | ||
copy_prs: true | ||
recently_updated: true |
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 @@ | ||
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: | ||
cpp-build: | ||
secrets: inherit | ||
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-matrix-build.yaml@main | ||
with: | ||
build_type: ${{ inputs.build_type || 'branch' }} | ||
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' }} | ||
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' }} | ||
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,41 @@ | ||
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-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 | ||
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,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 }} |
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,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/libcucim | ||
|
||
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,23 @@ | ||
#!/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` flag once importing on a CPU | ||
# node works correctly | ||
rapids-mamba-retry mambabuild \ | ||
--no-test \ | ||
--channel "${CPP_CHANNEL}" \ | ||
conda/recipes/cucim | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2022, NVIDIA CORPORATION. | ||
|
||
# Common setup steps shared by Python test jobs | ||
|
||
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" | ||
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) | ||
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 \ | ||
--channel "${CPP_CHANNEL}" \ | ||
--channel "${PYTHON_CHANNEL}" \ | ||
libcucim cucim | ||
|
||
rapids-logger "Check GPU usage" | ||
nvidia-smi | ||
|
||
set +e | ||
|
||
rapids-logger "pytest cucim" | ||
pushd python/cucim | ||
pytest \ | ||
--cache-clear \ | ||
--junitxml="${RAPIDS_TESTS_DIR}/junit-cucim.xml" \ | ||
--numprocesses=8 \ | ||
--dist=loadscope \ | ||
--cov-config=.coveragerc \ | ||
--cov=cucim \ | ||
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cucim-coverage.xml" \ | ||
--cov-report=term \ | ||
src \ | ||
tests/unit \ | ||
tests/performance | ||
exitcode=$? | ||
|
||
if (( ${exitcode} != 0 )); then | ||
SUITEERROR=${exitcode} | ||
echo "FAILED: 1 or more tests in cucim" | ||
fi | ||
popd | ||
|
||
exit ${SUITEERROR} |
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 @@ | ||
# This file is generated by `rapids-dependency-file-generator`. | ||
# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. | ||
channels: | ||
- rapidsai | ||
- rapidsai-nightly | ||
- conda-forge | ||
- nvidia | ||
dependencies: | ||
- GPUtil>=1.4.0 | ||
- c-compiler | ||
- click | ||
- cmake>=3.23.1,!=3.25.0 | ||
- cudatoolkit=11.5 | ||
- cupy >=10,<12.0.0a0 | ||
- cxx-compiler | ||
- gcc_linux-64=9.* | ||
- imagecodecs>=2021.6.8 | ||
- ipython | ||
- jbig | ||
- jpeg | ||
- libwebp-base | ||
- nbsphinx | ||
- ninja | ||
- numpy | ||
- numpydoc | ||
- nvcc_linux-64=11.5 | ||
- openslide-python>=1.1.2 | ||
- pip | ||
- pre-commit | ||
- psutil>=5.8.0 | ||
- pydata-sphinx-theme | ||
- pytest-cov>=2.12.1 | ||
- pytest-lazy-fixture>=0.6.3 | ||
- pytest-xdist | ||
- pytest>=6.2.4 | ||
- python>=3.8,<3.10 | ||
- recommonmark | ||
- scikit-image >=0.19.0,<0.20.0a0 | ||
- scipy | ||
- sphinx | ||
- sysroot_linux-64==2.17 | ||
- tifffile>=2022.7.28 | ||
- xz | ||
- yasm | ||
- zlib | ||
- zstd | ||
- pip: | ||
- opencv-python-headless>=4.6 | ||
name: all_cuda-115_arch-x86_64 |
Oops, something went wrong.