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

remove more cugraph-only details, other miscellaneous build/packaging changes #14

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ python:
benchmarks:
- 'benchmarks/**'

datasets:
- 'datasets/**'

ci:
- 'ci/**'

Expand Down
34 changes: 12 additions & 22 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: build

on:
push:
branches:
- "branch-*"
tags:
- v[0-9][0-9].[0-9][0-9].[0-9][0-9]
# TODO: uncomment this condition when ready to start publishing
# packages from this repo
# push:
# branches:
# - "branch-*"
# tags:
# - v[0-9][0-9].[0-9][0-9].[0-9][0-9]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't safe to publish nightly nx-cugraph packages from here until we stop publishing them from https://github.com/rapidsai/cugraph (and delete the old ones from the 24.12 dev cycle, as we discussed offline).

workflow_dispatch:
inputs:
branch:
Expand All @@ -26,34 +28,22 @@ concurrency:
cancel-in-progress: true

jobs:
docs-build:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you won't actually be building docs here, right?

Even if you do plan to, right now there isn't actually a ci/build_docs.sh checked into the repo, so this would immediately fail. Better to delete it and re-introduce it when you're ready, I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there are no plans to build docs in this repo for this release

if: github.ref_type == 'branch'
needs: python-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
arch: "amd64"
branch: ${{ inputs.branch }}
build_type: ${{ inputs.build_type || 'branch' }}
container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10"
date: ${{ inputs.date }}
node_type: "gpu-v100-latest-1"
run_script: "ci/build_docs.sh"
sha: ${{ inputs.sha }}
wheel-build-nx-cugraph:
needs: wheel-publish-pylibcugraph
needs: wheel-publish-nx-cugraph
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@python-3.12
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
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))]))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nx-cugraph is a pure Python package. We only need 2 wheels builds... CUDA 11 for nx-cugraph-cu11 and CUDA 12 for nx-cugraph-cu12.

wheel-publish-nx-cugraph:
needs: wheel-build-nx-cugraph
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@python-3.12
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.12
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ on:
jobs:
conda-python-tests:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@python-3.12
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
wheel-tests-nx-cugraph:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@python-3.12
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12
with:
build_type: nightly
branch: ${{ inputs.branch }}
Expand Down
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ build/

## Datasets
datasets/*
!datasets/cyber.csv
!datasets/get_test_data.sh
!datasets/karate-data.csv
!datasets/karate_undirected.csv
!datasets/karate-disjoint.csv
!datasets/netscience.csv

# nx-cugraph side effects
objects.inv
Expand All @@ -81,8 +75,6 @@ objects.inv

## Doxygen and Docs
cpp/doxygen/html
docs/cugraph/lib*
docs/cugraph/api/*

# Sphinx docs & build artifacts
docs/nx-cugraph/source/api_docs/api/*
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ repos:
- flake8-bugbear==24.8.19
- flake8-simplify==0.21.0
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
rev: v1.5.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were all done automatically.

pre-commit autoupdate

hooks:
- id: yesqa
additional_dependencies: *flake8_dependencies
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.19
rev: v0.22
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
Expand All @@ -57,12 +57,12 @@ repos:
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ VALIDARGS="
HELP="$0 [<target> ...] [<flag> ...]
where <target> is:
clean - remove all existing build artifacts and configuration (start over)
uninstall - uninstall libcugraph and cugraph from a prior build/install (see also -n)
uninstall - uninstall nx-cugraph from a prior build/install (see also -n)
nx-cugraph - build the nx-cugraph Python package
docs - build the docs
all - build everything
Expand Down Expand Up @@ -69,7 +69,7 @@ function buildDefault {

function cleanPythonDir {
pushd $1 > /dev/null
rm -rf dist dask-worker-space cugraph/raft *.egg-info
rm -rf dist dask-worker-space *.egg-info
find . -type d -name __pycache__ -print | xargs rm -rf
find . -type d -name build -print | xargs rm -rf
find . -type d -name dist -print | xargs rm -rf
Expand Down
70 changes: 70 additions & 0 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this from https://github.com/rapidsai/cugraph/blob/branch-24.12/ci/release/update-version.sh, then modified it to just the cases necessary for this repo.

Tested like this:

./ci/release/update-version.sh '25.02.00'
git grep -E '24\.1'

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

## Usage
# bash update-version.sh <new_version>

# Format is YY.MM.PP - no leading 'v' or trailing 'a'
NEXT_FULL_TAG=$1

# Get current version
CURRENT_TAG=$(git tag --merged HEAD | grep -xE '^v.*' | sort --version-sort | tail -n 1 | tr -d 'v')
CURRENT_MAJOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[1]}')
CURRENT_MINOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[2]}')
CURRENT_SHORT_TAG=${CURRENT_MAJOR}.${CURRENT_MINOR}

# Get <major>.<minor> for next version
NEXT_MAJOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[1]}')
NEXT_MINOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[2]}')
NEXT_SHORT_TAG=${NEXT_MAJOR}.${NEXT_MINOR}

echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"

# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
}

# Centralized version file update
echo "${NEXT_FULL_TAG}" > ./VERSION

# Need to distutils-normalize the original version
NEXT_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_SHORT_TAG}'))")

DEPENDENCIES=(
cudf
cugraph
pylibcugraph
)
for FILE in dependencies.yaml conda/environments/*.yaml conda/recipes/**/meta.yaml; do
for DEP in "${DEPENDENCIES[@]}"; do
sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}"
done
done

for DEP in "${DEPENDENCIES[@]}"; do
sed_runner "/\"${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*\"/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0\"/g" ./pyproject.toml
done

# CI files
for FILE in .github/workflows/*.yaml; do
sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}"
done

sed_runner "s/branch-[0-9][0-9].[0-9][0-9]/branch-${NEXT_SHORT_TAG}/" ./docs/nx-cugraph/source/nx_cugraph/nx_cugraph.md

# issue templates
for FILE in ./.github/ISSUE_TEMPLATE/*.yaml; do
sed_runner "s/example\: ${CURRENT_SHORT_TAG}/example: ${NEXT_SHORT_TAG}/" "${FILE}"
done
3 changes: 0 additions & 3 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ dependencies:
packages:
- ipython
- notebook>=0.5.0
- output_types: [conda]
packages:
- wget
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wget already comes pre-installed in our CI images, you don't need the conda version of it.

test_python_common:
common:
- output_types: [conda, pyproject]
Expand Down
2 changes: 1 addition & 1 deletion print_env.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Reports relevant environment information useful for diagnosing and
# debugging cuGraph issues.
# debugging nx-cugraph issues.
# Usage:
# "./print_env.sh" - prints to stdout
# "./print_env.sh > env.txt" - prints to file "env.txt"
Expand Down
Loading