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

[skip gpuci] Add GitHub Actions workflows #1104

Merged
merged 6 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .github/workflows/branch-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: branch

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

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

jobs:
cpp-build:
name: C++ build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-matrix-build.yaml@main
with:
build_type: branch
python-build:
name: Python build
needs: cpp-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-matrix-build.yaml@main
with:
build_type: branch
upload-conda:
name: Upload conda packages for branch builds
needs: python-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@main
with:
build_type: branch
8 changes: 0 additions & 8 deletions .github/workflows/dependency-files.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/nightly-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: nightly

on:
workflow_call:
inputs:
REF:
required: true
type: string

jobs:
cpp-build:
name: C++ build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-matrix-build.yaml@main
with:
build_type: nightly
repo: rapidsai/rmm
ref: ${{ inputs.REF }}
cpp-tests:
name: C++ tests for PRs
needs: cpp-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@main
with:
build_type: nightly
repo: rapidsai/rmm
ref: ${{ inputs.REF }}
python-build:
name: Python build
needs: cpp-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-matrix-build.yaml@main
with:
build_type: nightly
repo: rapidsai/rmm
ref: ${{ inputs.REF }}
python-tests:
name: Python tests for PRs
needs: python-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@main
with:
build_type: nightly
repo: rapidsai/rmm
ref: ${{ inputs.REF }}
upload-conda:
name: Upload conda packages for branch builds
needs: [python-tests, cpp-tests]
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@main
with:
build_type: nightly
repo: rapidsai/rmm
ref: ${{ inputs.REF }}
41 changes: 41 additions & 0 deletions .github/workflows/pr-workflow.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:
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:
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:
build_type: pull-request
13 changes: 13 additions & 0 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -euo pipefail

source rapids-env-update

rapids-print-env

rapids-logger "Begin cpp build"

rapids-mamba-retry mambabuild conda/recipes/librmm

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

set -euo pipefail

source rapids-env-update

rapids-print-env

rapids-logger "Begin py build"

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

rapids-mamba-retry mambabuild -c "${CPP_CHANNEL}" conda/recipes/rmm

rapids-upload-conda-to-s3 python
139 changes: 139 additions & 0 deletions ci/check_style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#!/bin/bash
# Copyright (c) 2020, NVIDIA CORPORATION.

set -euo pipefail

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

rapids-dependency-file-generator \
--generate conda \
--file_key checks \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" > env.yaml

rapids-mamba-retry env create --force -f env.yaml -n checks
conda activate checks

set +e

# Run isort and get results/return code
ISORT=$(isort --check-only python --settings-path=python/setup.cfg)
ISORT_RETVAL=$?

# Run black and get results/return code
BLACK=$(black --config python/pyproject.toml --check python)
BLACK_RETVAL=$?

# Run flake8 and get results/return code
FLAKE=$(flake8 --config=python/.flake8 python)
FLAKE_RETVAL=$?

# Run flake8-cython and get results/return code
FLAKE_CYTHON=$(flake8 --config=python/.flake8.cython)
FLAKE_CYTHON_RETVAL=$?

# Run clang-format and check for a consistent code format
CLANG_FORMAT=$(python scripts/run-clang-format.py 2>&1)
CLANG_FORMAT_RETVAL=$?

# Run cmake-format / cmake-lint and get results/return code
CMAKE_FILES=($(find . | grep -E "^.*\.cmake(\.in)?$|^.*/CMakeLists.txt$"))

CMAKE_FORMATS=()
CMAKE_FORMAT_RETVAL=0

CMAKE_LINTS=()
CMAKE_LINT_RETVAL=0

CURRENT_TAG=$(git tag --merged HEAD | grep -xE '^v.*' | 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_SHORT_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}"
rapids-retry curl -s "https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${CURRENT_SHORT_TAG}/cmake-format-rapids-cmake.json" -o cmake/rapids-cmake.json

