Skip to content

Commit

Permalink
enforce wheel size limits, README formatting in CI (#67)
Browse files Browse the repository at this point in the history
Contributes to rapidsai/build-planning#110

Proposes adding 2 types of validation on wheels in CI, to ensure we continue to produce wheels that are suitable for PyPI.

* checks on wheel size (compressed),
  - *to be sure they're under PyPI limits*
  - *and to prompt discussion on PRs that significantly increase wheel sizes*
* checks on README formatting
  - *to ensure they'll render properly as the PyPI project homepages*
  - *e.g. like how https://github.com/scikit-learn/scikit-learn/blob/main/README.rst becomes https://pypi.org/project/scikit-learn/*

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

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Alex Barghi (https://github.com/alexbarghi-nv)

URL: #67
  • Loading branch information
jameslamb authored Nov 14, 2024
1 parent 5a17bbe commit 2dd3001
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ci/build_wheel_cugraph-dgl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@

set -euo pipefail

./ci/build_wheel.sh cugraph-dgl python/cugraph-dgl
package_dir="python/cugraph-dgl"

./ci/build_wheel.sh cugraph-dgl ${package_dir}
./ci/validate_wheel.sh ${package_dir} dist
5 changes: 4 additions & 1 deletion ci/build_wheel_cugraph-pyg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@

set -euo pipefail

./ci/build_wheel.sh cugraph-pyg python/cugraph-pyg
package_dir="python/cugraph-pyg"

./ci/build_wheel.sh cugraph-pyg ${package_dir}
./ci/validate_wheel.sh ${package_dir} dist
5 changes: 4 additions & 1 deletion ci/build_wheel_pylibwholegraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

set -euo pipefail

package_dir="python/pylibwholegraph"

export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DBUILD_SHARED_LIBS=OFF;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-DCUDA_STATIC_RUNTIME=ON;-DWHOLEGRAPH_BUILD_WHEELS=ON"

./ci/build_wheel.sh pylibwholegraph python/pylibwholegraph
./ci/build_wheel.sh pylibwholegraph ${package_dir}
./ci/validate_wheel.sh ${package_dir} final_dist
21 changes: 21 additions & 0 deletions ci/validate_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

package_dir=$1
wheel_dir_relative_path=$2

cd "${package_dir}"

rapids-logger "validate packages with 'pydistcheck'"

pydistcheck \
--inspect \
"$(echo ${wheel_dir_relative_path}/*.whl)"

rapids-logger "validate packages with 'twine'"

twine check \
--strict \
"$(echo ${wheel_dir_relative_path}/*.whl)"
8 changes: 8 additions & 0 deletions python/cugraph-dgl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ include = [
build-backend = "setuptools.build_meta"
dependencies-file = "../../dependencies.yaml"
matrix-entry = "cuda_suffixed=true"

[tool.pydistcheck]
select = [
"distro-too-large-compressed",
]

# PyPI limit is 100 MiB, fail CI before we get too close to that
max_allowed_size_compressed = '75M'
5 changes: 5 additions & 0 deletions python/cugraph-pyg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# cugraph-pyg

## Description

cuGraph-PyG supports PyTorch Geometric (PyG) and implements PyG's GraphStore, FeatureStore, Loader, and Sampler interfaces.
9 changes: 9 additions & 0 deletions python/cugraph-pyg/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ testpaths = ["cugraph_pyg/tests"]
name = "cugraph-pyg"
dynamic = ["version"]
description = "cugraph-pyg - PyG support for cuGraph massive-scale, ultra-fast GPU graph analytics."
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
{ name = "NVIDIA Corporation" },
]
Expand Down Expand Up @@ -70,3 +71,11 @@ include = [
build-backend = "setuptools.build_meta"
dependencies-file = "../../dependencies.yaml"
matrix-entry = "cuda_suffixed=true"

[tool.pydistcheck]
select = [
"distro-too-large-compressed",
]

# PyPI limit is 100 MiB, fail CI before we get too close to that
max_allowed_size_compressed = '75M'
5 changes: 5 additions & 0 deletions python/pylibwholegraph/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pylibwholegraph

WholeGraph supports PyTorch and provides a distributed graph and kv store.

Both cuGraph-DGL and cuGraph-PyG can leverage WholeGraph for even greater scalability.
9 changes: 9 additions & 0 deletions python/pylibwholegraph/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ requires = [
name = "pylibwholegraph"
dynamic = ["version"]
description = "pylibwholegraph - GPU Graph Storage for GNN feature and graph structure"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
{ name = "NVIDIA Corporation" },
]
Expand Down Expand Up @@ -74,3 +75,11 @@ wheel.packages = ["pylibwholegraph"]
provider = "scikit_build_core.metadata.regex"
input = "pylibwholegraph/VERSION"
regex = "(?P<value>.*)"

[tool.pydistcheck]
select = [
"distro-too-large-compressed",
]

# detect when package size grows significantly
max_allowed_size_compressed = '350M'

0 comments on commit 2dd3001

Please sign in to comment.