Skip to content

[DO NOT MERGE] Test RAFT 3052#2227

Open
divyegala wants to merge 6 commits into
rapidsai:mainfrom
divyegala:test-raft-3052
Open

[DO NOT MERGE] Test RAFT 3052#2227
divyegala wants to merge 6 commits into
rapidsai:mainfrom
divyegala:test-raft-3052

Conversation

@divyegala

Copy link
Copy Markdown
Member

No description provided.

@divyegala divyegala added the breaking Introduces a breaking change label Jun 9, 2026
@divyegala divyegala requested a review from a team as a code owner June 9, 2026 20:43
@divyegala divyegala added the improvement Improves an existing functionality label Jun 9, 2026
@divyegala divyegala requested a review from gforsyth June 9, 2026 20:43
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a111cddb-dd43-4b6e-8cbb-ed6f4bec841b

📥 Commits

Reviewing files that changed from the base of the PR and between 5e60915 and 4d80d4a.

📒 Files selected for processing (2)
  • ci/use_conda_packages_from_prs.sh
  • ci/use_wheels_from_prs.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • ci/use_wheels_from_prs.sh
  • ci/use_conda_packages_from_prs.sh

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated CI/CD infrastructure to integrate pull request artifacts. Build scripts for C++ (CMake), Go, Java, Python, and Rust, along with wheel packaging and test scripts, now automatically source pre-built conda packages and wheels from PR artifacts. This enables consistent dependency resolution and artifact reuse throughout the build, package, and testing pipeline.

Walkthrough

This PR integrates two new CI helper scripts that fetch PR-built conda channels and wheels, then sources them across multiple build and test workflows to use the downloaded artifacts during environment initialization and dependency resolution.

Changes

PR artifact sourcing for CI workflows

Layer / File(s) Summary
Helper scripts for PR artifact sourcing
ci/use_conda_packages_from_prs.sh, ci/use_wheels_from_prs.sh
New conda helper downloads PR artifact channel strings, exports them, and prepends them to system conda config. New wheels helper initializes pip, derives CUDA suffix, downloads libraft/pylibraft wheels from raft 3052, and generates PIP constraint mappings to local wheel URLs.
Conda package integration in build workflows
ci/build_cpp.sh, ci/build_python.sh, ci/build_go.sh, ci/build_java.sh, ci/build_rust.sh
Build scripts for C++, Go, Java, Python, and Rust now source the conda helper before env generation/creation so rattler-build and mamba steps consume PR-provided conda channels.
Conda package integration in test workflows
ci/test_cpp.sh, ci/test_python.sh
Test scripts source the conda helper after generating env.yaml and before creating the conda environment so test runs use PR-provided packages.
Wheel artifact integration in build workflows
ci/build_wheel_cuvs.sh, ci/build_wheel_libcuvs.sh
Wheel build scripts source the wheel helper after pip initialization and before requirement generation so subsequent dependency installs use PR-provided libraft and pylibraft wheels.
Wheel artifact integration in test workflows
ci/test_wheel_cuvs.sh
Test script sources the wheel helper after removing system libnccl libraries and before wheel installs and pytest so tests run with PR-provided wheels.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Possibly related PRs

  • rapidsai/cuvs#2136: Both PRs modify the same CI build/test scripts' dependency acquisition paths—this PR injects sourced helpers that pull and prepend PR-built conda channels and wheel constraints, while the retrieved PR refactors how those channels and wheels are constructed and downloaded using rapids-artifact-name.

Suggested labels

non-breaking

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive Title references RAFT 3052 which aligns with the PR's objective to test integration with RAFT PR 3052, but is too vague and uses placeholder 'test' without describing the actual changes. Clarify the title to describe the specific changes, such as 'Add PR artifact sourcing to build and test scripts' or similar. Remove '[DO NOT MERGE]' or convert to a draft if not meant for merging.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a pull request description explaining the purpose of sourcing conda and wheel artifacts from RAFT PR 3052, and what integration testing this enables.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 8

🧹 Nitpick comments (4)
ci/use_wheels_from_prs.sh (1)

1-4: ⚡ Quick win

Add bash strict mode for safer error handling.

The script lacks bash strict mode flags (set -e, set -u, set -o pipefail), which would catch unhandled errors, undefined variables, and pipeline failures automatically. This is a best practice for CI scripts to prevent silent failures.

♻️ Proposed addition of strict mode
 #!/bin/bash
 # SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
 # SPDX-License-Identifier: Apache-2.0
 
