Skip to content
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ cuvsCagraIndexParamsDestroy(index_params);
cuvsResourcesDestroy(res);
```

For more code examples of the C APIs, including drop-in Cmake project templates, please refer to the [C examples](https://github.com/rapidsai/cuvs/tree/branch-25.12/examples/c)
For more code examples of the C APIs, including drop-in Cmake project templates, please refer to the [C examples](https://github.com/rapidsai/cuvs/tree/main/examples/c)

### Rust API

Expand Down Expand Up @@ -234,7 +234,7 @@ fn cagra_example() -> Result<()> {
}
```

For more code examples of the Rust APIs, including a drop-in project templates, please refer to the [Rust examples](https://github.com/rapidsai/cuvs/tree/branch-25.12/examples/rust).
For more code examples of the Rust APIs, including a drop-in project templates, please refer to the [Rust examples](https://github.com/rapidsai/cuvs/tree/main/examples/rust).

## Contributing

Expand Down
94 changes: 83 additions & 11 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,66 @@
########################

## Usage
# bash update-version.sh <new_version>
# Primary interface: ./ci/release/update-version.sh --run-context=main|release <new_version>
# Fallback: Environment variable support for automation needs
# NOTE: Must be run from the root of the repository
#
# CLI args take precedence when both are provided
# If neither RUN_CONTEXT nor --run-context is provided, defaults to main
#
# Examples:
# ./ci/release/update-version.sh --run-context=main 25.12.00
# ./ci/release/update-version.sh --run-context=release 25.12.00
# RAPIDS_RUN_CONTEXT=main ./ci/release/update-version.sh 25.12.00

# Verify we're running from the repository root
if [[ ! -f "VERSION" ]] || [[ ! -f "ci/release/update-version.sh" ]] || [[ ! -d "python" ]]; then
echo "Error: This script must be run from the root of the cuvs repository"
echo ""
echo "Usage:"
echo " cd /path/to/cuvs"
echo " ./ci/release/update-version.sh --run-context=main|release <new_version>"
echo ""
echo "Example:"
echo " ./ci/release/update-version.sh --run-context=main 25.12.00"
exit 1
fi

# Parse command line arguments
POSITIONAL_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
--run-context=*)
CLI_RUN_CONTEXT="${1#*=}"
shift
;;
*)
POSITIONAL_ARGS+=("$1")
shift
;;
esac
done

# Restore positional parameters
set -- "${POSITIONAL_ARGS[@]}"

# Determine RUN_CONTEXT with precedence: CLI > Environment > Default
if [[ -n "${CLI_RUN_CONTEXT:-}" ]]; then
RUN_CONTEXT="${CLI_RUN_CONTEXT}"
echo "Using run-context from CLI: ${RUN_CONTEXT}"
elif [[ -n "${RAPIDS_RUN_CONTEXT:-}" ]]; then
RUN_CONTEXT="${RAPIDS_RUN_CONTEXT}"
echo "Using RUN_CONTEXT from environment: ${RUN_CONTEXT}"
else
RUN_CONTEXT="main"
echo "Using default run-context: ${RUN_CONTEXT}"
fi

# Validate RUN_CONTEXT
if [[ "${RUN_CONTEXT}" != "main" && "${RUN_CONTEXT}" != "release" ]]; then
echo "Error: Invalid run-context '${RUN_CONTEXT}'. Must be 'main' or 'release'"
exit 1
fi

# Format is YY.MM.PP - no leading 'v' or trailing 'a'
NEXT_FULL_TAG=$1
Expand All @@ -28,7 +86,14 @@ NEXT_SHORT_TAG=${NEXT_MAJOR}.${NEXT_MINOR}
NEXT_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_SHORT_TAG}'))")
PATCH_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_PATCH}'))")

echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"
# Determine branch name based on context
if [[ "${RUN_CONTEXT}" == "main" ]]; then
RAPIDS_BRANCH_NAME="main"
echo "Preparing development branch update ${CURRENT_TAG} => ${NEXT_FULL_TAG} (targeting main branch)"
elif [[ "${RUN_CONTEXT}" == "release" ]]; then
RAPIDS_BRANCH_NAME="release/${NEXT_SHORT_TAG}"
echo "Preparing release branch update ${CURRENT_TAG} => ${NEXT_FULL_TAG} (targeting release/${NEXT_SHORT_TAG} branch)"
fi

# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
Expand All @@ -37,7 +102,7 @@ function sed_runner() {

# Centralized version file update
echo "${NEXT_FULL_TAG}" > VERSION
echo "branch-${NEXT_SHORT_TAG}" > RAPIDS_BRANCH
echo "${RAPIDS_BRANCH_NAME}" > RAPIDS_BRANCH

DEPENDENCIES=(
dask-cuda
Expand All @@ -62,23 +127,30 @@ for FILE in python/*/pyproject.toml; do
done
done

# CI files - context-aware branch references
for FILE in .github/workflows/*.yaml; do
sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}"
sed_runner "/shared-workflows/ s|@.*|@${RAPIDS_BRANCH_NAME}|g" "${FILE}"
sed_runner "s/:[0-9]*\\.[0-9]*-/:${NEXT_SHORT_TAG}-/g" "${FILE}"
done

sed_runner "/rapidsai\/raft/ s|branch-[0-9][0-9].[0-9][0-9]|branch-${NEXT_SHORT_TAG}|g" docs/source/developer_guide.md

# Update cuvs-bench Docker image references
# Documentation and code references - context-aware
if [[ "${RUN_CONTEXT}" == "main" ]]; then
# In main context, keep documentation on main (no changes needed)
:
elif [[ "${RUN_CONTEXT}" == "release" ]]; then
# In release context, use release branch for documentation links (word boundaries to avoid partial matches)
sed_runner "/rapidsai\\/cuvs/ s|\\bmain\\b|release/${NEXT_SHORT_TAG}|g" docs/source/developer_guide.md
sed_runner "s|\\bmain\\b|release/${NEXT_SHORT_TAG}|g" README.md
sed_runner "s|\\bmain\\b|release/${NEXT_SHORT_TAG}|g" python/cuvs_bench/cuvs_bench/plot/__main__.py
fi

# Update cuvs-bench Docker image references (version-only, not branch-related)
sed_runner "s|rapidsai/cuvs-bench:[0-9][0-9].[0-9][0-9]|rapidsai/cuvs-bench:${NEXT_SHORT_TAG}|g" docs/source/cuvs_bench/index.rst

# Version references (not branch-related)
sed_runner "s|=[0-9][0-9].[0-9][0-9]|=${NEXT_SHORT_TAG}|g" README.md
sed_runner "s|branch-[0-9][0-9].[0-9][0-9]|branch-${NEXT_SHORT_TAG}|g" README.md
sed_runner "s|@v[0-9][0-9].[0-9][0-9].[0-9][0-9]|@v${NEXT_FULL_TAG}|g" examples/go/README.md

# references to license files
sed_runner "s|branch-[0-9][0-9].[0-9][0-9]|branch-${NEXT_SHORT_TAG}|g" python/cuvs_bench/cuvs_bench/plot/__main__.py

# rust can't handle leading 0's in the major/minor/patch version - remove
NEXT_FULL_RUST_TAG=$(printf "%d.%d.%d" $((10#$NEXT_MAJOR)) $((10#$NEXT_MINOR)) $((10#$NEXT_PATCH)))
sed_runner "s/version = \".*\"/version = \"${NEXT_FULL_RUST_TAG}\"/g" rust/Cargo.toml
Expand Down
4 changes: 2 additions & 2 deletions docs/source/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ RAFT relies on `clang-format` to enforce code style across all C++ and CUDA sour
1. Do not split empty functions/records/namespaces.
2. Two-space indentation everywhere, including the line continuations.
3. Disable reflowing of comments.
The reasons behind these deviations from the Google style guide are given in comments [here](https://github.com/rapidsai/raft/blob/branch-25.12/cpp/.clang-format).
The reasons behind these deviations from the Google style guide are given in comments [here](https://github.com/rapidsai/cuvs/blob/main/cpp/.clang-format).

[`doxygen`](https://doxygen.nl/) is used as documentation generator and also as a documentation linter.
In order to run doxygen as a linter on C++/CUDA code, run
Expand All @@ -205,7 +205,7 @@ you can run `codespell -i 3 -w .` from the repository root directory.
This will bring up an interactive prompt to select which spelling fixes to apply.

### #include style
[include_checker.py](https://github.com/rapidsai/raft/blob/branch-25.12/cpp/scripts/include_checker.py) is used to enforce the include style as follows:
[include_checker.py](https://github.com/rapidsai/cuvs/blob/main/cpp/scripts/include_checker.py) is used to enforce the include style as follows:
1. `#include "..."` should be used for referencing local files only. It is acceptable to be used for referencing files in a sub-folder/parent-folder of the same algorithm, but should never be used to include files in other algorithms or between algorithms and the primitives or other dependencies.
2. `#include <...>` should be used for referencing everything else

Expand Down
2 changes: 1 addition & 1 deletion python/cuvs_bench/cuvs_bench/plot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 1: https://github.com/erikbern/ann-benchmarks/blob/main/plot.py
# 2: https://github.com/erikbern/ann-benchmarks/blob/main/ann_benchmarks/plotting/utils.py # noqa: E501
# 3: https://github.com/erikbern/ann-benchmarks/blob/main/ann_benchmarks/plotting/metrics.py # noqa: E501
# License: https://github.com/rapidsai/cuvs/blob/branch-25.12/thirdparty/LICENSES/LICENSE.ann-benchmark # noqa: E501
# License: https://github.com/rapidsai/cuvs/blob/main/thirdparty/LICENSES/LICENSE.ann-benchmark # noqa: E501

import itertools
import os
Expand Down