for cmake_file in "${CMAKE_FILES[@]}"; do
cmake-format --in-place --config-files cmake/config.json cmake/rapids-cmake.json -- "${cmake_file}"
TMP_CMAKE_FORMAT=$(git diff --color --exit-code -- "${cmake_file}")
TMP_CMAKE_FORMAT_RETVAL=$?
if [ "$TMP_CMAKE_FORMAT_RETVAL" != "0" ]; then
CMAKE_FORMAT_RETVAL=1
CMAKE_FORMATS+=("$TMP_CMAKE_FORMAT")
fi

TMP_CMAKE_LINT=$(cmake-lint --config-files cmake/config.json cmake/rapids-cmake.json -- "${cmake_file}")
TMP_CMAKE_LINT_RETVAL=$?
if [ "$TMP_CMAKE_LINT_RETVAL" != "0" ]; then
CMAKE_LINT_RETVAL=1
CMAKE_LINTS+=("$TMP_CMAKE_LINT")
fi
done


# Output results if failure otherwise show pass
if [ "$ISORT_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: isort style check; begin output\n\n"
echo -e "$ISORT"
echo -e "\n\n>>>> FAILED: isort style check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: isort style check\n\n"
fi

if [ "$BLACK_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: black style check; begin output\n\n"
echo -e "$BLACK"
echo -e "\n\n>>>> FAILED: black style check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: black style check\n\n"
fi

if [ "$FLAKE_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: flake8 style check; begin output\n\n"
echo -e "$FLAKE"
echo -e "\n\n>>>> FAILED: flake8 style check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: flake8 style check\n\n"
fi

if [ "$FLAKE_CYTHON_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: flake8-cython style check; begin output\n\n"
echo -e "$FLAKE_CYTHON"
echo -e "\n\n>>>> FAILED: flake8-cython style check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: flake8-cython style check\n\n"
fi

if [ "$CLANG_FORMAT_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: clang format check; begin output\n\n"
echo -e "$CLANG_FORMAT"
echo -e "\n\n>>>> FAILED: clang format check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: clang format check\n\n"
fi

if [ "$CMAKE_FORMAT_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: cmake format check; begin output\n\n"
for CMAKE_FORMAT in "${CMAKE_FORMATS[@]}"; do
echo -e "$CMAKE_FORMAT"
echo -e "\n"
done
echo -e "\n\n>>>> FAILED: cmake format check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: cmake format check\n\n"
fi

if [ "$CMAKE_LINT_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: cmake lint check; begin output\n\n"
for CMAKE_LINT in "${CMAKE_LINTS[@]}"; do
echo -e "$CMAKE_LINT"
echo -e "\n"
done
echo -e "\n\n>>>> FAILED: cmake lint check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: cmake lint check\n\n"
fi

RETVALS=($ISORT_RETVAL $BLACK_RETVAL $FLAKE_RETVAL $FLAKE_CYTHON_RETVAL $CLANG_FORMAT_RETVAL $CMAKE_FORMAT_RETVAL $CMAKE_LINT_RETVAL)
IFS=$'\n'
RETVAL=$(echo "${RETVALS[*]}" | sort -nr | head -n1)

exit "${RETVAL}"
5 changes: 2 additions & 3 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@ fi
# UPLOAD - Conda packages
################################################################################

gpuci_logger "Upload conda packages"
source ci/cpu/upload.sh

# gpuci_logger "Upload conda packages"
# source ci/cpu/upload.sh
35 changes: 35 additions & 0 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

set -euo pipefail

. /opt/conda/etc/profile.d/conda.sh
conda activate base

rapids-print-env

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

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

TESTRESULTS_DIR=test-results
mkdir -p ${TESTRESULTS_DIR}
SUITEERROR=0

rapids-logger "Check GPU usage"
nvidia-smi

set +e

rapids-logger "Running googletests"
for gt in "$CONDA_PREFIX/bin/gtests/librmm/"* ; do
${gt} --gtest_output=xml:${TESTRESULTS_DIR}/
exitcode=$?
if (( ${exitcode} != 0 )); then
SUITEERROR=${exitcode}
echo "FAILED: GTest ${gt}"
fi
done

exit ${SUITEERROR}
Loading