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 CI scripts to build conda packages and run tests #18

Merged
merged 27 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8455a09
Add CI scripts to build conda packages and run tests
pentschev Apr 3, 2023
d62f2c5
Add GitHub workflows
pentschev Apr 3, 2023
2e8a779
Update CODEOWNERS file
pentschev Apr 5, 2023
8146f9f
Add specification for rapids-dependency-file-generator
pentschev Apr 3, 2023
7b363bd
Specify RMM version as part of conda build config
pentschev Apr 4, 2023
fd56dd5
Add missing conda variables and sort them alphabetically
pentschev Apr 4, 2023
1b9ec5b
Close Python async tests event loop
pentschev Apr 6, 2023
6e1f877
Add `rerun_on_failure` implementation for Python async tests
pentschev Apr 6, 2023
edcbfa4
Only apply timeout to async tests functions
pentschev Apr 6, 2023
4e1aff5
Close endpoints after Python async tests
pentschev Apr 5, 2023
954f7b6
Mark some endpoint closing tests to xfail
pentschev Apr 5, 2023
bda7f2a
Mark endpoint error handler disabled test as xfail
pentschev Apr 6, 2023
f4621a2
update shared workflow branches to `filter-matrices`
ajschmidt8 Apr 7, 2023
a9bf496
remove `arm64` from build & test matrices
ajschmidt8 Apr 7, 2023
3c81de4
rm `arm64` conditional statements
ajschmidt8 Apr 7, 2023
d7d91aa
use `cpp` build workflow instead of `python`
ajschmidt8 Apr 7, 2023
f67d487
fix job names
ajschmidt8 Apr 7, 2023
d79cf46
trigger build w/ latest shared workflow changes
ajschmidt8 Apr 7, 2023
9f72aa4
Merge remote-tracking branch 'upstream/main' into ci-support
pentschev Apr 8, 2023
3804e33
revert: update shared workflow branches to `filter-matrices`
ajschmidt8 Apr 10, 2023
095c72c
mv `dfg` check to `pre-commit`
ajschmidt8 Apr 10, 2023
3707568
Update RAPIDS packages during CI release script
pentschev Apr 11, 2023
f09785c
Fix nightly test hook
pentschev Apr 11, 2023
9211128
Remove manual hook stage from CI check style script
pentschev Apr 11, 2023
50764f1
Fixes for dependencies file
pentschev Apr 11, 2023
3175683
Merge remote-tracking branch 'origin/ci-support' into ci-support
pentschev Apr 11, 2023
6d6ec71
Anchor NumPy in dependencies file
pentschev Apr 11, 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
21 changes: 21 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#cpp code owners
cpp/ @rapidsai/ucxx-cpp-codeowners

#python code owners
python/ @rapidsai/ucxx-python-codeowners

#cmake code owners
cpp/CMakeLists.txt @rapidsai/ucxx-cmake-codeowners
cpp/python/CMakeLists.txt @rapidsai/ucxx-cmake-codeowners
cpp/examples/CMakeLists.txt @rapidsai/ucxx-cmake-codeowners
cpp/benchmarks/CMakeLists.txt @rapidsai/ucxx-cmake-codeowners
cpp/tests/CMakeLists.txt @rapidsai/ucxx-cmake-codeowners
python/CMakeLists.txt @rapidsai/ucxx-cmake-codeowners
python/ucxx/_lib/CMakeLists.txt @rapidsai/ucxx-cmake-codeowners
fetch_rapids.cmake @rapidsai/ucxx-cmake-codeowners
**/cmake/ @rapidsai/ucxx-cmake-codeowners

#build/ops code owners
.github/ @rapidsai/ops-codeowners
ci/ @rapidsai/ops-codeowners
conda/ @rapidsai/ops-codeowners
46 changes: 46 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build

on:
push:
branches:
- "branch-*"
tags:
- v[0-9].[0-9][0-9].[0-9][0-9]
Copy link
Contributor

Choose a reason for hiding this comment

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

I am guessing the major component is fixed as one digit because this aims to follow ucx versioning? Like 0.30.0? But then is the patch version also one digit or is it two digits? Like 0.30.00? Not sure what regex syntax is allowed here but I think there are limitations.

Copy link
Member Author

Choose a reason for hiding this comment

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

We're doing here exactly what UCX-Py is doing, I believe this is right as it has been for a while.

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-cpp-build:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
matrix_filter: map(select(.ARCH != "arm64"))
upload-conda:
needs: [conda-cpp-build]
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
46 changes: 46 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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-tests
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
checks:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
enable_check_generated_files: false
conda-cpp-build:
needs: checks
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
matrix_filter: map(select(.ARCH != "arm64"))
conda-cpp-tests:
needs: conda-cpp-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
matrix_filter: map(select(.ARCH != "arm64"))
conda-python-tests:
needs: conda-cpp-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
matrix_filter: map(select(.ARCH != "arm64"))
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_dispatch:
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/[email protected]
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems wrong.

Suggested change
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-[email protected]
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests[email protected]

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
matrix_filter: map(select(.ARCH != "arm64"))
conda-python-tests:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
matrix_filter: map(select(.ARCH != "arm64"))
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend updating the hook versions in this file with pre-commit autoupdate. Since it's a new package, that should be a better place to start. I am going to be updating hook versions in other RAPIDS repos in the next month or so.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't mind if we do it in a follow-up PR, but I'd rather have something functional first and iterate on improvements later.

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ repos:
# language: system
files: \.(h|cpp)$
# exclude: path/to/myfile.h
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.5.1
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]



