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
103 changes: 98 additions & 5 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,81 @@
########################

## 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 0.47.00
# ./ci/release/update-version.sh --run-context=release 0.47.00
# RAPIDS_RUN_CONTEXT=main ./ci/release/update-version.sh 0.47.00

# Verify we're running from the repository root
if [[ ! -f "VERSION" ]] || [[ ! -f "RAPIDS_VERSION" ]] || [[ ! -f "ci/release/update-version.sh" ]] || [[ ! -d "python" ]]; then
echo "Error: This script must be run from the root of the ucxx repository"
echo ""
echo "Usage:"
echo " cd /path/to/ucxx"
echo " ./ci/release/update-version.sh --run-context=main|release <new_version>"
echo ""
echo "Example:"
echo " ./ci/release/update-version.sh --run-context=main 0.47.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[@]}"

# Format is Major.Minor.Patch - no leading 'v' or trailing 'a'
# Example: 0.30.00
NEXT_FULL_TAG=$1

# Determine RUN_CONTEXT with CLI precedence over environment variable, defaulting to main
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 "No run-context provided, defaulting to: ${RUN_CONTEXT}"
fi

# Validate RUN_CONTEXT value
if [[ "${RUN_CONTEXT}" != "main" && "${RUN_CONTEXT}" != "release" ]]; then
echo "Error: Invalid run-context value '${RUN_CONTEXT}'"
echo "Valid values: main, release"
exit 1
fi

# Validate version argument
if [[ -z "${NEXT_FULL_TAG}" ]]; then
echo "Error: Version argument is required"
echo "Usage: ${0} --run-context=<context> <new_version>"
echo " or: RAPIDS_RUN_CONTEXT=<context> ${0} <new_version>"
echo "Note: Defaults to main when run-context is not specified"
exit 1
fi

# 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]}')
Expand All @@ -28,7 +96,14 @@ NEXT_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(
NEXT_RAPIDS_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_RAPIDS_SHORT_TAG}'))")
echo "Next tag is ${NEXT_RAPIDS_SHORT_TAG_PEP440}"

echo "Preparing release: $NEXT_FULL_TAG"
# Set branch references based on RUN_CONTEXT
if [[ "${RUN_CONTEXT}" == "main" ]]; then
RAPIDS_BRANCH_NAME="main"
echo "Preparing development branch update => ${NEXT_FULL_TAG} (targeting main branch)"
elif [[ "${RUN_CONTEXT}" == "release" ]]; then
RAPIDS_BRANCH_NAME="release/${NEXT_RAPIDS_SHORT_TAG}"
echo "Preparing release branch update => ${NEXT_FULL_TAG} (targeting release/${NEXT_RAPIDS_SHORT_TAG} branch)"
fi

# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
Expand All @@ -38,10 +113,11 @@ function sed_runner() {
# Centralized version file update
echo "${NEXT_FULL_TAG}" > VERSION
echo "${NEXT_RAPIDS_SHORT_TAG}.00" > RAPIDS_VERSION
echo "${RAPIDS_BRANCH_NAME}" > RAPIDS_BRANCH

# Update RAPIDS version
for FILE in conda/recipes/*/conda_build_config.yaml; do
sed_runner "/^rapids_version:$/ {n;s/.*/ - \"${NEXT_RAPIDS_SHORT_TAG_PEP440}\.*\"/}" "${FILE}"
sed_runner "/^rapids_version:\$/{ n; s|.*| - \"${NEXT_RAPIDS_SHORT_TAG_PEP440}.*\"|; }" "${FILE}"
done

DEPENDENCIES=(
Expand Down Expand Up @@ -77,9 +153,26 @@ for FILE in python/*/pyproject.toml; do
done
done

# Update cmake/RAPIDS.cmake with context-aware branch references
if [[ "${RUN_CONTEXT}" == "main" ]]; then
sed_runner "s|\"release/\${rapids-cmake-version}\"|\"main\"|g" cmake/RAPIDS.cmake
elif [[ "${RUN_CONTEXT}" == "release" ]]; then
sed_runner "s|\"main\"|\"release/\${rapids-cmake-version}\"|g" cmake/RAPIDS.cmake
fi

# Documentation references - context-aware
if [[ "${RUN_CONTEXT}" == "main" ]]; then
# In main context, keep documentation links on main (no changes needed)
:
elif [[ "${RUN_CONTEXT}" == "release" ]]; then
# In release context, use RAPIDS release branch for documentation links
sed_runner "s|/blob/main/|/blob/release/${NEXT_SHORT_TAG}/|g" docs/ucxx/source/send_recv.rst
fi

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

# .devcontainer files
Expand Down
2 changes: 1 addition & 1 deletion cmake/RAPIDS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endif()
# Allow users to control which branch is fetched
if(NOT rapids-cmake-branch)
# Define a default branch if the user doesn't set one
set(rapids-cmake-branch "branch-${rapids-cmake-version}")
set(rapids-cmake-branch "main")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't change in main context.

This gets sets to the following value when in release mode:

diff --git a/cmake/RAPIDS.cmake b/cmake/RAPIDS.cmake
index 620d9cb..f97dbf0 100644
--- a/cmake/RAPIDS.cmake
+++ b/cmake/RAPIDS.cmake
@@ -26,7 +26,7 @@ endif()
 # Allow users to control which branch is fetched
 if(NOT rapids-cmake-branch)
   # Define a default branch if the user doesn't set one
-  set(rapids-cmake-branch "main")
+  set(rapids-cmake-branch "release/${rapids-cmake-version}")
 endif()

This effectively preserves the old value translated from branch- to release/, but would love someone who knows more about this specific set of configuration to 👀 + 👍🏼

endif()

# Allow users to control the exact URL passed to FetchContent
Expand Down
2 changes: 1 addition & 1 deletion docs/ucxx/source/send_recv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ Most users will not care about these details but developers and interested netwo
[1757536870.872600] [dgx13:1377244] UCXPY DEBUG [Recv #001] ep: 0x7f5a161a8080, tag: 0xdf227087928e03f6, nbytes: 12, type: <class 'bytearray'>


We can see from the above that when the ``Endpoint`` is created, 4 tags are generated: ``msg-tag-send``, ``msg-tag-recv``, ``ctrl-tag-send``, and ``ctrl-tag-recv``. This data is transmitted to the server via a `stream <https://openucx.github.io/ucx/api/latest/html/group___u_c_p___c_o_m_m.html#gae9fe6efe6b05e4e78f58bee68c68b252>`_ communication in an `exchange peer info <https://github.com/rapidsai/ucxx/blob/branch-0.46/python/ucxx/ucxx/_lib_async/exchange_peer_info.py>`_ convenience function.
We can see from the above that when the ``Endpoint`` is created, 4 tags are generated: ``msg-tag-send``, ``msg-tag-recv``, ``ctrl-tag-send``, and ``ctrl-tag-recv``. This data is transmitted to the server via a `stream <https://openucx.github.io/ucx/api/latest/html/group___u_c_p___c_o_m_m.html#gae9fe6efe6b05e4e78f58bee68c68b252>`_ communication in an `exchange peer info <https://github.com/rapidsai/ucxx/blob/main/python/ucxx/ucxx/_lib_async/exchange_peer_info.py>`_ convenience function.

Next, the client sends data on the ``msg-tag-send`` tag. Two messages are sent, the size of the data ``8 bytes`` and data itself. The server receives the data and immediately echos the data back. The client then receives two messages the size of the data and the data itself.