Skip to content

Commit

Permalink
Add ci/build_python.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknw committed Oct 22, 2024
1 parent a6a28eb commit 20e067e
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ __pycache__
.coverage
.vscode
.lock
*.swp
*.sw?
*.pytest_cache
*~
DartConfiguration.tcl
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ repos:
types: [python]
language: python
pass_filenames: false
additional_dependencies: ["networkx>=3.3"]
additional_dependencies: ["networkx>=3.4"]
- repo: local
hooks:
- id: nx-cugraph-readme-update
Expand All @@ -70,4 +70,4 @@ repos:
types_or: [python, markdown]
language: python
pass_filenames: false
additional_dependencies: ["networkx>=3.3"]
additional_dependencies: ["networkx>=3.4"]
38 changes: 38 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

set -euo pipefail

rapids-configure-conda-channels

source rapids-configure-sccache

source rapids-date-string

export CMAKE_GENERATOR=Ninja

rapids-print-env

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

rapids-generate-version > ./VERSION
export RAPIDS_PACKAGE_VERSION=$(head -1 ./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-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/nx-cugraph

RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"

rapids-upload-conda-to-s3 python
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 ={{ 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

0 comments on commit 20e067e

Please sign in to comment.