+set -euo pipefail
+
 # initialize PIP_CONSTRAINT
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/use_wheels_from_prs.sh` around lines 1 - 4, Add bash "strict mode" to the
top of the script: after the existing shebang in ci/use_wheels_from_prs.sh
enable safe failure handling by adding set -euo pipefail (or equivalent flags)
so the script exits on errors, treats unset variables as errors, and fails
pipelines on first failed command; place this immediately after the #! /bin/bash
line so functions and commands like those in this script run under strict mode.
ci/use_conda_packages_from_prs.sh (1)

1-4: ⚡ Quick win

Add bash strict mode for safer error handling.

The script lacks bash strict mode flags (set -e, set -u, set -o pipefail), which would catch unhandled errors, undefined variables, and pipeline failures automatically. This is a best practice for CI scripts to prevent silent failures.

♻️ Proposed addition of strict mode
 #!/bin/bash
 # SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
 # SPDX-License-Identifier: Apache-2.0
 
+set -euo pipefail
+
 # download CI artifacts
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/use_conda_packages_from_prs.sh` around lines 1 - 4, The script currently
lacks bash strict mode — add strict-mode flags immediately after the shebang in
ci/use_conda_packages_from_prs.sh (i.e., enable errexit, nounset, and pipefail)
to stop on errors, catch undefined variables, and fail on pipeline errors;
update any affected functions or code paths (e.g., any logic in the script that
assumes unset variables or non-failing pipelines) to handle those cases
explicitly so the new strict mode (set -euo pipefail) doesn’t break expected
behavior.
ci/test_wheel_cuvs.sh (2)

32-32: ⚡ Quick win

Add GPU availability check before running tests.

The script runs pytest without verifying GPU availability. As per coding guidelines, CI test scripts should check GPU availability before executing tests to provide meaningful error messages and avoid unclear failures.

Consider adding a GPU check before line 32:

