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. #471

Merged
merged 29 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e334c78
Standardizing conda recipes.
bdice Dec 22, 2022
f0612f8
Draft of GitHub Actions.
bdice Dec 22, 2022
9136ebb
Update pre-commit configuration.
bdice Dec 22, 2022
27a1629
Update test scripts and style.
bdice Dec 22, 2022
6aace33
Add flake8 config path.
bdice Dec 22, 2022
65d1571
Fix style checks.
bdice Dec 22, 2022
43cc750
Update dependencies.yaml.
bdice Dec 22, 2022
4080dde
Update dependencies.
bdice Dec 22, 2022
0943a58
Retry CI.
bdice Dec 22, 2022
33277eb
Update opencv dependency.
bdice Dec 22, 2022
afcad76
Skip notebook tests.
bdice Dec 22, 2022
b0f9292
Fix pr.yaml, add workarounds for Jenkins compat, sccache vars.
bdice Dec 22, 2022
4e6a72b
Require cupy 10 to avoid issues with latest numpy.
bdice Dec 22, 2022
99b57b6
Use same testing script as other repos; enable pytest-xdist.
bdice Dec 22, 2022
82ec7f7
Minimize dependencies.yaml. [skip ci]
bdice Dec 22, 2022
d5ab7a9
Rerun CI.
bdice Dec 22, 2022
2fbb855
Update dependencies.
bdice Dec 22, 2022
0bb6559
Exit with proper code.
bdice Dec 22, 2022
0193e8b
fix/reorder `mamba install` pkgs
ajschmidt8 Jan 1, 2023
b4d69bd
sort recipe lists
ajschmidt8 Jan 1, 2023
83752e9
rm extraneous YAML anchors in `dependencies.yaml`
ajschmidt8 Jan 1, 2023
df15e1a
enable `recently_updated` plugin
ajschmidt8 Jan 1, 2023
ec8af4a
update nightly workflows [skip ci]
ajschmidt8 Jan 2, 2023
6045729
use `opencv-python-headless` for tests
ajschmidt8 Jan 3, 2023
97b48a4
Remove notebook testing.
bdice Jan 4, 2023
eba8628
Mark tests as xfail on ARM until they can be fixed.
bdice Jan 6, 2023
772e580
Merge remote-tracking branch 'upstream/branch-23.02' into gha
bdice Jan 6, 2023
b91daf5
Add yasm to build dependencies.
bdice Jan 6, 2023
93c2c1e
Remove .pre-commit-config.yaml from MANIFEST.in.
bdice Jan 7, 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 @@ -10,9 +10,10 @@ python/ @rapidsai/cucim-python-codeowners
**/cmake/ @rapidsai/cucim-cmake-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
docker/ @rapidsai/ops-codeowners
dependencies.yaml @rapidsai/ops-codeowners
1 change: 1 addition & 0 deletions .github/ops-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ label_checker: true
release_drafter: true
external_contributors: false
copy_prs: true
recently_updated: true
54 changes: 54 additions & 0 deletions .github/workflows/build.yaml
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 }}
41 changes: 41 additions & 0 deletions .github/workflows/pr.yaml
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
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 }}
23 changes: 13 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@
# pre-commit install-hooks
exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: master
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/pycqa/isort
rev: 5.6.4
# TODO: re-enable this after GitHub Actions migration, it currently makes a
# large number of changes that shouldn't go in the GitHub Actions PR.
#- repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v4.4.0
# hooks:
# - id: trailing-whitespace
# - id: end-of-file-fixer
# - id: debug-statements
- repo: https://github.com/PyCQA/isort
rev: 5.11.4
hooks:
- id: isort
files: ^python/cucim/src/.*
args: ["--settings-path=python/cucim/setup.cfg"]
- repo: https://gitlab.com/pycqa/flake8
rev: master
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--config=python/cucim/setup.cfg"]
files: ^python/cucim/.*
16 changes: 16 additions & 0 deletions ci/build_cpp.sh
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
23 changes: 23 additions & 0 deletions ci/build_python.sh
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
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
4 changes: 4 additions & 0 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ echo "PYTHON_VER : ${PYTHON_VER}"
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 CONDA_BLD_DIR="${WORKSPACE}/.conda-bld"

################################################################################
Expand Down
4 changes: 4 additions & 0 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ echo "CUDA_VERSION: ${CUDA_VERSION}"
echo "CUDA_VER : ${CUDA_VER}"
echo "PYTHON_VER : ${PYTHON_VER}"

# Workaround to keep Jenkins builds working
# until we migrate fully to GitHub Actions
export RAPIDS_CUDA_VERSION="${CUDA}"

################################################################################
# SETUP - Check environment
################################################################################
Expand Down
66 changes: 66 additions & 0 deletions ci/test_python.sh
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}
49 changes: 49 additions & 0 deletions conda/environments/all_cuda-115_arch-x86_64.yaml
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
Loading