From 7e3182c661da36fd00148b72accd738cbf288b07 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 16 Oct 2024 11:01:01 -0500 Subject: [PATCH] introduce minimal CI for PRs (#56) Proposing breaking some changes off of #53, to reduce the size of that PR and get some CI running on PRs in this repo. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cugraph-gnn/pull/56 --- .github/copy-pr-bot.yaml | 1 - .github/ops-bot.yaml | 1 - .github/workflows/pr.yaml | 56 +++++++++++++++++ .gitignore | 3 - .pre-commit-config.yaml | 12 ++-- ci/build_python.sh | 45 +------------ .../all_cuda-124_arch-x86_64.yaml | 63 +++++++++++++++++++ dependencies.yaml | 10 ++- 8 files changed, 135 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/pr.yaml create mode 100644 conda/environments/all_cuda-124_arch-x86_64.yaml diff --git a/.github/copy-pr-bot.yaml b/.github/copy-pr-bot.yaml index 40f1812..895ba83 100644 --- a/.github/copy-pr-bot.yaml +++ b/.github/copy-pr-bot.yaml @@ -2,4 +2,3 @@ # https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/ enabled: true - diff --git a/.github/ops-bot.yaml b/.github/ops-bot.yaml index 34a604f..2ed5231 100644 --- a/.github/ops-bot.yaml +++ b/.github/ops-bot.yaml @@ -7,4 +7,3 @@ label_checker: true release_drafter: true recently_updated: true forward_merger: true - diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..d4ba895 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,56 @@ +name: pr + +on: + push: + branches: + - "pull-request/[0-9]+" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + pr-builder: + needs: + - changed-files + - checks + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 + if: always() + with: + needs: ${{ toJSON(needs) }} + changed-files: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 + with: + files_yaml: | + test_cpp: + - '**' + - '!.devcontainers/**' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!img/**' + - '!mg_utils/**' + - '!notebooks/**' + - '!python/**' + - '!readme_pages/**' + test_notebooks: + - '**' + - '!.devcontainers/**' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + test_python: + - '**' + - '!.devcontainers/**' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!img/**' + - '!notebooks/**' + checks: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 + with: + enable_check_generated_files: false diff --git a/.gitignore b/.gitignore index 2fea102..9480c26 100644 --- a/.gitignore +++ b/.gitignore @@ -78,9 +78,6 @@ datasets/* !datasets/karate-disjoint.csv !datasets/netscience.csv -# nx-cugraph side effects -python/nx-cugraph/objects.inv - .pydevproject # Jupyter Notebooks diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cdde470..96c110a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,13 +40,8 @@ repos: - id: clang-format types_or: [c, c++, cuda] args: ["-fallback-style=none", "-style=file", "-i"] - - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.13.11 - hooks: - - id: rapids-dependency-file-generator - args: ["--clean"] - repo: https://github.com/rapidsai/pre-commit-hooks - rev: v0.0.3 + rev: v0.4.0 hooks: - id: verify-copyright files: | @@ -57,3 +52,8 @@ repos: [.]flake8[.]cython$| meta[.]yaml$| setup[.]cfg$ + - repo: https://github.com/rapidsai/dependency-file-generator + rev: v1.15.1 + hooks: + - id: rapids-dependency-file-generator + args: ["--clean"] diff --git a/ci/build_python.sh b/ci/build_python.sh index 62154fd..9a02436 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -23,48 +23,10 @@ echo "${version}" > VERSION rapids-logger "Begin py build" package_dir="python" -for package_name in pylibcugraph cugraph cugraph-pyg cugraph-dgl; do +for package_name in cugraph-pyg cugraph-dgl; do underscore_package_name=$(echo "${package_name}" | tr "-" "_") sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/${underscore_package_name}/_version.py" done -sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/nx-cugraph/_nx_cugraph/_version.py" - -# TODO: Remove `--no-test` flags once importing on a CPU -# node works correctly -rapids-conda-retry mambabuild \ - --no-test \ - --channel "${CPP_CHANNEL}" \ - conda/recipes/pylibcugraph - -rapids-conda-retry mambabuild \ - --no-test \ - --channel "${CPP_CHANNEL}" \ - --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ - conda/recipes/cugraph - -# NOTE: nothing in nx-cugraph is CUDA-specific, but it is built on each CUDA -# platform to ensure it is included in each set of artifacts, since test -# scripts only install from one set of artifacts based on the CUDA version used -# for the test run. -rapids-conda-retry mambabuild \ - --no-test \ - --channel "${CPP_CHANNEL}" \ - --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ - conda/recipes/nx-cugraph - -# NOTE: nothing in the cugraph-service packages are CUDA-specific, but they are -# built on each CUDA platform to ensure they are included in each set of -# artifacts, since test scripts only install from one set of artifacts based on -# the CUDA version used for the test run. -version_file_cugraph_service_client="python/cugraph-service/client/cugraph_service_client/_version.py" -sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_cugraph_service_client} -version_file_cugraph_service_server="python/cugraph-service/server/cugraph_service_server/_version.py" -sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_cugraph_service_server} -rapids-conda-retry mambabuild \ - --no-test \ - --channel "${CPP_CHANNEL}" \ - --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ - conda/recipes/cugraph-service RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}" @@ -90,9 +52,4 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then conda/recipes/cugraph-dgl fi -rapids-conda-retry mambabuild \ - --no-test \ - --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ - conda/recipes/cugraph-equivariant - rapids-upload-conda-to-s3 python diff --git a/conda/environments/all_cuda-124_arch-x86_64.yaml b/conda/environments/all_cuda-124_arch-x86_64.yaml new file mode 100644 index 0000000..82dba1c --- /dev/null +++ b/conda/environments/all_cuda-124_arch-x86_64.yaml @@ -0,0 +1,63 @@ +# This file is generated by `rapids-dependency-file-generator`. +# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +channels: +- rapidsai +- rapidsai-nightly +- dask/label/dev +- pyg +- conda-forge +- nvidia +dependencies: +- breathe +- cmake>=3.26.4,!=3.30.0 +- cuda-cudart-dev +- cuda-nvtx-dev +- cuda-profiler-api +- cuda-version=12.4 +- cudf==24.12.* +- cugraph==24.12.* +- cupy>=12.0.0 +- cython>=3.0.0 +- dask-cudf==24.12.* +- dglteam/label/th21_cu121::dgl +- doxygen +- graphviz +- ipython +- libcublas-dev +- libcurand-dev +- libcusolver-dev +- libcusparse-dev +- nbsphinx +- ninja +- notebook>=0.5.0 +- numba>=0.57 +- numpy>=1.23,<3.0a0 +- numpydoc +- pandas +- pre-commit +- pydantic +- pydata-sphinx-theme +- pyg::pyg +- pylibcugraphops==24.12.* +- pylibraft==24.12.* +- pylibwholegraph==24.12.* +- pytest +- pytest-benchmark +- pytest-cov +- pytest-xdist +- pytorch-cuda=12.1 +- pytorch::pytorch>=2.0,<2.2.0a0 +- raft-dask==24.12.* +- recommonmark +- rmm==24.12.* +- scikit-build-core>=0.10.0 +- scipy +- setuptools>=61.0.0 +- sphinx-copybutton +- sphinx-markdown-tables +- sphinx<6 +- sphinxcontrib-websupport +- torchdata +- wget +- wheel +name: all_cuda-124_arch-x86_64 diff --git a/dependencies.yaml b/dependencies.yaml index 269b1c3..c0a5f13 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -3,7 +3,7 @@ files: all: output: [conda] matrix: - cuda: ["11.8", "12.1"] + cuda: ["11.8", "12.1", "12.4"] arch: [x86_64] includes: - checks @@ -185,6 +185,14 @@ dependencies: cuda: "12.2" packages: - cuda-version=12.2 + - matrix: + cuda: "12.4" + packages: + - cuda-version=12.4 + - matrix: + cuda: "12.5" + packages: + - cuda-version=12.5 cuda: specific: - output_types: [conda]