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 environment-agnostic scripts for running ctests and pytests #14992

Merged
merged 31 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7d1e40b
Add environment-agnostic scripts for running ctests and pytests
trxcllnt Feb 7, 2024
a482dd7
fix typo
trxcllnt Feb 7, 2024
bab9e7a
remove dangling popd
trxcllnt Feb 7, 2024
926b7ed
fail if gtests aren't installed
trxcllnt Feb 7, 2024
8cfc804
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 7, 2024
2a40e72
Merge branch 'branch-24.04' of github.com:rapidsai/cudf into fea/gene…
trxcllnt Feb 7, 2024
5f30888
Merge branch 'fea/generic-test-scripts' of github.com:trxcllnt/cudf i…
trxcllnt Feb 7, 2024
d9ce215
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 8, 2024
39098dd
Merge branch 'branch-24.04' of github.com:rapidsai/cudf into fea/gene…
trxcllnt Feb 9, 2024
db6ca21
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 9, 2024
91139e3
Merge branch 'fea/generic-test-scripts' of github.com:trxcllnt/cudf i…
trxcllnt Feb 9, 2024
2997dca
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 9, 2024
2142edd
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 10, 2024
6a7a49e
update devcontainers to CUDA 12.2
trxcllnt Feb 11, 2024
2201ade
support CUDA 12.0 in the matrix until all RAPIDS repos are on CUDA 12.2
trxcllnt Feb 11, 2024
df92c5c
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 12, 2024
b99149f
revert 2201ade439a7864bc54ef74225ce8f9f3e85afb6
trxcllnt Feb 12, 2024
25b7d78
Merge branch 'branch-24.04' of github.com:rapidsai/cudf into fea/gene…
trxcllnt Feb 16, 2024
049189e
Merge branch 'branch-24.04' of github.com:rapidsai/cudf into fea/gene…
trxcllnt Feb 16, 2024
6ba90da
Merge branch 'branch-24.04' of github.com:rapidsai/cudf into fea/gene…
trxcllnt Feb 20, 2024
81760f4
Merge branch 'branch-24.04' of github.com:rapidsai/cudf into fea/gene…
trxcllnt Feb 20, 2024
ccd3ba7
revert update devcontainers to CUDA 12.2
trxcllnt Feb 21, 2024
017a551
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 21, 2024
4ba9499
Merge branch 'branch-24.04' of github.com:rapidsai/cudf into fea/gene…
trxcllnt Feb 21, 2024
02007b7
Merge branch 'branch-24.04' of github.com:rapidsai/cudf into fea/gene…
trxcllnt Feb 21, 2024
1b7e5b2
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 21, 2024
94fc0ab
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 22, 2024
745bfd7
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 22, 2024
eee508a
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 23, 2024
fd0d436
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 23, 2024
46084a4
Merge branch 'branch-24.04' into fea/generic-test-scripts
trxcllnt Feb 24, 2024
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
14 changes: 14 additions & 0 deletions ci/run_cudf_benchmark_smoketests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

# Ensure that benchmarks are runnable
if [ -d "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/benchmarks/libcudf/" ]; then
# Support customizing the ctests' install location
cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/benchmarks/libcudf/";
# Run a small Google benchmark
./MERGE_BENCH --benchmark_filter=/2/
# Run a small nvbench benchmark
./STRINGS_NVBENCH --run-once --benchmark 0 --devices 0
fi
20 changes: 20 additions & 0 deletions ci/run_cudf_ctests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

if [ -d "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf/" ]; then
trxcllnt marked this conversation as resolved.
Show resolved Hide resolved
# Support customizing the ctests' install location
cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf/";
ctest --output-on-failure "$@"
fi

# Ensure that benchmarks are runnable
if [ -d "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/benchmarks/libcudf/" ]; then
# Support customizing the ctests' install location
cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/benchmarks/libcudf/";
# Run a small Google benchmark
./MERGE_BENCH --benchmark_filter=/2/
# Run a small nvbench benchmark
./STRINGS_NVBENCH --run-once --benchmark 0 --devices 0
fi
10 changes: 10 additions & 0 deletions ci/run_cudf_kafka_ctests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

