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

Setup Consistent Nightly Versions for Pip and Conda #3933

Merged
merged 29 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
12ebca4
new versioning
divyegala Oct 12, 2023
5cd4fd2
fix mistake
divyegala Oct 13, 2023
deb2905
remove duplicate dynamic
divyegala Oct 13, 2023
bf450ac
remove trailing whitespace
divyegala Oct 13, 2023
d5384e3
correct comment
divyegala Oct 17, 2023
5812c69
remove default conda ver
divyegala Oct 18, 2023
af6c891
anchor version regex
divyegala Oct 20, 2023
0bd47da
VERSION txt
divyegala Oct 25, 2023
7dbbe72
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 25, 2023
e0bf4f7
add VERSION to setup.py
divyegala Oct 25, 2023
ba48393
setup.py updates
divyegala Oct 25, 2023
d02b9bd
double quotes
divyegala Oct 25, 2023
b586d95
import missing package
divyegala Oct 25, 2023
b1dfeb6
use importlib
divyegala Oct 27, 2023
2b40234
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 27, 2023
5ec7d5f
fix style
divyegala Oct 27, 2023
db5c61c
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 27, 2023
ed2e1ef
use loops for version updates
divyegala Oct 27, 2023
5befe56
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 27, 2023
417344f
fix unbound var
divyegala Oct 30, 2023
1bec10e
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 30, 2023
c19f07d
remove unneeded strip
divyegala Oct 31, 2023
b11fd52
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 31, 2023
9bf07fe
remove erroneous line in build_python.sh
divyegala Oct 31, 2023
ea441ca
add comments for clarity
divyegala Nov 1, 2023
8f8f5fe
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Nov 1, 2023
dfaf556
clarify comments more
divyegala Nov 1, 2023
25db390
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Nov 1, 2023
1ad1ef2
style fix
divyegala Nov 1, 2023
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
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
23.12.00
4 changes: 3 additions & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

version=$(rapids-generate-version)

rapids-logger "Begin cpp build"

rapids-conda-retry mambabuild conda/recipes/libcugraph
RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libcugraph

rapids-upload-conda-to-s3 cpp
19 changes: 19 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,24 @@ rapids-print-env

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

version=$(rapids-generate-version)
git_commit=$(git rev-parse HEAD)
export RAPIDS_PACKAGE_VERSION=${version}
echo "${version}" | tr -d '"' > VERSION

rapids-logger "Begin py build"

# TODO: Remove `--no-test` flags once importing on a CPU
# node works correctly
version_file_pylibcugraph="python/pylibcugraph/pylibcugraph/_version.py"
divyegala marked this conversation as resolved.
Show resolved Hide resolved
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_pylibcugraph}
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
conda/recipes/pylibcugraph

version_file_cugraph="python/cugraph/cugraph/_version.py"
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_cugraph}
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
Expand All @@ -30,6 +39,8 @@ rapids-conda-retry mambabuild \
# 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.
version_file_nx_cugraph="python/nx-cugraph/nx_cugraph/_version.py"
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_nx_cugraph}
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
Expand All @@ -40,6 +51,10 @@ rapids-conda-retry mambabuild \
# 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}" \
Expand All @@ -50,6 +65,8 @@ RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"

if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then
# Only CUDA 11 is supported right now due to PyTorch requirement.
version_file_cugraph_pyg="python/cugraph-pyg/cugraph_pyg/_version.py"
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_cugraph_pyg}
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
Expand All @@ -60,6 +77,8 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then
conda/recipes/cugraph-pyg

# Only CUDA 11 is supported right now due to PyTorch requirement.
version_file_cugraph_dgl="python/cugraph-dgl/cugraph_dgl/_version.py"
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_cugraph_dgl}
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
Expand Down
10 changes: 6 additions & 4 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ set -euo pipefail

package_name=$1
package_dir=$2
underscore_package_name=$(echo "${package_name}" | tr "-" "_")

source rapids-configure-sccache
source rapids-date-string

# Use gha-tools rapids-pip-wheel-version to generate wheel version then
# update the necessary files
version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})"
version=$(rapids-generate-version)
git_commit=$(git rev-parse HEAD)

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

Expand All @@ -21,9 +21,11 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}"

# Patch project metadata files to include the CUDA version suffix and version override.
pyproject_file="${package_dir}/pyproject.toml"
version_file="${package_dir}/${underscore_package_name}/_version.py"

sed -i "s/^version = .*/version = \"${version_override}\"/g" ${pyproject_file}
sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file}
echo "${version}" | tr -d '"' > VERSION
sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${version_file}

# For nightlies we want to ensure that we're pulling in alphas as well. The
# easiest way to do so is to augment the spec with a constraint containing a
Expand Down
20 changes: 2 additions & 18 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,8 @@ sed_runner "s/set(cugraph_version .*)/set(cugraph_version ${NEXT_FULL_TAG})/g" p
sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/cugraph/source/conf.py
sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/cugraph/source/conf.py

