From 2b62e378139d0d2e4cda86d57c2f8a5416dfd535 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Wed, 12 Feb 2025 10:36:01 -0800 Subject: [PATCH 1/2] Add some downstream tests https://github.com/rapidsai/rapids-dask-dependency/pull/85 changes the dask dependency to use released versions of Dask. To catch prominant breakage in downstream libraries (like dask-cudf) with dask main, we'll add some novel tests here that run downstream (cudf) nightly against upstream (dask) `main`. --- README.md | 2 ++ downstream/test_downstream.py | 14 ++++++++++++++ scripts/run.sh | 1 + scripts/test.sh | 9 ++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 downstream/test_downstream.py diff --git a/README.md b/README.md index c635c6e..4d70a2f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This repository contains the scripts to run Dask's `gpu`-marked tests on a schedule. +In addition, we run some light downstream tests, as an early warning check for breaking in downstream packages like cuDF, dask-cuDF, and cuML. + ## Version Policy The primary goal here is to quickly identify breakages in tests defined in `dask/dask` and `dask/distributed`, so we'll use the latest `main` from each of those. diff --git a/downstream/test_downstream.py b/downstream/test_downstream.py new file mode 100644 index 0000000..46d4cb5 --- /dev/null +++ b/downstream/test_downstream.py @@ -0,0 +1,14 @@ +def test_import_cudf(): + import cudf # noqa: F401 + + +def test_import_dask_cudf(): + import dask_cudf # noqa: F401 + + +def test_import_cuml(): + import cuml # noqa: F401 + + +def test_dask_cuda(): + import dask_cuda # noqa: F401 \ No newline at end of file diff --git a/scripts/run.sh b/scripts/run.sh index 882493d..5cab3ed 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -19,6 +19,7 @@ pip install --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/ "cudf-${RAPIDS_PY_CUDA_SUFFIX}" \ "dask-cudf-${RAPIDS_PY_CUDA_SUFFIX}" \ "ucx-py-${RAPIDS_PY_CUDA_SUFFIX}" \ + "cuml-${RAPIDS_PY_CUDA_SUFFIX}" \ "scipy" \ "dask-cuda" diff --git a/scripts/test.sh b/scripts/test.sh index 7258856..0d3494d 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -13,7 +13,14 @@ pytest distributed -v -m gpu --runslow distributed_status=$? popd -if [ $dask_status -ne 0 ] || [ $distributed_status -ne 0 ]; then +echo "[testing downstream]" + +pushd downstream +pytest -v . +downstream_status=$? +popd + +if [ $dask_status -ne 0 ] || [ $distributed_status -ne 0 ] || [ $downstream_status -ne 0 ] ; then echo "Tests faild" exit 1 fi From 64795830a56f348b269aee3b92920d0183cdcbdb Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Wed, 12 Feb 2025 10:40:19 -0800 Subject: [PATCH 2/2] Updated pre-commit hook --- .github/workflows/cron.yaml | 2 +- .github/workflows/pr.yaml | 25 +++++++++++++++++++++++++ .pre-commit-config.yaml | 15 +++++++++++++++ downstream/test_downstream.py | 2 +- scripts/test.sh | 12 ++++++------ 5 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/cron.yaml b/.github/workflows/cron.yaml index 2c09fed..f80508c 100644 --- a/.github/workflows/cron.yaml +++ b/.github/workflows/cron.yaml @@ -9,7 +9,7 @@ on: # currently set to 5:00 UTC and takes ~12 hours - cron: "15 18 * * *" workflow_dispatch: {} - + jobs: setup: runs-on: ubuntu-latest diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..3054634 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,25 @@ +name: pr + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + workflow_dispatch: # allows you to trigger manually + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check-style: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d261b54..8ecfe13 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,3 +16,18 @@ repos: ^cpp/cmake/thirdparty/patches/.*| ^python/cudf/cudf/tests/data/subword_tokenizer_data/.* ) + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.3 + hooks: + - id: ruff + args: ["--fix"] + - id: ruff-format + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck + args: ["--severity=warning"] + files: ^scripts/ + +default_language_version: + python: python3 diff --git a/downstream/test_downstream.py b/downstream/test_downstream.py index 46d4cb5..340b4b7 100644 --- a/downstream/test_downstream.py +++ b/downstream/test_downstream.py @@ -11,4 +11,4 @@ def test_import_cuml(): def test_dask_cuda(): - import dask_cuda # noqa: F401 \ No newline at end of file + import dask_cuda # noqa: F401 diff --git a/scripts/test.sh b/scripts/test.sh index 0d3494d..437fa22 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -2,23 +2,23 @@ # SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. echo "[testing dask]" -pushd dask +pushd dask || exit 1 pytest dask -v -m gpu dask_status=$? -popd +popd || exit 1 echo "[testing distributed]" -pushd distributed +pushd distributed || exit 1 pytest distributed -v -m gpu --runslow distributed_status=$? -popd +popd || exit 1 echo "[testing downstream]" -pushd downstream +pushd downstream || exit 1 pytest -v . downstream_status=$? -popd +popd || exit 1 if [ $dask_status -ne 0 ] || [ $distributed_status -ne 0 ] || [ $downstream_status -ne 0 ] ; then echo "Tests faild"