Skip to content

Commit

Permalink
Merge pull request #41 from robertmaynard/fea/add_basic_ci
Browse files Browse the repository at this point in the history
Add initial CI that generates docs and runs rapids-cmake tests
  • Loading branch information
robertmaynard authored Jul 9, 2021
2 parents 8a3da35 + e3c01e4 commit 24e6c38
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ci/checks/style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# Copyright (c) 2021, NVIDIA CORPORATION.
#############################
# rapids-cmake Style Tester #
#############################
56 changes: 56 additions & 0 deletions ci/docs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
# Copyright (c) 2021, NVIDIA CORPORATION.
#########################################
# rapids-cmake Docs build script for CI #
#########################################

if [ -z "$PROJECT_WORKSPACE" ]; then
echo ">>>> ERROR: Could not detect PROJECT_WORKSPACE in environment"
echo ">>>> WARNING: This script contains git commands meant for automated building, do not run locally"
exit 1
fi

export DOCS_WORKSPACE=$WORKSPACE/docs
export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
export HOME=$WORKSPACE
export PROJECT_WORKSPACE=/rapids/rapids-cmake
export LIBCUDF_KERNEL_CACHE_PATH="$HOME/.jitify-cache"
export NIGHTLY_VERSION=$(echo $BRANCH_VERSION | awk -F. '{print $2}')
export PROJECTS=(rapids-cmake)

gpuci_logger "Check environment"
env

gpuci_logger "Check GPU usage"
nvidia-smi

gpuci_logger "Activate conda env"
. /opt/conda/etc/profile.d/conda.sh
conda activate rapids

gpuci_logger "Check versions"
python --version
$CC --version
$CXX --version

gpuci_logger "Check conda environment"
conda info
conda config --show-sources
conda list --show-channel-urls

# Build Doxygen docs
gpuci_logger "Build Sphinx docs"
cd $PROJECT_WORKSPACE/docs
make html

#Commit to Website
cd $DOCS_WORKSPACE

for PROJECT in ${PROJECTS[@]}; do
if [ ! -d "api/$PROJECT/$BRANCH_VERSION" ]; then
mkdir -p api/$PROJECT/$BRANCH_VERSION
fi
rm -rf $DOCS_WORKSPACE/api/$PROJECT/$BRANCH_VERSION/*
done

mv $PROJECT_WORKSPACE/docs/_build/html/* $DOCS_WORKSPACE/api/rapids-cmake/$BRANCH_VERSION
83 changes: 83 additions & 0 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/bin/bash
# Copyright (c) 2021, NVIDIA CORPORATION.
#################################################
# rapids-cmake GPU build and test script for CI #
#################################################

set -e
NUMARGS=$#
ARGS=$*

# Arg parsing function
function hasArg {
(( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
}

# Set path and build parallel level
export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4}
export CUDA_REL=${CUDA_VERSION%.*}

# Set home to the job's workspace
export HOME="$WORKSPACE"

# Parse git describei
cd "$WORKSPACE"
# export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
# export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count`
# export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`

export MINOR_VERSION=21.08 # hard-coded as rapids-cmake doesn't have tags yet

################################################################################
# SETUP - Check environment
################################################################################

gpuci_logger "Check environment"
env

gpuci_logger "Check GPU usage"
nvidia-smi

gpuci_logger "Activate conda env"
. /opt/conda/etc/profile.d/conda.sh
conda activate rapids

gpuci_logger "Installing packages needed for rapids-cmake"
gpuci_conda_retry install -y \
"cudatoolkit=$CUDA_REL" \
"rapids-build-env=$MINOR_VERSION.*"

gpuci_logger "Check compiler versions"
python --version
$CC --version
$CXX --version

gpuci_logger "Check conda environment"
conda info
conda config --show-sources
conda list --show-channel-urls

################################################################################
# BUILD - Build rapids-cmake tests
################################################################################

gpuci_logger "Setup rapids-cmake"
cmake -S "$WORKSPACE/testing/" -B "$WORKSPACE/build"


################################################################################
# TEST - Run Tests for rapids-cmake
################################################################################

if hasArg --skip-tests; then
gpuci_logger "Skipping Tests"
exit 0
fi

gpuci_logger "Check GPU usage"
nvidia-smi

gpuci_logger "Tests for rapids-cmake"
cd "$WORKSPACE/build"
ctest -j4 -VV

0 comments on commit 24e6c38

Please sign in to comment.