Expand Down
19 changes: 19 additions & 0 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES.
# SPDX-License-Identifier: BSD-3-Clause

set -euo pipefail

source rapids-env-update

export CMAKE_GENERATOR=Ninja

rapids-print-env

rapids-logger "Begin C++ and Python builds"

rapids-mamba-retry mambabuild \
conda/recipes/ucxx

rapids-upload-conda-to-s3 cpp
20 changes: 20 additions & 0 deletions ci/check_style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES.
# SPDX-License-Identifier: BSD-3-Clause

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pre-commit run --hook-stage manual --all-files --show-diff-on-failure
pre-commit run --all-files --show-diff-on-failure

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

41 changes: 41 additions & 0 deletions ci/release/update-version.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

This file also needs to update rmm_version in conda/recipes/ucxx/conda_build_config.yaml.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
########################
# ucxx Version Updater #
########################

## Usage
# bash update-version.sh <new_version>


# Format is Major.Minor.Patch - no leading 'v' or trailing 'a'
# Example: 0.30.00
NEXT_FULL_TAG=$1

# Get current version
CURRENT_TAG=$(git tag | grep -xE 'v[0-9\.]+' | sort --version-sort | tail -n 1 | tr -d 'v')
CURRENT_MAJOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[1]}')
CURRENT_MINOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[2]}')
CURRENT_PATCH=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[3]}')
CURRENT_SHORT_TAG=${CURRENT_MAJOR}.${CURRENT_MINOR}

#Get <major>.<minor> for next version
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}

# Get RAPIDS version associated w/ ucx-py version
NEXT_RAPIDS_VERSION="$(curl -sL https://version.gpuci.io/ucx-py/${NEXT_SHORT_TAG})"


echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"

# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
}

sed_runner "s/cudf=.*/cudf=${NEXT_RAPIDS_VERSION}/g" dependencies.yaml

for FILE in .github/workflows/*.yaml; do
sed_runner "/shared-action-workflows/ s/@.*/@branch-${NEXT_RAPIDS_VERSION}/g" "${FILE}"
done
84 changes: 84 additions & 0 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES.
# SPDX-License-Identifier: BSD-3-Clause

set -euo pipefail

source "$(dirname "$0")/test_utils.sh"

rapids-logger "Create test conda environment"
. /opt/conda/etc/profile.d/conda.sh

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
conda activate test

rapids-print-env

print_system_stats

BINARY_PATH=${CONDA_PREFIX}/bin

run_tests() {
CMD_LINE="UCX_TCP_CM_REUSEADDR=y timeout 10m ${BINARY_PATH}/gtests/libucxx/UCXX_TEST --gtest_filter=-*DelayedSubmission*ProgressTagMulti*:ListenerTest.CloseCallback:ListenerTest.IsAlive:ListenerTest.RaiseOnError"

rapids-logger "Running: \n - ${CMD_LINE}"

UCX_TCP_CM_REUSEADDR=y timeout 10m ${BINARY_PATH}/gtests/libucxx/UCXX_TEST --gtest_filter=-*DelayedSubmission*ProgressTagMulti*:ListenerTest.CloseCallback:ListenerTest.IsAlive:ListenerTest.RaiseOnError
}

run_benchmark() {
PROGRESS_MODE=$1

# UCX_TCP_CM_REUSEADDR=y to be able to bind immediately to the same port before
# `TIME_WAIT` timeout
CMD_LINE_SERVER="UCX_TCP_CM_REUSEADDR=y timeout 1m ${BINARY_PATH}/benchmarks/libucxx/ucxx_perftest -s 8388608 -r -n 20 -m ${PROGRESS_MODE}"
CMD_LINE_CLIENT="timeout 10m ${BINARY_PATH}/benchmarks/libucxx/ucxx_perftest -s 8388608 -r -n 20 -m ${PROGRESS_MODE} 127.0.0.1"

rapids-logger "Running: \n - ${CMD_LINE_SERVER}\n - ${CMD_LINE_CLIENT}"
UCX_TCP_CM_REUSEADDR=y timeout 1m ${BINARY_PATH}/benchmarks/libucxx/ucxx_perftest -s 8388608 -r -n 20 -m ${PROGRESS_MODE} &
sleep 1
timeout 1m ${BINARY_PATH}/benchmarks/libucxx/ucxx_perftest -s 8388608 -r -n 20 -m ${PROGRESS_MODE} 127.0.0.1
}

run_example() {
PROGRESS_MODE=$1

# UCX_TCP_CM_REUSEADDR=y to be able to bind immediately to the same port before
# `TIME_WAIT` timeout
CMD_LINE="UCX_TCP_CM_REUSEADDR=y timeout 1m ${BINARY_PATH}/examples/libucxx/ucxx_example_basic -m ${PROGRESS_MODE}"

rapids-logger "Running: \n - ${CMD_LINE}"
UCX_TCP_CM_REUSEADDR=y timeout 1m ${BINARY_PATH}/examples/libucxx/ucxx_example_basic -m ${PROGRESS_MODE}
}

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
libucxx libucxx-examples libucxx-tests

print_ucx_config

rapids-logger "Run tests with conda package"
run_tests

# run_cpp_benchmark PROGRESS_MODE
run_benchmark polling
run_benchmark blocking
run_benchmark thread-polling
run_benchmark thread-blocking
run_benchmark wait

# run_cpp_example PROGRESS_MODE
run_example polling
run_example blocking
run_example thread-polling
run_example thread-blocking
run_example wait
Loading