From 82f0668ba745dc655710eabdc605eafc337204ff Mon Sep 17 00:00:00 2001 From: Divye Gala Date: Tue, 9 Jun 2026 20:43:01 +0000 Subject: [PATCH 1/7] Test RAFT 3052 --- ci/build_cpp.sh | 1 + ci/build_go.sh | 2 ++ ci/build_java.sh | 2 ++ ci/build_python.sh | 1 + ci/build_rust.sh | 2 ++ ci/build_wheel_cuvs.sh | 2 ++ ci/build_wheel_libcuvs.sh | 2 ++ ci/test_cpp.sh | 2 ++ ci/test_python.sh | 2 ++ ci/test_wheel_cuvs.sh | 2 ++ ci/use_conda_packages_from_prs.sh | 30 ++++++++++++++++++++++++++++++ ci/use_wheels_from_prs.sh | 21 +++++++++++++++++++++ 12 files changed, 69 insertions(+) create mode 100755 ci/use_conda_packages_from_prs.sh create mode 100755 ci/use_wheels_from_prs.sh diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index bb497692bd..6295eaed9b 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -24,6 +24,7 @@ export RAPIDS_ARTIFACTS_DIR # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array source rapids-rattler-channel-string +source ./ci/use_conda_packages_from_prs.sh # --no-build-id allows for caching with `sccache` # more info is available at diff --git a/ci/build_go.sh b/ci/build_go.sh index 056f40b345..ec89d35e80 100755 --- a/ci/build_go.sh +++ b/ci/build_go.sh @@ -20,6 +20,8 @@ rapids-dependency-file-generator \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml +source ./ci/use_conda_packages_from_prs.sh + rapids-mamba-retry env create --yes -f env.yaml -n go # seeing failures on activating the environment here on unbound locals diff --git a/ci/build_java.sh b/ci/build_java.sh index 2e363bb452..34cf6cb501 100755 --- a/ci/build_java.sh +++ b/ci/build_java.sh @@ -38,6 +38,8 @@ rapids-dependency-file-generator \ --prepend-channel "${CPP_CHANNEL}" \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | tee "${ENV_YAML_DIR}/env.yaml" +source ./ci/use_conda_packages_from_prs.sh + rapids-mamba-retry env create --yes -f "${ENV_YAML_DIR}/env.yaml" -n java # Temporarily allow unbound variables for conda activation. diff --git a/ci/build_python.sh b/ci/build_python.sh index 6823cbbec5..01ef8513b3 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -21,6 +21,7 @@ echo "${version}" > VERSION # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array source rapids-rattler-channel-string +source ./ci/use_conda_packages_from_prs.sh rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS" diff --git a/ci/build_rust.sh b/ci/build_rust.sh index e9218a8adc..bfbd6cf871 100755 --- a/ci/build_rust.sh +++ b/ci/build_rust.sh @@ -20,6 +20,8 @@ rapids-dependency-file-generator \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml +source ./ci/use_conda_packages_from_prs.sh + rapids-mamba-retry env create --yes -f env.yaml -n rust # seeing failures on activating the environment here on unbound locals diff --git a/ci/build_wheel_cuvs.sh b/ci/build_wheel_cuvs.sh index 2acbab8a2d..e3c3b34e8b 100755 --- a/ci/build_wheel_cuvs.sh +++ b/ci/build_wheel_cuvs.sh @@ -15,6 +15,8 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")" # # env variable 'PIP_CONSTRAINT' is set up by rapids-init-pip. It constrains all subsequent # 'pip install', 'pip download', etc. calls (except those used in 'pip wheel', handled separately in build scripts) +source ./ci/use_wheels_from_prs.sh + LIBCUVS_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuvs cuvs --cuda "$RAPIDS_CUDA_VERSION")") echo "libcuvs-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo "${LIBCUVS_WHEELHOUSE}"/libcuvs_*.whl)" >> "${PIP_CONSTRAINT}" diff --git a/ci/build_wheel_libcuvs.sh b/ci/build_wheel_libcuvs.sh index e012935749..dfedd58262 100755 --- a/ci/build_wheel_libcuvs.sh +++ b/ci/build_wheel_libcuvs.sh @@ -19,6 +19,8 @@ rapids-dependency-file-generator \ --matrix "${matrix_selectors}" \ | tee /tmp/requirements-build.txt +source ./ci/use_wheels_from_prs.sh + rapids-logger "Installing build requirements" rapids-pip-retry install \ -v \ diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 0905cd64f0..ea199f861e 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -19,6 +19,8 @@ rapids-dependency-file-generator \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml +source ./ci/use_conda_packages_from_prs.sh + rapids-mamba-retry env create --yes -f env.yaml -n test # Temporarily allow unbound variables for conda activation. diff --git a/ci/test_python.sh b/ci/test_python.sh index 77840ac28d..6830b34c94 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -22,6 +22,8 @@ rapids-dependency-file-generator \ --prepend-channel "${PYTHON_CHANNEL}" \ | tee env.yaml +source ./ci/use_conda_packages_from_prs.sh + rapids-mamba-retry env create --yes -f env.yaml -n test # Temporarily allow unbound variables for conda activation. diff --git a/ci/test_wheel_cuvs.sh b/ci/test_wheel_cuvs.sh index 36fefdf852..41b322fe15 100755 --- a/ci/test_wheel_cuvs.sh +++ b/ci/test_wheel_cuvs.sh @@ -9,6 +9,8 @@ source rapids-init-pip # Delete system libnccl.so to ensure the wheel is used rm -rf /usr/lib64/libnccl* +source ./ci/use_wheels_from_prs.sh + LIBCUVS_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuvs cuvs --cuda "$RAPIDS_CUDA_VERSION")") CUVS_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_python cuvs cuvs --stable --cuda "$RAPIDS_CUDA_VERSION")") diff --git a/ci/use_conda_packages_from_prs.sh b/ci/use_conda_packages_from_prs.sh new file mode 100755 index 0000000000..fb807e8a02 --- /dev/null +++ b/ci/use_conda_packages_from_prs.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +# download CI artifacts +LIBRAFT_CHANNEL=$(rapids-get-pr-artifact raft 3052 cpp conda) +RAFT_CHANNEL=$(rapids-get-pr-artifact raft 3052 python conda --stable) + +# For `rattler` builds: +# +# Add these channels to the array checked by 'rapids-rattler-channel-string'. +# This ensures that when conda packages are built with strict channel priority enabled, +# the locally-downloaded packages will be preferred to remote packages (e.g. nightlies). +# +RAPIDS_PREPENDED_CONDA_CHANNELS=( + "${LIBRAFT_CHANNEL}" + "${RAFT_CHANNEL}" +) +export RAPIDS_PREPENDED_CONDA_CHANNELS + +# For tests and `conda-build` builds: +# +# Add these channels to the system-wide conda configuration. +# This results in PREPENDING them to conda's channel list, so +# these packages should be found first if strict channel priority is enabled. +# +for _channel in "${RAPIDS_PREPENDED_CONDA_CHANNELS[@]}" +do + conda config --system --add channels "${_channel}" +done diff --git a/ci/use_wheels_from_prs.sh b/ci/use_wheels_from_prs.sh new file mode 100755 index 0000000000..840fe28127 --- /dev/null +++ b/ci/use_wheels_from_prs.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-License-Identifier: Apache-2.0 + +# initialize PIP_CONSTRAINT +source rapids-init-pip + +RAPIDS_PY_CUDA_SUFFIX=$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}") + +# download wheels, store the directories holding them in variables +LIBRAFT_WHEELHOUSE=$( + RAPIDS_PY_WHEEL_NAME="libraft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-get-pr-artifact raft 3052 cpp wheel +) +RAFT_WHEELHOUSE=$( + RAPIDS_PY_WHEEL_NAME="pylibraft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-get-pr-artifact raft 3052 python wheel +) +# write a pip constraints file saying e.g. "whenever you encounter a requirement for 'librmm-cu12', use this wheel" +cat > "${PIP_CONSTRAINT}" < Date: Tue, 9 Jun 2026 20:57:28 +0000 Subject: [PATCH 2/7] move above --- ci/build_cpp.sh | 2 +- ci/build_python.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 6295eaed9b..d271665094 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -23,8 +23,8 @@ mkdir -p "${RAPIDS_ARTIFACTS_DIR}" export RAPIDS_ARTIFACTS_DIR # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array -source rapids-rattler-channel-string source ./ci/use_conda_packages_from_prs.sh +source rapids-rattler-channel-string # --no-build-id allows for caching with `sccache` # more info is available at diff --git a/ci/build_python.sh b/ci/build_python.sh index 01ef8513b3..c1062e4502 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -20,8 +20,8 @@ export RAPIDS_PACKAGE_VERSION=${version} echo "${version}" > VERSION # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array -source rapids-rattler-channel-string source ./ci/use_conda_packages_from_prs.sh +source rapids-rattler-channel-string rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS" From 5e60915b68701c5a11cb65ceb3c4be87692f90f4 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Wed, 10 Jun 2026 14:43:17 -0400 Subject: [PATCH 3/7] fix: vendor temporary `rapids-get-pr-artifact` with support for new naming scheme --- ci/rapids-get-pr-artifact | 156 ++++++++++++++++++++++++++++++ ci/use_conda_packages_from_prs.sh | 4 +- ci/use_wheels_from_prs.sh | 8 +- 3 files changed, 162 insertions(+), 6 deletions(-) create mode 100755 ci/rapids-get-pr-artifact diff --git a/ci/rapids-get-pr-artifact b/ci/rapids-get-pr-artifact new file mode 100755 index 0000000000..ccba4f88cc --- /dev/null +++ b/ci/rapids-get-pr-artifact @@ -0,0 +1,156 @@ +#!/bin/bash +# Common functionality for downloading artifacts from GitHub PR builds +# +# Arguments: +# 1) repo name +# 2) PR number +# 3) "cpp" or "python", to get the artifact for the C++ or Python build, respectively +# 4) "wheel" or "conda", to get the wheel or conda package artifact, respectively +# 5) [optional] full commit hash, to get the artifact for a specific commit +# Flags: +# --stable: for wheel python packages that use stable ABI (abi3) +# --pure: for conda and wheel packages that are pure builds +# --cuda: for cuda-suffixed artifacts (uses `$RAPIDS_CUDA_VERSION`) +# --arch {ARCH}: arch to use if different from `$(arch)` -- or use 'any' for pure builds +# --pkg_name {package_name}: specify the package name to download if different from repo name (e.g. pylibraft) +# +# Additional environment variables recognized by 'rapids-get-pr-artifact': +# +# * RAPIDS_BUILD_WORKFLOW_NAME = Filename for the workflow that build the artifacts you're trying to fetch. +# Defaults to 'pr.yaml'. +# +set -euo pipefail + +# Parse flags +arch_flag=0 +stable_flag=0 +pure_flag=0 +cuda_flag=0 +pkg_name_arg="" +arch_arg="$(arch)" +positional_args=() + +while [[ $# -gt 0 ]]; do + case $1 in + --arch) + # shellcheck disable=SC2034 + arch_arg="$2" + # shellcheck disable=SC2034 + arch_flag=1 + shift + ;; + --stable) + stable_flag=1 + shift + ;; + --pure) + # shellcheck disable=SC2034 + pure_flag=1 + shift + ;; + --cuda) + cuda_flag=1 + shift + ;; + --pkg_name) + pkg_name_arg="$2" + shift 2 + ;; + -*) + echo "Unknown flag: $1" >&2 + exit 1 + ;; + *) + positional_args+=("$1") + shift + ;; + esac +done + +# Check for minimum required arguments +if [[ ${#positional_args[@]} -lt 4 ]]; then + echo "Must specify: REPO_NAME PR_NUMBER PACKAGE_TYPE PACKAGE_FORMAT [COMMIT]" >&2 + exit 1 +fi + +repo_name="${positional_args[0]}" +repo="rapidsai/${positional_args[0]}" +pr="${positional_args[1]}" +package_type="${positional_args[2]}" +package_format="${positional_args[3]}" +commit="${positional_args[4]:-}" + +# Validate --stable flag +if (( stable_flag == 1 )); then + if [[ "${package_type:-}" != "python" ]]; then + rapids-echo-stderr "Error: --stable flag is only compatible with package_type='python'" + rapids-echo-stderr "Got: package_format='${package_format}'" + exit 1 + fi +fi + +source rapids-prompt-local-github-auth + +# If commit is not provided, get the latest commit on the PR +if [[ -z "${commit:-}" ]]; then + commit=$(rapids-retry --quiet gh pr view "${pr}" --repo "${repo}" --json headRefOid --jq '.headRefOid') +fi + + +# Generate the artifact name + +PACKAGE_NAME="${pkg_name_arg:-${repo_name}}" \ +RAPIDS_ARTIFACT_NAME_ARGS=("${package_format}_${package_type}" "$PACKAGE_NAME" "${repo_name}") +if (( stable_flag == 1 )); then + RAPIDS_ARTIFACT_NAME_ARGS+=("--stable") +fi + +if (( cuda_flag == 1 )); then + RAPIDS_ARTIFACT_NAME_ARGS+=("--cuda" "$RAPIDS_CUDA_VERSION") +fi + +pkg_name="$(rapids-artifact-name "${RAPIDS_ARTIFACT_NAME_ARGS[@]}")" + +# if RAPIDS_BUILD_WORKFLOW_NAME is set, use that instead of any RAPIDS conventions +if [[ -n "${RAPIDS_BUILD_WORKFLOW_NAME:-}" ]]; then + workflow_that_produced_artifacts="${RAPIDS_BUILD_WORKFLOW_NAME}" +else + # otherwise, rely on the RAPIDS workflow name conventions + workflow_that_produced_artifacts="pr.yaml" +fi + +# get run ID +# NOTE: cannot reuse rapids-github-run-id here, because the environment variable +# GITHUB_RUN_ID will refer to the run this is being called from, not +# the run that generated the artifact we're looking for. +# +# For example, if this is called on a 'cudf' PR to download 'rmm' artifacts, +# here we want a run ID from an 'rmm' CI run, not the current 'cudf' one. +github_run_id=$( + RAPIDS_RETRY_SLEEP=120 \ + rapids-retry --quiet gh run list \ + --repo "${repo}" \ + --branch "pull-request/${pr}" \ + --commit "${commit}" \ + --workflow "${workflow_that_produced_artifacts}" \ + --json 'createdAt,databaseId' \ + --jq 'sort_by(.createdAt) | reverse | .[0] | .databaseId' +) + +# Passing an empty string to `gh run download` results in it searching all runs from all times... which could be +# thousands of results and result in exceeding GitHub rate limits. Prevent that. +if [[ -z "${github_run_id:-}" ]]; then + rapids-echo-stderr "ERROR: failed to find a GitHub Actions run for [repo=${repo}, workflow=${workflow_that_produced_artifacts}, branch=pull-request/${pr}, commit=${commit}]." + exit 1 +fi + +unzip_dest="${RAPIDS_UNZIP_DIR:-$(mktemp -d)}" + +rapids-echo-stderr "Downloading and decompressing ${pkg_name} from Run ID ${github_run_id} into ${unzip_dest}" +rapids-retry gh run download \ + "${github_run_id}" \ + --repo "${repo}" \ + --name "${pkg_name}" \ + --dir "${unzip_dest}" + +echo -n "${unzip_dest}" diff --git a/ci/use_conda_packages_from_prs.sh b/ci/use_conda_packages_from_prs.sh index fb807e8a02..f63759b756 100755 --- a/ci/use_conda_packages_from_prs.sh +++ b/ci/use_conda_packages_from_prs.sh @@ -3,8 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 # download CI artifacts -LIBRAFT_CHANNEL=$(rapids-get-pr-artifact raft 3052 cpp conda) -RAFT_CHANNEL=$(rapids-get-pr-artifact raft 3052 python conda --stable) +LIBRAFT_CHANNEL=$(./ci/rapids-get-pr-artifact raft 3052 cpp conda --cuda --pkg_name libraft) +RAFT_CHANNEL=$(./ci/rapids-get-pr-artifact raft 3052 python conda --stable --cuda) # For `rattler` builds: # diff --git a/ci/use_wheels_from_prs.sh b/ci/use_wheels_from_prs.sh index 840fe28127..793bb9468d 100755 --- a/ci/use_wheels_from_prs.sh +++ b/ci/use_wheels_from_prs.sh @@ -9,13 +9,13 @@ RAPIDS_PY_CUDA_SUFFIX=$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}") # download wheels, store the directories holding them in variables LIBRAFT_WHEELHOUSE=$( - RAPIDS_PY_WHEEL_NAME="libraft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-get-pr-artifact raft 3052 cpp wheel + ./ci/rapids-get-pr-artifact raft 3052 cpp wheel --cuda --pkg_name libraft ) -RAFT_WHEELHOUSE=$( - RAPIDS_PY_WHEEL_NAME="pylibraft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-get-pr-artifact raft 3052 python wheel +PYLIBRAFT_WHEELHOUSE=$( + ./ci/rapids-get-pr-artifact raft 3052 python wheel --stable --cuda --pkg_name pylibraft ) # write a pip constraints file saying e.g. "whenever you encounter a requirement for 'librmm-cu12', use this wheel" cat > "${PIP_CONSTRAINT}" < Date: Thu, 11 Jun 2026 16:04:42 -0400 Subject: [PATCH 4/7] refactor: remove vendored `rapids-get-pr-artifact` and use new upstream version --- ci/rapids-get-pr-artifact | 156 ------------------------------ ci/use_conda_packages_from_prs.sh | 4 +- ci/use_wheels_from_prs.sh | 9 +- 3 files changed, 5 insertions(+), 164 deletions(-) delete mode 100755 ci/rapids-get-pr-artifact diff --git a/ci/rapids-get-pr-artifact b/ci/rapids-get-pr-artifact deleted file mode 100755 index ccba4f88cc..0000000000 --- a/ci/rapids-get-pr-artifact +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/bash -# Common functionality for downloading artifacts from GitHub PR builds -# -# Arguments: -# 1) repo name -# 2) PR number -# 3) "cpp" or "python", to get the artifact for the C++ or Python build, respectively -# 4) "wheel" or "conda", to get the wheel or conda package artifact, respectively -# 5) [optional] full commit hash, to get the artifact for a specific commit -# Flags: -# --stable: for wheel python packages that use stable ABI (abi3) -# --pure: for conda and wheel packages that are pure builds -# --cuda: for cuda-suffixed artifacts (uses `$RAPIDS_CUDA_VERSION`) -# --arch {ARCH}: arch to use if different from `$(arch)` -- or use 'any' for pure builds -# --pkg_name {package_name}: specify the package name to download if different from repo name (e.g. pylibraft) -# -# Additional environment variables recognized by 'rapids-get-pr-artifact': -# -# * RAPIDS_BUILD_WORKFLOW_NAME = Filename for the workflow that build the artifacts you're trying to fetch. -# Defaults to 'pr.yaml'. -# -set -euo pipefail - -# Parse flags -arch_flag=0 -stable_flag=0 -pure_flag=0 -cuda_flag=0 -pkg_name_arg="" -arch_arg="$(arch)" -positional_args=() - -while [[ $# -gt 0 ]]; do - case $1 in - --arch) - # shellcheck disable=SC2034 - arch_arg="$2" - # shellcheck disable=SC2034 - arch_flag=1 - shift - ;; - --stable) - stable_flag=1 - shift - ;; - --pure) - # shellcheck disable=SC2034 - pure_flag=1 - shift - ;; - --cuda) - cuda_flag=1 - shift - ;; - --pkg_name) - pkg_name_arg="$2" - shift 2 - ;; - -*) - echo "Unknown flag: $1" >&2 - exit 1 - ;; - *) - positional_args+=("$1") - shift - ;; - esac -done - -# Check for minimum required arguments -if [[ ${#positional_args[@]} -lt 4 ]]; then - echo "Must specify: REPO_NAME PR_NUMBER PACKAGE_TYPE PACKAGE_FORMAT [COMMIT]" >&2 - exit 1 -fi - -repo_name="${positional_args[0]}" -repo="rapidsai/${positional_args[0]}" -pr="${positional_args[1]}" -package_type="${positional_args[2]}" -package_format="${positional_args[3]}" -commit="${positional_args[4]:-}" - -# Validate --stable flag -if (( stable_flag == 1 )); then - if [[ "${package_type:-}" != "python" ]]; then - rapids-echo-stderr "Error: --stable flag is only compatible with package_type='python'" - rapids-echo-stderr "Got: package_format='${package_format}'" - exit 1 - fi -fi - -source rapids-prompt-local-github-auth - -# If commit is not provided, get the latest commit on the PR -if [[ -z "${commit:-}" ]]; then - commit=$(rapids-retry --quiet gh pr view "${pr}" --repo "${repo}" --json headRefOid --jq '.headRefOid') -fi - - -# Generate the artifact name - -PACKAGE_NAME="${pkg_name_arg:-${repo_name}}" \ -RAPIDS_ARTIFACT_NAME_ARGS=("${package_format}_${package_type}" "$PACKAGE_NAME" "${repo_name}") -if (( stable_flag == 1 )); then - RAPIDS_ARTIFACT_NAME_ARGS+=("--stable") -fi - -if (( cuda_flag == 1 )); then - RAPIDS_ARTIFACT_NAME_ARGS+=("--cuda" "$RAPIDS_CUDA_VERSION") -fi - -pkg_name="$(rapids-artifact-name "${RAPIDS_ARTIFACT_NAME_ARGS[@]}")" - -# if RAPIDS_BUILD_WORKFLOW_NAME is set, use that instead of any RAPIDS conventions -if [[ -n "${RAPIDS_BUILD_WORKFLOW_NAME:-}" ]]; then - workflow_that_produced_artifacts="${RAPIDS_BUILD_WORKFLOW_NAME}" -else - # otherwise, rely on the RAPIDS workflow name conventions - workflow_that_produced_artifacts="pr.yaml" -fi - -# get run ID -# NOTE: cannot reuse rapids-github-run-id here, because the environment variable -# GITHUB_RUN_ID will refer to the run this is being called from, not -# the run that generated the artifact we're looking for. -# -# For example, if this is called on a 'cudf' PR to download 'rmm' artifacts, -# here we want a run ID from an 'rmm' CI run, not the current 'cudf' one. -github_run_id=$( - RAPIDS_RETRY_SLEEP=120 \ - rapids-retry --quiet gh run list \ - --repo "${repo}" \ - --branch "pull-request/${pr}" \ - --commit "${commit}" \ - --workflow "${workflow_that_produced_artifacts}" \ - --json 'createdAt,databaseId' \ - --jq 'sort_by(.createdAt) | reverse | .[0] | .databaseId' -) - -# Passing an empty string to `gh run download` results in it searching all runs from all times... which could be -# thousands of results and result in exceeding GitHub rate limits. Prevent that. -if [[ -z "${github_run_id:-}" ]]; then - rapids-echo-stderr "ERROR: failed to find a GitHub Actions run for [repo=${repo}, workflow=${workflow_that_produced_artifacts}, branch=pull-request/${pr}, commit=${commit}]." - exit 1 -fi - -unzip_dest="${RAPIDS_UNZIP_DIR:-$(mktemp -d)}" - -rapids-echo-stderr "Downloading and decompressing ${pkg_name} from Run ID ${github_run_id} into ${unzip_dest}" -rapids-retry gh run download \ - "${github_run_id}" \ - --repo "${repo}" \ - --name "${pkg_name}" \ - --dir "${unzip_dest}" - -echo -n "${unzip_dest}" diff --git a/ci/use_conda_packages_from_prs.sh b/ci/use_conda_packages_from_prs.sh index f63759b756..a74879e48b 100755 --- a/ci/use_conda_packages_from_prs.sh +++ b/ci/use_conda_packages_from_prs.sh @@ -3,8 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 # download CI artifacts -LIBRAFT_CHANNEL=$(./ci/rapids-get-pr-artifact raft 3052 cpp conda --cuda --pkg_name libraft) -RAFT_CHANNEL=$(./ci/rapids-get-pr-artifact raft 3052 python conda --stable --cuda) +LIBRAFT_CHANNEL=$(rapids-get-pr-artifact raft 3052 cpp conda) +RAFT_CHANNEL=$(rapids-get-pr-artifact raft 3052 python conda) # For `rattler` builds: # diff --git a/ci/use_wheels_from_prs.sh b/ci/use_wheels_from_prs.sh index 793bb9468d..42ebec25bf 100755 --- a/ci/use_wheels_from_prs.sh +++ b/ci/use_wheels_from_prs.sh @@ -8,12 +8,9 @@ source rapids-init-pip RAPIDS_PY_CUDA_SUFFIX=$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}") # download wheels, store the directories holding them in variables -LIBRAFT_WHEELHOUSE=$( - ./ci/rapids-get-pr-artifact raft 3052 cpp wheel --cuda --pkg_name libraft -) -PYLIBRAFT_WHEELHOUSE=$( - ./ci/rapids-get-pr-artifact raft 3052 python wheel --stable --cuda --pkg_name pylibraft -) +LIBRAFT_WHEELHOUSE=$(rapids-get-pr-artifact raft 3052 cpp wheel) +PYLIBRAFT_WHEELHOUSE=$(rapids-get-pr-artifact raft 3052 python wheel --pkg_name pylibraft) + # write a pip constraints file saying e.g. "whenever you encounter a requirement for 'librmm-cu12', use this wheel" cat > "${PIP_CONSTRAINT}" < Date: Fri, 12 Jun 2026 11:20:05 -0400 Subject: [PATCH 5/7] empty commit From c7a162b1165753a8897bf58a8d3d08bd799f6af0 Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 24 Jun 2026 18:06:58 +0000 Subject: [PATCH 6/7] prepend channels correctly --- ci/build_go.sh | 5 +++-- ci/build_java.sh | 5 +++-- ci/build_rust.sh | 5 +++-- ci/test_cpp.sh | 5 +++-- ci/test_python.sh | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ci/build_go.sh b/ci/build_go.sh index ec89d35e80..9eb8421df8 100755 --- a/ci/build_go.sh +++ b/ci/build_go.sh @@ -13,15 +13,16 @@ rapids-logger "Create test conda environment" rapids-logger "Configuring conda strict channel priority" conda config --set channel_priority strict +source ./ci/use_conda_packages_from_prs.sh rapids-dependency-file-generator \ --output conda \ --file-key go \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml -source ./ci/use_conda_packages_from_prs.sh - rapids-mamba-retry env create --yes -f env.yaml -n go # seeing failures on activating the environment here on unbound locals diff --git a/ci/build_java.sh b/ci/build_java.sh index 34cf6cb501..ce32726e14 100755 --- a/ci/build_java.sh +++ b/ci/build_java.sh @@ -32,14 +32,15 @@ rapids-logger "Generate Java testing dependencies" ENV_YAML_DIR="$(mktemp -d)" +source ./ci/use_conda_packages_from_prs.sh rapids-dependency-file-generator \ --output conda \ --file-key java \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | tee "${ENV_YAML_DIR}/env.yaml" -source ./ci/use_conda_packages_from_prs.sh - rapids-mamba-retry env create --yes -f "${ENV_YAML_DIR}/env.yaml" -n java # Temporarily allow unbound variables for conda activation. diff --git a/ci/build_rust.sh b/ci/build_rust.sh index bfbd6cf871..f4cd79ceb0 100755 --- a/ci/build_rust.sh +++ b/ci/build_rust.sh @@ -13,15 +13,16 @@ rapids-logger "Create test conda environment" rapids-logger "Configuring conda strict channel priority" conda config --set channel_priority strict +source ./ci/use_conda_packages_from_prs.sh rapids-dependency-file-generator \ --output conda \ --file-key rust \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml -source ./ci/use_conda_packages_from_prs.sh - rapids-mamba-retry env create --yes -f env.yaml -n rust # seeing failures on activating the environment here on unbound locals diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index ea199f861e..83b3524eee 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -11,16 +11,17 @@ conda config --set channel_priority strict CPP_CHANNEL=$(rapids-download-from-github "$(rapids-artifact-name conda_cpp libcuvs cuvs --cuda "$RAPIDS_CUDA_VERSION")") +source ./ci/use_conda_packages_from_prs.sh rapids-logger "Generate C++ testing dependencies" rapids-dependency-file-generator \ --output conda \ --file-key test_cpp \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml -source ./ci/use_conda_packages_from_prs.sh - rapids-mamba-retry env create --yes -f env.yaml -n test # Temporarily allow unbound variables for conda activation. diff --git a/ci/test_python.sh b/ci/test_python.sh index 6830b34c94..d9c079390c 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -13,17 +13,18 @@ rapids-logger "Downloading artifacts from previous jobs" CPP_CHANNEL=$(rapids-download-from-github "$(rapids-artifact-name conda_cpp libcuvs cuvs --cuda "$RAPIDS_CUDA_VERSION")") PYTHON_CHANNEL=$(rapids-download-from-github "$(rapids-artifact-name conda_python cuvs cuvs --stable --cuda "$RAPIDS_CUDA_VERSION")") +source ./ci/use_conda_packages_from_prs.sh rapids-logger "Generate Python testing dependencies" rapids-dependency-file-generator \ --output conda \ --file-key test_python \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ --prepend-channel "${PYTHON_CHANNEL}" \ | tee env.yaml -source ./ci/use_conda_packages_from_prs.sh - rapids-mamba-retry env create --yes -f env.yaml -n test # Temporarily allow unbound variables for conda activation. From 3920c280c79ce2e52188ac4eae38bc45ffdb4eb4 Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 24 Jun 2026 19:49:00 +0000 Subject: [PATCH 7/7] fix style --- ci/build_go.sh | 4 ++-- ci/build_java.sh | 4 ++-- ci/build_rust.sh | 4 ++-- ci/test_cpp.sh | 4 ++-- ci/test_python.sh | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ci/build_go.sh b/ci/build_go.sh index 9eb8421df8..fdaf37e4e5 100755 --- a/ci/build_go.sh +++ b/ci/build_go.sh @@ -18,8 +18,8 @@ rapids-dependency-file-generator \ --output conda \ --file-key go \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \ - --prepend-channel "${LIBRAFT_CHANNEL}" \ - --prepend-channel "${RAFT_CHANNEL}" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml diff --git a/ci/build_java.sh b/ci/build_java.sh index ce32726e14..c75027e99b 100755 --- a/ci/build_java.sh +++ b/ci/build_java.sh @@ -36,8 +36,8 @@ source ./ci/use_conda_packages_from_prs.sh rapids-dependency-file-generator \ --output conda \ --file-key java \ - --prepend-channel "${LIBRAFT_CHANNEL}" \ - --prepend-channel "${RAFT_CHANNEL}" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" | tee "${ENV_YAML_DIR}/env.yaml" diff --git a/ci/build_rust.sh b/ci/build_rust.sh index f4cd79ceb0..3d0ff5714c 100755 --- a/ci/build_rust.sh +++ b/ci/build_rust.sh @@ -18,8 +18,8 @@ rapids-dependency-file-generator \ --output conda \ --file-key rust \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \ - --prepend-channel "${LIBRAFT_CHANNEL}" \ - --prepend-channel "${RAFT_CHANNEL}" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 83b3524eee..a48330b78a 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -17,8 +17,8 @@ rapids-dependency-file-generator \ --output conda \ --file-key test_cpp \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch)" \ - --prepend-channel "${LIBRAFT_CHANNEL}" \ - --prepend-channel "${RAFT_CHANNEL}" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ | tee env.yaml diff --git a/ci/test_python.sh b/ci/test_python.sh index d9c079390c..835a3837a8 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -19,8 +19,8 @@ rapids-dependency-file-generator \ --output conda \ --file-key test_python \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \ - --prepend-channel "${LIBRAFT_CHANNEL}" \ - --prepend-channel "${RAFT_CHANNEL}" \ + --prepend-channel "${LIBRAFT_CHANNEL}" \ + --prepend-channel "${RAFT_CHANNEL}" \ --prepend-channel "${CPP_CHANNEL}" \ --prepend-channel "${PYTHON_CHANNEL}" \ | tee env.yaml