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 #1880

Merged
merged 30 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d1b4f3b
setup versions
divyegala Oct 10, 2023
3923ba4
add eof
divyegala Oct 10, 2023
506f85d
fix typo
divyegala Oct 10, 2023
911e5ef
style fix
divyegala Oct 10, 2023
a0813fe
remove two dynamic keys
divyegala Oct 10, 2023
dc1c7ac
fix being able to pick version in pyproject
divyegala Oct 11, 2023
5406e84
Update build_wheel.sh
divyegala Oct 12, 2023
bc0021b
update update_version
divyegala Oct 17, 2023
03dbd24
try to clean commit tree
divyegala Oct 18, 2023
428595a
remove default conda ver
divyegala Oct 19, 2023
004d27b
remove previous bad merge
divyegala Oct 19, 2023
137e6e6
more bad merge removal
divyegala Oct 19, 2023
cfa4e36
use anchor in sed regex
divyegala Oct 20, 2023
532c3e7
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 20, 2023
21d6d9c
VERSION txt
divyegala Oct 25, 2023
e8a2fdf
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 25, 2023
71b1d49
add VERSION to setup.py
divyegala Oct 25, 2023
77228d2
double quotes
divyegala Oct 25, 2023
bebf0e1
fix typo
divyegala Oct 25, 2023
9603937
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 25, 2023
387ed75
use importlib
divyegala Oct 26, 2023
2123163
style fix
divyegala Oct 26, 2023
39b91b0
correct package name
divyegala Oct 27, 2023
6bd7b28
use loop updates
divyegala Oct 27, 2023
aa6be3f
remove unneeded vars
divyegala Oct 27, 2023
5a54f71
fix unbound var
divyegala Oct 30, 2023
e055bf8
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 30, 2023
dc2a30c
remove unneeded stripping
divyegala Oct 31, 2023
68db1e9
Merge remote-tracking branch 'upstream/branch-23.12' into nightly_ver…
divyegala Oct 31, 2023
47eadaf
remove erroneous line in build_python.sh
divyegala Oct 31, 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/libraft
RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libraft

rapids-upload-conda-to-s3 cpp
13 changes: 13 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ rapids-logger "Begin py build"

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

package_dir="python"
for package_name in pylibraft raft-dask; do
underscore_package_name=$(echo "${package_name}" | tr "-" "_")
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/${underscore_package_name}/_version.py"
done

# TODO: Remove `--no-test` flags once importing on a CPU
# node works correctly
rapids-conda-retry mambabuild \
Expand All @@ -27,6 +38,8 @@ rapids-conda-retry mambabuild \
conda/recipes/raft-dask

# Build ann-bench for each cuda and python version
version_file_raft_ann_bench="python/raft-ann-bench/src/raft-ann-bench/_version.py"
sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_raft_dask}
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
Expand Down
9 changes: 5 additions & 4 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ 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 @@ -22,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
5 changes: 2 additions & 3 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ sed_runner 's/'"pylibraft_version .*)"'/'"pylibraft_version ${NEXT_FULL_TAG})"'/
sed_runner 's/'"raft_dask_version .*)"'/'"raft_dask_version ${NEXT_FULL_TAG})"'/g' python/raft-dask/CMakeLists.txt
sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' fetch_rapids.cmake

# Python __init__.py updates
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/pylibraft/pylibraft/__init__.py
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/raft-dask/raft_dask/__init__.py
# Centralized version file update
echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION

# Wheel testing script
sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" ci/test_wheel_raft_dask.sh
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/libraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage:
# conda build . -c conda-forge -c nvidia -c rapidsai
{% 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 @@ -13,7 +13,7 @@ package:
name: libraft-split

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

outputs:
- name: libraft-headers-only
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/pylibraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage:
# conda build . -c conda-forge -c numba -c rapidsai -c pytorch
{% 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 @@ -14,7 +14,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/raft-ann-bench-cpu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage:
# conda build . -c conda-forge -c nvidia -c rapidsai
{% 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 @@ -14,7 +14,7 @@ package:
script: build.sh

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

build:
script_env:
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/raft-ann-bench/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage:
# conda build . -c conda-forge -c nvidia -c rapidsai
{% 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 @@ -16,7 +16,7 @@ package:
script: build.sh

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

build:
script_env:
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/raft-dask/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage:
# conda build . -c conda-forge -c numba -c rapidsai -c pytorch
{% 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 @@ -14,7 +14,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
1 change: 1 addition & 0 deletions python/pylibraft/pylibraft/VERSION
2 changes: 1 addition & 1 deletion python/pylibraft/pylibraft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
#

__version__ = "23.12.00"
from pylibraft._version import __git_commit__, __version__
25 changes: 25 additions & 0 deletions python/pylibraft/pylibraft/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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("pylibraft")
.joinpath("VERSION")
.read_text()
.strip()
)
__git_commit__ = ""
5 changes: 4 additions & 1 deletion python/pylibraft/pyproject.toml
divyegala marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pylibraft"
version = "23.12.00"
dynamic = ["version"]
description = "RAFT: Reusable Algorithms Functions and other Tools"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
Expand Down Expand Up @@ -64,6 +64,9 @@ Documentation = "https://docs.rapids.ai/api/raft/stable/"
[tool.setuptools]
license-files = ["LICENSE"]

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

[tool.isort]
line_length = 79
multi_line_output = 3
Expand Down
2 changes: 1 addition & 1 deletion python/pylibraft/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ def exclude_libcxx_symlink(cmake_manifest):
# Don't want libcxx getting pulled into wheel builds.
cmake_process_manifest_hook=exclude_libcxx_symlink,
packages=packages,
package_data={key: ["*.pxd"] for key in packages},
package_data={key: ["VERSION", "*.pxd"] for key in packages},
zip_safe=False,
)
14 changes: 14 additions & 0 deletions python/raft-ann-bench/src/raft-ann-bench/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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.
#
5 changes: 4 additions & 1 deletion python/raft-dask/pyproject.toml
divyegala marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ requires = [

[project]
name = "raft-dask"
version = "23.12.00"
dynamic = ["version"]
description = "Reusable Accelerated Functions & Tools Dask Infrastructure"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
Expand Down Expand Up @@ -63,6 +63,9 @@ Documentation = "https://docs.rapids.ai/api/raft/stable/"
[tool.setuptools]
license-files = ["LICENSE"]

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

[tool.isort]
line_length = 79
multi_line_output = 3
Expand Down
1 change: 1 addition & 0 deletions python/raft-dask/raft_dask/VERSION
2 changes: 1 addition & 1 deletion python/raft-dask/raft_dask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
#

__version__ = "23.12.00"
from raft_dask._version import __git_commit__, __version__
25 changes: 25 additions & 0 deletions python/raft-dask/raft_dask/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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("raft_dask")
.joinpath("VERSION")
.read_text()
.strip()
)
__git_commit__ = ""
2 changes: 1 addition & 1 deletion python/raft-dask/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ def exclude_libcxx_symlink(cmake_manifest):
setup(
cmake_process_manifest_hook=exclude_libcxx_symlink,
packages=packages,
package_data={key: ["*.pxd"] for key in packages},
package_data={key: ["VERSION", "*.pxd"] for key in packages},
zip_safe=False,
)
Loading