diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index bb497692bd..0f4be8b52a 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -23,6 +23,7 @@ mkdir -p "${RAPIDS_ARTIFACTS_DIR}" export RAPIDS_ARTIFACTS_DIR # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array +source ./ci/use_conda_packages_from_prs.sh source rapids-rattler-channel-string # --no-build-id allows for caching with `sccache` diff --git a/ci/build_go.sh b/ci/build_go.sh index 056f40b345..bcc3a14885 100755 --- a/ci/build_go.sh +++ b/ci/build_go.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -13,10 +13,13 @@ 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 diff --git a/ci/build_java.sh b/ci/build_java.sh index 2e363bb452..e7e3a15dc4 100755 --- a/ci/build_java.sh +++ b/ci/build_java.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -32,9 +32,12 @@ 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" diff --git a/ci/build_python.sh b/ci/build_python.sh index 6823cbbec5..fa9b2ca351 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -20,6 +20,7 @@ export RAPIDS_PACKAGE_VERSION=${version} echo "${version}" > VERSION # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array +source ./ci/use_conda_packages_from_prs.sh source rapids-rattler-channel-string rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS" diff --git a/ci/build_rust.sh b/ci/build_rust.sh index e9218a8adc..eddd2c1e85 100755 --- a/ci/build_rust.sh +++ b/ci/build_rust.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -13,10 +13,13 @@ 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 diff --git a/ci/build_wheel_cuvs.sh b/ci/build_wheel_cuvs.sh index 2acbab8a2d..df08610317 100755 --- a/ci/build_wheel_cuvs.sh +++ b/ci/build_wheel_cuvs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -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..4e9229e226 100755 --- a/ci/build_wheel_libcuvs.sh +++ b/ci/build_wheel_libcuvs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -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..4a7d9568d8 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -11,11 +11,14 @@ 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 diff --git a/ci/test_python.sh b/ci/test_python.sh index 77840ac28d..59b9a0e427 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -13,11 +13,14 @@ 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 diff --git a/ci/test_wheel_cuvs.sh b/ci/test_wheel_cuvs.sh index 36fefdf852..11413ad555 100755 --- a/ci/test_wheel_cuvs.sh +++ b/ci/test_wheel_cuvs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -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..278a993bae --- /dev/null +++ b/ci/use_conda_packages_from_prs.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# 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) + +# 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..ba9533ef56 --- /dev/null +++ b/ci/use_wheels_from_prs.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# 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-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}" <