# Python __init__.py updates
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugraph/cugraph/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugraph-dgl/cugraph_dgl/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugraph-pyg/cugraph_pyg/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugraph-service/client/cugraph_service_client/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cugraph-service/server/cugraph_service_server/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/pylibcugraph/pylibcugraph/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/nx-cugraph/nx_cugraph/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/nx-cugraph/_nx_cugraph/__init__.py

# Python pyproject.toml updates
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph-dgl/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph-pyg/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph-service/client/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cugraph-service/server/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/pylibcugraph/pyproject.toml
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/nx-cugraph/pyproject.toml
# Centralized version file update
rlratzel marked this conversation as resolved.
Show resolved Hide resolved
echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION

# Wheel testing script
sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" ci/test_wheel_cugraph.sh
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cugraph-dgl/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').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'] %}
Expand All @@ -10,7 +10,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cugraph-pyg/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').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'] %}
Expand All @@ -10,7 +10,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cugraph-service/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2018-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').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'] %}
Expand All @@ -9,7 +9,7 @@ package:
name: cugraph-service-split

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

outputs:
- name: cugraph-service-client
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cugraph/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2018-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set py_version = environ['CONDA_PY'] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
Expand All @@ -12,7 +12,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/libcugraph/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2018-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set cuda_major = cuda_version.split('.')[0] %}
Expand All @@ -10,7 +10,7 @@ package:
name: libcugraph-split

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

build:
script_env:
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/nx-cugraph/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').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'] %}
Expand All @@ -10,7 +10,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/pylibcugraph/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set py_version = environ['CONDA_PY'] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
Expand All @@ -12,7 +12,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
1 change: 1 addition & 0 deletions python/cugraph-dgl/cugraph_dgl/VERSION
2 changes: 1 addition & 1 deletion python/cugraph-dgl/cugraph_dgl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
import cugraph_dgl.dataloading
import cugraph_dgl.nn

__version__ = "23.12.00"
from cugraph_dgl._version import __git_commit__, __version__
21 changes: 21 additions & 0 deletions python/cugraph-dgl/cugraph_dgl/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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.
#

import importlib.resources

__version__ = (
importlib.resources.files("cugraph_dgl").joinpath("VERSION").read_text().strip()
rlratzel marked this conversation as resolved.
Show resolved Hide resolved
)
__git_commit__ = ""
5 changes: 4 additions & 1 deletion python/cugraph-dgl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "cugraph-dgl"
version = "23.12.00"
dynamic = ["version"]
description = "cugraph extensions for DGL"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
Expand All @@ -35,6 +35,9 @@ Documentation = "https://docs.rapids.ai/api/cugraph/stable/"
[tool.setuptools]
license-files = ["LICENSE"]

[tool.setuptools.dynamic]
version = {file = "cugraph_dgl/VERSION"}

[tool.setuptools.packages.find]
include = [
"cugraph_dgl*",
Expand Down
7 changes: 5 additions & 2 deletions python/cugraph-dgl/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from setuptools import setup
from setuptools import find_packages, setup

setup()
packages = find_packages(include=["cugraph_dgl*"])
setup(
package_data={key: ["VERSION"] for key in packages},
)
1 change: 1 addition & 0 deletions python/cugraph-pyg/cugraph_pyg/VERSION
2 changes: 1 addition & 1 deletion python/cugraph-pyg/cugraph_pyg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "23.12.00"
from cugraph_pyg._version import __git_commit__, __version__
21 changes: 21 additions & 0 deletions python/cugraph-pyg/cugraph_pyg/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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.
#

import importlib.resources

__version__ = (
importlib.resources.files("cugraph_pyg").joinpath("VERSION").read_text().strip()
)
__git_commit__ = ""
5 changes: 4 additions & 1 deletion python/cugraph-pyg/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ testpaths = ["cugraph_pyg/tests"]

[project]
name = "cugraph_pyg"
version = "23.12.00"
dynamic = ["version"]
description = "cugraph_pyg - PyG support for cuGraph massive-scale, ultra-fast GPU graph analytics."
authors = [
{ name = "NVIDIA Corporation" },
Expand All @@ -38,6 +38,9 @@ Documentation = "https://docs.rapids.ai/api/cugraph/stable/"
[tool.setuptools]
license-files = ["LICENSE"]

[tool.setuptools.dynamic]
version = {file = "cugraph_pyg/VERSION"}

[tool.setuptools.packages.find]
include = [
"cugraph_pyg*",
Expand Down
4 changes: 3 additions & 1 deletion python/cugraph-pyg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os
import shutil

from setuptools import Command, setup
from setuptools import Command, find_packages, setup

from setuputils import get_environment_option

Expand Down Expand Up @@ -59,6 +59,8 @@ def run(self):
os.system("rm -rf *.egg-info")


packages = find_packages(include=["cugraph_pyg*"])
setup(
cmdclass={"clean": CleanCommand},
package_data={key: ["VERSION"] for key in packages},
)
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
from cugraph_service_client.client import CugraphServiceClient
from cugraph_service_client.remote_graph import RemoteGraph

__version__ = "23.12.00"
from cugraph_service_client._version import __git_commit__, __version__
Loading