# Verify GPU availability before tests
if ! nvidia-smi > /dev/null 2>&1; then
  echo "Error: No GPU detected. Tests require GPU availability."
  exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/test_wheel_cuvs.sh` at line 32, Add a GPU availability check before the
pytest invocation in ci/test_wheel_cuvs.sh so tests don't run when no GPU is
present: call nvidia-smi (or similar GPU probe) and if it fails, print a clear
error like "Error: No GPU detected. Tests require GPU availability." and exit
with non‑zero status; place this check immediately before the pytest line that
runs "python -m pytest ./python/cuvs/cuvs/tests" so the script aborts early when
GPU is unavailable.

Source: Coding guidelines


12-18: ${PIP_CONSTRAINT} won’t lose PR wheel constraints from rapids-generate-pip-constraints [minor note]

ci/use_wheels_from_prs.sh creates PR artifact constraints via cat > "${PIP_CONSTRAINT}", and rapids-generate-pip-constraints appends to the file (uses tee -a), so the call at ci/test_wheel_cuvs.sh:18 won’t overwrite the PR constraints.
Optional: ci/use_wheels_from_prs.sh still clobbers any pre-existing ${PIP_CONSTRAINT} content (from rapids-init-pip)—use >> instead of cat > if preserving base constraints is desired.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/test_wheel_cuvs.sh` around lines 12 - 18, The PR artifact constraints
written in ci/use_wheels_from_prs.sh use a destructive redirect (cat >
"${PIP_CONSTRAINT}") which clobbers any existing base constraints, and since
rapids-generate-pip-constraints (called in ci/test_wheel_cuvs.sh) appends with
tee -a the current sequence will not overwrite PR constraints; update
ci/use_wheels_from_prs.sh to append (use >> "${PIP_CONSTRAINT}" instead of >)
when writing PR wheel constraints so pre-existing constraints from
rapids-init-pip are preserved, or alternatively change the write to be
conditional/merge-aware if overwriting is truly required.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/build_cpp.sh`:
- Around line 26-27: The RATTLER_CHANNELS computation happens before the helper
script is sourced, so PR-prepended channels from
ci/use_conda_packages_from_prs.sh are not applied; move the line sourcing that
helper (source ./ci/use_conda_packages_from_prs.sh) to occur before the rattler
channel computation (before the code that sets/uses RATTLER_CHANNELS and before
source rapids-rattler-channel-string) so the helper can modify environment
variables used by the rattler-build call.

In `@ci/build_python.sh`:
- Around line 23-24: Move the sourcing of the PR-channel helper so it runs
before sourcing rapids-rattler-channel-string: source
./ci/use_conda_packages_from_prs.sh must be executed prior to source
rapids-rattler-channel-string so that RATTLER_CHANNELS (and any arrays it relies
on) are populated before the script builds the channel string used by the
rattler-build commands; update the order in the script to source the helper
first, leaving the existing variable names and rattler-build invocations
unchanged.

In `@ci/use_conda_packages_from_prs.sh`:
- Around line 27-30: The loop that runs "conda config --system --add channels"
over _channel lacks error handling; ensure conda exists (check command -v conda
or similar) before the loop and after each "conda config --system --add channels
\"${_channel}\"" invocation test its exit status, and if it fails print a clear
error message that includes the failing _channel and the command output, then
exit with a non‑zero status; update the loop around the _channel variable and
the conda config command to perform these checks and fail fast on error.
- Around line 6-7: The assignments to LIBRAFT_CHANNEL and RAFT_CHANNEL using
rapids-get-pr-artifact lack error checking; after calling rapids-get-pr-artifact
(the commands that set LIBRAFT_CHANNEL and RAFT_CHANNEL) check the command exit
status and that the variables are non-empty/valid, and if either failed print a
clear CI error message including which artifact failed and the attempted command
(or returned value) and exit with a non-zero status so the job fails fast
instead of passing empty/invalid channel values into the conda channel list.

In `@ci/use_wheels_from_prs.sh`:
- Line 6: The script currently runs "source rapids-init-pip" with no checks so
failures or a missing script silently break later uses of PIP_CONSTRAINT; modify
the CI script to first verify the file exists and is readable (or test
sourcing), then attempt to source "rapids-init-pip" and immediately check that
PIP_CONSTRAINT is set (non-empty); if the file is missing or sourcing fails or
PIP_CONSTRAINT is empty, print a clear error message mentioning
"rapids-init-pip" and "PIP_CONSTRAINT" and exit with a non-zero status so
downstream steps do not proceed.
- Line 8: Check that RAPIDS_CUDA_VERSION is set before calling
rapids-wheel-ctk-name-gen and handle command failures: if RAPIDS_CUDA_VERSION is
empty, print a clear error and exit non-zero; when running
rapids-wheel-ctk-name-gen to assign RAPIDS_PY_CUDA_SUFFIX, capture its exit
status and on failure print the command's stderr (or a descriptive message
including the value of RAPIDS_CUDA_VERSION) and exit non-zero so downstream
wheel-name usages (the places that reference RAPIDS_PY_CUDA_SUFFIX) don't
proceed with an empty value.
- Around line 18-21: Before writing to PIP_CONSTRAINT ensure each wildcard
resolves to exactly one wheel: glob LIBRAFT_WHEELHOUSE/libraft_*.whl and
RAFT_WHEELHOUSE/pylibraft_*.whl, check the match count for each (use the
resolved filename variables, e.g., LIBRAFT_WHEEL and RAFT_WHEEL), and if a
pattern yields zero or multiple files emit a clear error and exit non‑zero; only
after validating assign the single matched paths and write the constraint lines
using those validated filenames (with file:// and absolute path) into
PIP_CONSTRAINT.
- Around line 11-16: The two assignments to LIBRAFT_WHEELHOUSE and
RAFT_WHEELHOUSE call rapids-get-pr-artifact without checking success; update the
script so each rapids-get-pr-artifact invocation is executed while capturing its
output and then validate success (check the command exit status and that the
resulting variable is non-empty/points to an existing wheel path). If a download
fails, print a clear error that includes which artifact (LIBRAFT_WHEELHOUSE or
RAFT_WHEELHOUSE) and the underlying command, and exit with a non-zero status.
Reference the exact variables LIBRAFT_WHEELHOUSE, RAFT_WHEELHOUSE and the
rapids-get-pr-artifact invocations when adding the checks and error messages.

---

Nitpick comments:
In `@ci/test_wheel_cuvs.sh`:
- Line 32: Add a GPU availability check before the pytest invocation in
ci/test_wheel_cuvs.sh so tests don't run when no GPU is present: call nvidia-smi
(or similar GPU probe) and if it fails, print a clear error like "Error: No GPU
detected. Tests require GPU availability." and exit with non‑zero status; place
this check immediately before the pytest line that runs "python -m pytest
./python/cuvs/cuvs/tests" so the script aborts early when GPU is unavailable.
- Around line 12-18: The PR artifact constraints written in
ci/use_wheels_from_prs.sh use a destructive redirect (cat > "${PIP_CONSTRAINT}")
which clobbers any existing base constraints, and since
rapids-generate-pip-constraints (called in ci/test_wheel_cuvs.sh) appends with
tee -a the current sequence will not overwrite PR constraints; update
ci/use_wheels_from_prs.sh to append (use >> "${PIP_CONSTRAINT}" instead of >)
when writing PR wheel constraints so pre-existing constraints from
rapids-init-pip are preserved, or alternatively change the write to be
conditional/merge-aware if overwriting is truly required.

In `@ci/use_conda_packages_from_prs.sh`:
- Around line 1-4: The script currently lacks bash strict mode — add strict-mode
flags immediately after the shebang in ci/use_conda_packages_from_prs.sh (i.e.,
enable errexit, nounset, and pipefail) to stop on errors, catch undefined
variables, and fail on pipeline errors; update any affected functions or code
paths (e.g., any logic in the script that assumes unset variables or non-failing
pipelines) to handle those cases explicitly so the new strict mode (set -euo
pipefail) doesn’t break expected behavior.

In `@ci/use_wheels_from_prs.sh`:
- Around line 1-4: Add bash "strict mode" to the top of the script: after the
existing shebang in ci/use_wheels_from_prs.sh enable safe failure handling by
adding set -euo pipefail (or equivalent flags) so the script exits on errors,
treats unset variables as errors, and fails pipelines on first failed command;
place this immediately after the #! /bin/bash line so functions and commands
like those in this script run under strict mode.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c1e834f9-ec25-4226-b143-c34fdd915024

📥 Commits

Reviewing files that changed from the base of the PR and between 78135be and 82f0668.

📒 Files selected for processing (12)
  • ci/build_cpp.sh
  • ci/build_go.sh
  • ci/build_java.sh
  • ci/build_python.sh
  • ci/build_rust.sh
  • ci/build_wheel_cuvs.sh
  • ci/build_wheel_libcuvs.sh
  • ci/test_cpp.sh
  • ci/test_python.sh
  • ci/test_wheel_cuvs.sh
  • ci/use_conda_packages_from_prs.sh
  • ci/use_wheels_from_prs.sh

Comment thread ci/build_cpp.sh Outdated
Comment thread ci/build_python.sh Outdated
Comment thread ci/use_conda_packages_from_prs.sh Outdated
Comment thread ci/use_conda_packages_from_prs.sh
Comment thread ci/use_wheels_from_prs.sh
Comment thread ci/use_wheels_from_prs.sh
Comment thread ci/use_wheels_from_prs.sh Outdated
Comment thread ci/use_wheels_from_prs.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/rapids-get-pr-artifact`:
- Around line 46-49: The script parses --pure/--arch into pure_flag/arch_flag
and arch_arg but never injects those into RAPIDS_ARTIFACT_NAME_ARGS before
invoking rapids-artifact-name, so artifact lookup can be wrong; update the
argument assembly logic (before the rapids-artifact-name call) to append
"--pure" when pure_flag is set and append "--arch" plus the value in arch_arg
when arch_flag is set, ensuring you preserve existing RAPIDS_ARTIFACT_NAME_ARGS
and proper quoting so rapids-artifact-name receives the flags.
- Around line 35-41: The --arch and --pkg_name parsing is brittle under set -euo
pipefail and the pure_flag/arch_flag are never used when composing
RAPIDS_ARTIFACT_NAME_ARGS; update the option parsing in
ci/rapids-get-pr-artifact so that (--arch) checks that "$2" exists and is not
another flag (error and exit if missing), assign arch_arg and set arch_flag,
then shift 2 (not shift) to consume the value; do the same validation for
(--pkg_name) assigning pkg_name_arg and shift 2; finally, when building
RAPIDS_ARTIFACT_NAME_ARGS, include logic that uses pure_flag and arch_flag
(e.g., append the appropriate --pure/--arch entries or incorporate
arch_arg/pkg_name_arg into the artifact name construction) so those options
actually affect the computed artifact name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2edbe9fa-e408-464a-8da1-bdb3762409a4

📥 Commits

Reviewing files that changed from the base of the PR and between a24a246 and 5e60915.

📒 Files selected for processing (3)
  • ci/rapids-get-pr-artifact
  • ci/use_conda_packages_from_prs.sh
  • ci/use_wheels_from_prs.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • ci/use_wheels_from_prs.sh
  • ci/use_conda_packages_from_prs.sh

Comment thread ci/rapids-get-pr-artifact Outdated
Comment thread ci/rapids-get-pr-artifact Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change improvement Improves an existing functionality

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants