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 #836

Merged
merged 37 commits into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9c9dd4d
First draft of GitHub Actions for cuspatial.
bdice Dec 2, 2022
b2a0fb7
Run CI.
bdice Dec 2, 2022
628cd98
Add gtest/gmock as build dependencies.
bdice Dec 2, 2022
a472227
Add gtest to CMake.
bdice Dec 2, 2022
5757bd4
Temporarily skip checks requirement for C++ builds.
bdice Dec 2, 2022
21ab0e0
Add cusparse.
bdice Dec 2, 2022
012116f
Add libcusparse to meta.yaml.
bdice Dec 5, 2022
831411d
Merge remote-tracking branch 'upstream/branch-23.02' into gha
bdice Dec 5, 2022
1471a53
Don't specify default script name.
bdice Dec 5, 2022
6057556
Define CUSPATIAL_HOME.
bdice Dec 5, 2022
f92aa9b
Require checks.
bdice Dec 5, 2022
298cc7b
Re-enable sccache for Jenkins.
bdice Dec 5, 2022
4c55dde
Merge branch 'gha' of github.com:bdice/cuspatial into gha
bdice Dec 5, 2022
4c210ed
Trigger gpuCI.
bdice Dec 5, 2022
7a70a1f
Add needs.
bdice Dec 5, 2022
a07ac5b
libcusparse-dev requires libcusparse, so don't specify both.
bdice Dec 8, 2022
8485886
libcusparse-dev requires libcusparse, so don't specify both.
bdice Dec 8, 2022
bd51189
Update environment.
bdice Dec 8, 2022
868057c
Remove "set +e".
bdice Dec 13, 2022
3aed4d9
Remove default RAPIDS_CUDA_VERSION.
bdice Dec 13, 2022
425fa3d
Remove default RAPIDS_CUDA_VERSION.
bdice Dec 13, 2022
35c9e59
Remove VERSION_SUFFIX.
bdice Dec 13, 2022
355fa62
Remove VERSION_SUFFIX.
bdice Dec 13, 2022
31a3056
Use conda_build_config.yaml to define cusparse version.
bdice Dec 13, 2022
85e98aa
Merge branch 'gha' of github.com:bdice/cuspatial into gha
bdice Dec 13, 2022
c2003e2
Set lower bound to oldest libcusparse-dev version.
bdice Dec 13, 2022
811d791
Merge branch 'branch-23.02' into gha
ajschmidt8 Dec 20, 2022
65fd55d
Update conda/recipes/cuspatial/meta.yaml
ajschmidt8 Dec 20, 2022
7ff047c
Use --channel.
bdice Dec 20, 2022
56724df
Standardize meta.yaml pinnings.
bdice Dec 20, 2022
45326c9
alphabetize recipe lists
ajschmidt8 Dec 26, 2022
5e19a2f
update `libcusparse` version specifiers
ajschmidt8 Dec 26, 2022
5b887a3
re-order deps for install command
ajschmidt8 Dec 27, 2022
6562076
pin `orc` spec to fix Jenkins builds
ajschmidt8 Dec 27, 2022
c6f72a7
use `--freeze-installed` to fix Jenkins builds
ajschmidt8 Dec 27, 2022
a629048
Move gmock, gtest dependencies to correct location.
bdice Dec 27, 2022
b0fac19
Revert changes to CMakeLists.txt, get_gtest.cmake.
bdice Dec 27, 2022
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
6 changes: 3 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
Python:
- 'python/**'
- 'notebooks/**'

libcuspatial:
- 'cpp/**'

CMake:
- '**/CMakeLists.txt'
- '**/cmake/**'

gpuCI:
ci:
- 'ci/**'

conda:
- 'conda/**'

Java:
- 'java/**'
57 changes: 57 additions & 0 deletions .github/workflows/build.yaml
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/cuspatial
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/cuspatial
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/cuspatial
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
36 changes: 33 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
name: pr

on:
pull_request:
push:
branches:
- "pull-request/[0-9]+"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pr-builder:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@main
bdice marked this conversation as resolved.
Show resolved Hide resolved
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-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:
enable_check_size: false
enable_check_style: false
build_type: pull-request
34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
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/cuspatial
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/cuspatial
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
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/libcuspatial

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/cuspatial

rapids-upload-conda-to-s3 python
25 changes: 25 additions & 0 deletions ci/check_style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/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

set +e

bdice marked this conversation as resolved.
Show resolved Hide resolved
FORMAT_FILE_URL=https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.02/cmake-format-rapids-cmake.json
export RAPIDS_CMAKE_FORMAT_FILE=/tmp/rapids_cmake_ci/cmake-formats-rapids-cmake.json
mkdir -p $(dirname ${RAPIDS_CMAKE_FORMAT_FILE})
wget -O ${RAPIDS_CMAKE_FORMAT_FILE} ${FORMAT_FILE_URL}

# Run pre-commit checks
pre-commit run --hook-stage manual --all-files --show-diff-on-failure
9 changes: 7 additions & 2 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export CUDA_REL=${CUDA_VERSION%.*}
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}"

# Use Ninja to build, setup conda build dir
export CMAKE_GENERATOR="Ninja"
export CONDA_BLD_DIR="${WORKSPACE}/.conda-bld"
Expand Down Expand Up @@ -102,5 +106,6 @@ fi
# UPLOAD - Conda packages
################################################################################

gpuci_logger "Upload conda pkgs..."
source ci/cpu/upload.sh
# Uploads disabled due to new GH Actions implementation
# gpuci_logger "Upload conda pkgs..."
# source ci/cpu/upload.sh
57 changes: 57 additions & 0 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/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

# CUSPATIAL_HOME is used to find test files
export CUSPATIAL_HOME="${PWD}"

rapids-print-env

rapids-mamba-retry install \
-c "${CPP_CHANNEL}" \
libcuspatial libcuspatial-tests

rapids-logger "Check GPU usage"
nvidia-smi

set +e

# Run libcuspatial gtests from libcuspatial-tests package
rapids-logger "Run gtests"

# TODO: exit code handling is too verbose. Find a cleaner solution.

for gt in "$CONDA_PREFIX"/bin/gtests/libcuspatial/* ; 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}
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.

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

# CUSPATIAL_HOME is used to find test files
export CUSPATIAL_HOME="${PWD}"

rapids-print-env

rapids-mamba-retry install \
-c "${CPP_CHANNEL}" \
-c "${PYTHON_CHANNEL}" \
cuspatial libcuspatial

rapids-logger "Check GPU usage"
nvidia-smi

set +e

rapids-logger "pytest cuspatial"
pushd python/cuspatial/cuspatial
# It is essential to cd into python/cuspatial/cuspatial as `pytest-xdist` + `coverage` seem to work only at this directory level.
pytest \
--cache-clear \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuspatial.xml" \
--numprocesses=8 \
--dist=loadscope \
--cov-config=../.coveragerc \
--cov=cuspatial \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuspatial-coverage.xml" \
--cov-report=term \
tests
exitcode=$?

if (( ${exitcode} != 0 )); then
SUITEERROR=${exitcode}
echo "FAILED: 1 or more tests in cuspatial"
fi
popd

exit ${SUITEERROR}
3 changes: 3 additions & 0 deletions conda/environments/all_cuda-115_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ dependencies:
- gmock=1.10.0
- gtest=1.10.0
- libcudf=22.12.*
- libcusparse-dev=11.7.0.107
- libcusparse=11.7.0.107
- librmm=22.12.*
- myst-parser
- ninja
Expand All @@ -26,6 +28,7 @@ dependencies:
- pydata-sphinx-theme
- pytest
- pytest-cov
- pytest-xdist
- python>=3.8,<3.10
- rmm=22.12.*
- scikit-build>=0.13.1
Expand Down
Loading