if [ -d "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf_kafka/" ]; then
# Support customizing the ctests' install location
cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf_kafka/";
ctest --output-on-failure "$@"
fi
25 changes: 25 additions & 0 deletions ci/run_cudf_memcheck_ctests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -uo pipefail

EXITCODE=0
trap "EXITCODE=1" ERR

if [ -d "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf/" ]; then
# Support customizing the ctests' install location
cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcudf/";
export GTEST_CUDF_RMM_MODE=cuda
for gt in ./*_TEST ; do
test_name=$(basename ${gt})
# Run gtests with compute-sanitizer
if [[ "$test_name" == "ERROR_TEST" ]] || [[ "$test_name" == "STREAM_IDENTIFICATION_TEST" ]]; then
continue
fi
echo "Running compute-sanitizer on $test_name"
compute-sanitizer --tool memcheck ${gt} "$@"
done
unset GTEST_CUDF_RMM_MODE
fi

exit ${EXITCODE}
13 changes: 13 additions & 0 deletions ci/run_cudf_pandas_pytest_benchmarks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

# It is essential to cd into python/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_cudf_pandas_pytest_benchmarks.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cudf/

CUDF_BENCHMARKS_USE_PANDAS=ON \
CUDF_BENCHMARKS_DEBUG_ONLY=ON \
pytest --cache-clear "$@" benchmarks
12 changes: 12 additions & 0 deletions ci/run_cudf_pytest_benchmarks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

# It is essential to cd into python/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_cudf_pytest_benchmarks.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cudf/

CUDF_BENCHMARKS_DEBUG_ONLY=ON \
pytest --cache-clear "$@" benchmarks
11 changes: 11 additions & 0 deletions ci/run_cudf_pytests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_cudf_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cudf/cudf/

pytest --cache-clear --ignore="benchmarks" "$@" tests
11 changes: 11 additions & 0 deletions ci/run_custreamz_pytests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_custreamz_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/custreamz/custreamz/

pytest --cache-clear "$@" tests
11 changes: 11 additions & 0 deletions ci/run_dask_cudf_pytests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_dask_cudf_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/dask_cudf/dask_cudf/

pytest --cache-clear "$@" .
26 changes: 8 additions & 18 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

source "$(dirname "$0")/test_cpp_common.sh"
# Support invoking test_cpp.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

source ./ci/test_cpp_common.sh

EXITCODE=0
trap "EXITCODE=1" ERR
Expand All @@ -10,36 +13,23 @@ set +e
# Run libcudf and libcudf_kafka gtests from libcudf-tests package
export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/

pushd $CONDA_PREFIX/bin/gtests/libcudf/
rapids-logger "Run libcudf gtests"
ctest -j20 --output-on-failure
./ci/run_cudf_ctests.sh -j20
SUITEERROR=$?
popd

if (( ${SUITEERROR} == 0 )); then
pushd $CONDA_PREFIX/bin/gtests/libcudf_kafka/
rapids-logger "Run libcudf_kafka gtests"
ctest -j20 --output-on-failure
./ci/run_cudf_kafka_ctests.sh -j20
SUITEERROR=$?
popd
fi

# Ensure that benchmarks are runnable
pushd $CONDA_PREFIX/bin/benchmarks/libcudf/
rapids-logger "Run tests of libcudf benchmarks"

if (( ${SUITEERROR} == 0 )); then
# Run a small Google benchmark
./MERGE_BENCH --benchmark_filter=/2/
SUITEERROR=$?
fi

if (( ${SUITEERROR} == 0 )); then
# Run a small nvbench benchmark
./STRINGS_NVBENCH --run-once --benchmark 0 --devices 0
./ci/run_cudf_benchmark_smoketests.sh
SUITEERROR=$?
fi
popd

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
25 changes: 8 additions & 17 deletions ci/test_cpp_memcheck.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

source "$(dirname "$0")/test_cpp_common.sh"
# Support invoking test_cpp.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

EXITCODE=0
trap "EXITCODE=1" ERR
set +e
source ./ci/test_cpp_common.sh

# Run gtests with compute-sanitizer
rapids-logger "Memcheck gtests with rmm_mode=cuda"
export GTEST_CUDF_RMM_MODE=cuda
COMPUTE_SANITIZER_CMD="compute-sanitizer --tool memcheck"
for gt in "$CONDA_PREFIX"/bin/gtests/libcudf/*_TEST ; do
test_name=$(basename ${gt})
if [[ "$test_name" == "ERROR_TEST" ]] || [[ "$test_name" == "STREAM_IDENTIFICATION_TEST" ]]; then
continue
fi
echo "Running compute-sanitizer on $test_name"
${COMPUTE_SANITIZER_CMD} ${gt} --gtest_output=xml:"${RAPIDS_TESTS_DIR}${test_name}.xml"
done
unset GTEST_CUDF_RMM_MODE

./ci/run_cudf_memcheck_ctests.sh \
--gtest_output=xml:"${RAPIDS_TESTS_DIR}${test_name}.xml" \
&& EXITCODE=$? || EXITCODE=$?;

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
35 changes: 12 additions & 23 deletions ci/test_python_cudf.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

# Support invoking test_python_cudf.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../;

# Common setup steps shared by Python test jobs
source "$(dirname "$0")/test_python_common.sh"
source ./ci/test_python_common.sh

rapids-logger "Check GPU usage"
nvidia-smi
Expand All @@ -12,51 +15,37 @@ trap "EXITCODE=1" ERR
set +e

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

# Run benchmarks with both cudf and pandas to ensure compatibility is maintained.
# Benchmarks are run in DEBUG_ONLY mode, meaning that only small data sizes are used.
# Therefore, these runs only verify that benchmarks are valid.
# They do not generate meaningful performance measurements.
pushd python/cudf

rapids-logger "pytest for cudf benchmarks"
CUDF_BENCHMARKS_DEBUG_ONLY=ON \
pytest \
--cache-clear \
./ci/run_cudf_pytest_benchmarks.sh \
--numprocesses=8 \
--dist=loadscope \
--cov-config=.coveragerc \
--cov=cudf \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cudf-benchmark-coverage.xml" \
--cov-report=term \
benchmarks
--cov-report=term

rapids-logger "pytest for cudf benchmarks using pandas"
CUDF_BENCHMARKS_USE_PANDAS=ON \
CUDF_BENCHMARKS_DEBUG_ONLY=ON \
pytest \
--cache-clear \
./ci/run_cudf_pandas_pytest_benchmarks.sh \
--numprocesses=8 \
--dist=loadscope \
--cov-config=.coveragerc \
--cov=cudf \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cudf-benchmark-pandas-coverage.xml" \
--cov-report=term \
benchmarks
popd
--cov-report=term

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
23 changes: 9 additions & 14 deletions ci/test_python_other.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

# Support invoking test_python_cudf.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

# Common setup steps shared by Python test jobs
source "$(dirname "$0")/test_python_common.sh"
source ./ci/test_python_common.sh

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
Expand All @@ -17,32 +20,24 @@ trap "EXITCODE=1" ERR
set +e

rapids-logger "pytest dask_cudf"
pushd python/dask_cudf/dask_cudf
pytest \
--cache-clear \
./ci/run_dask_cudf_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-dask-cudf.xml" \
--numprocesses=8 \
--dist=loadscope \
--cov-config=../.coveragerc \
--cov=dask_cudf \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/dask-cudf-coverage.xml" \
--cov-report=term \
.
popd
--cov-report=term

rapids-logger "pytest custreamz"
pushd python/custreamz/custreamz
pytest \
--cache-clear \
./ci/run_custreamz_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-custreamz.xml" \
--numprocesses=8 \
--dist=loadscope \
--cov-config=../.coveragerc \
--cov=custreamz \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/custreamz-coverage.xml" \
--cov-report=term \
tests
popd
--cov-report=term

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
Loading