Skip to content

Commit

Permalink
[CI] Adding CI Workflows: checks, changed-files, builds (#6)
Browse files Browse the repository at this point in the history
Closes rapidsai/graph_dl#636 
Closes rapidsai/graph_dl#637

This PR adds the following jobs in CI:
 - `changed-files`
 - `conda-python-build`
 - `wheel-build-nx-cugraph`

Authors:
  - Ralph Liu (https://github.com/nv-rliu)
  - Erik Welch (https://github.com/eriknw)
  - Divye Gala (https://github.com/divyegala)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - James Lamb (https://github.com/jameslamb)
  - Bradley Dice (https://github.com/bdice)
  - Rick Ratzel (https://github.com/rlratzel)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Tingyu Wang (https://github.com/tingyu66)
  - Alex Barghi (https://github.com/alexbarghi-nv)

Approvers:
  - James Lamb (https://github.com/jameslamb)

URL: #6
  • Loading branch information
nv-rliu authored Nov 1, 2024
1 parent 3e09b1c commit 3b062b9
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/ops-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ auto_merger: true
branch_checker: true
label_checker: true
release_drafter: true
recently_updated: false
forward_merger: true
recently_updated: true
34 changes: 34 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,48 @@ concurrency:
jobs:
pr-builder:
needs:
- changed-files
- checks
- conda-python-build
- wheel-build-nx-cugraph
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
if: always()
with:
needs: ${{ toJSON(needs) }}
changed-files:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
files_yaml: |
test_notebooks:
- '**'
- '!README.md'
- '!docs/**'
test_python:
- '**'
- '!README.md'
- '!docs/**'
- '!notebooks/**'
checks:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
enable_check_generated_files: false
conda-python-build:
needs: [checks]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
# This selects "ARCH=amd64 + the latest supported Python + CUDA".
matrix_filter: map(select(.ARCH == "amd64")) | group_by(.CUDA_VER|split(".")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]))
wheel-build-nx-cugraph:
needs: [checks]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
script: ci/build_wheel_nx-cugraph.sh
# This selects "ARCH=amd64 + the latest supported Python + CUDA".
matrix_filter: map(select(.ARCH == "amd64")) | group_by(.CUDA_VER|split(".")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]))
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ repos:
- id: check-ast
- id: check-toml
- id: check-yaml
exclude: '^conda/recipes/.*\.yaml$'
- id: debug-statements
- id: end-of-file-fixer
exclude_types: [svg]
Expand Down
26 changes: 26 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

set -euo pipefail

rapids-configure-conda-channels

source rapids-date-string

rapids-print-env

rapids-generate-version > ./VERSION
rapids-logger "Begin py build"

# TODO: Remove `--no-test` flags once importing on a CPU
# node works correctly

# 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_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \
--no-test \
conda/recipes/nx-cugraph

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

set -euo pipefail

package_name=$1
package_dir=$2

source rapids-date-string

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

rapids-generate-version > ./VERSION

cd "${package_dir}"

python -m pip wheel \
-w dist \
-v \
--no-deps \
--disable-pip-version-check \
--extra-index-url https://pypi.nvidia.com \
.

RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 python dist
7 changes: 7 additions & 0 deletions ci/build_wheel_nx-cugraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

set -euo pipefail

# pkg-name pkg-dir
./ci/build_wheel.sh nx-cugraph .
7 changes: 7 additions & 0 deletions conda/recipes/nx-cugraph/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

# Copyright (c) 2023-2024, NVIDIA CORPORATION.

# This assumes the script is executed from the root of the repo directory

./build.sh nx-cugraph
43 changes: 43 additions & 0 deletions conda/recipes/nx-cugraph/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set py_version = environ['CONDA_PY'] %}
{% set date_string = environ['RAPIDS_DATE_STRING'] %}

package:
name: nx-cugraph
version: {{ version }}

source:
path: ../../..

build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}

requirements:
host:
- python
- rapids-build-backend>=0.3.1,<0.4.0.dev0
- setuptools>=61.0.0
run:
- pylibcugraph ={{ minor_version }}
- networkx >=3.0
- cupy >=12.0.0
- python

tests:
imports:
- nx_cugraph
commands:
- pip check
requires:
- pip

about:
home: https://rapids.ai/
dev_url: https://github.com/rapidsai/nx-cugraph
license: Apache-2.0
license_file: ../../../LICENSE
summary: cuGraph backend for GPU-accelerated NetworkX
File renamed without changes.

0 comments on commit 3b062b9

Please sign in to comment.