Skip to content

Refactor build scripts to use RAPIDS_BRANCH and remove RAPIDS_VERSION#517

Merged
rapids-bot[bot] merged 6 commits intoNVIDIA:branch-25.12from
bdice:use-rapids-branch
Oct 21, 2025
Merged

Refactor build scripts to use RAPIDS_BRANCH and remove RAPIDS_VERSION#517
rapids-bot[bot] merged 6 commits intoNVIDIA:branch-25.12from
bdice:use-rapids-branch

Conversation

@bdice
Copy link
Copy Markdown
Contributor

@bdice bdice commented Oct 20, 2025

Description

This adopts some CMake and build changes from other RAPIDS repositories. Now that cuOpt uses the same release cadence as RAPIDS, we can simplify the builds and align various scripts more closely with the rest of RAPIDS.

Specifically, this adopts RAPIDS_BRANCH as the source for fetching rapids-cmake, and that will allow us to migrate cuOpt to the main branching strategy.

xref:

Checklist

  • I am familiar with the Contributing Guidelines.
  • Testing
    • New or existing tests cover these changes
    • Added tests
    • Created an issue to follow-up
    • NA
  • Documentation
    • The documentation is up to date with these changes
    • Added new documentation
    • NA

Summary by CodeRabbit

  • Chores
    • Unified version/branch handling across build, release, CI, and packaging so tooling derives and propagates versions consistently.
    • Standardized minor-version sourcing for dependencies to reduce mismatched requirements.
    • Aligned branch naming and fetch logic with repository conventions.
    • Removed an internal dependent-package version export from some CI steps for cleaner pipelines.

@bdice bdice requested review from a team as code owners October 20, 2025 21:01
@bdice bdice requested review from jakirkham and tmckayus and removed request for a team October 20, 2025 21:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 20, 2025

Walkthrough

Consolidates version/branch sources: adds RAPIDS_BRANCH content (branch-25.12), removes exported intermediate DEPENDENT_PACKAGE_VERSION, switches some reads from RAPIDS_VERSION to VERSION/RAPIDS_BRANCH, updates CMake defaults and config logic, and harmonizes many project/version references to RAPIDS_VERSION/minor_version.

Changes

Cohort / File(s) Change Summary
Branch File
RAPIDS_BRANCH
Added content line specifying branch identifier branch-25.12.
CI Build & Test Scripts
ci/build_cpp.sh, ci/build_python.sh, ci/build_docs.sh, ci/test_cpp_memcheck.sh, ci/test_notebooks.sh, ci/build_docs.sh
Removed assignment/export of DEPENDENT_PACKAGE_VERSION in ci/build_cpp.sh and ci/build_python.sh; renamed/exported CUOPT_VERSION_MAJOR_MINORRAPIDS_VERSION_MAJOR_MINOR in ci/build_docs.sh; replaced usages of CUOPT_VERSION with RAPIDS_VERSION and adjusted branch derivation in test scripts.
Release Script
ci/release/update-version.sh
Removed write to RAPIDS_VERSION; script now writes only VERSION (other update logic retained).
CMake Root & Config
cmake/RAPIDS.cmake, cmake/rapids_config.cmake
Simplified rapids-cmake requirement check; changed default tag from branch-${rapids-cmake-version} to release/${rapids-cmake-version}; switched version-file source from RAPIDS_VERSION to VERSION and added reading of RAPIDS_BRANCH; set defaults for rapids-cmake-version and rapids-cmake-branch; adjusted include ordering and error messages; minor GIT_TAG formatting tweaks.
C++ & Python Project Files
cpp/CMakeLists.txt, cpp/libmps_parser/CMakeLists.txt, cpp/doxygen/Doxyfile, python/cuopt/CMakeLists.txt, python/cuopt/cuopt/linear_programming/CMakeLists.txt, python/libcuopt/CMakeLists.txt
Replaced occurrences of CUOPT_VERSION with RAPIDS_VERSION for project VERSION and find_package calls; removed DEPENDENT_LIB_MAJOR/MINOR initialization in cpp/CMakeLists.txt; updated Doxygen PROJECT_NUMBER to use RAPIDS_VERSION_MAJOR_MINOR.
Thirdparty RAFT CMake
cpp/cmake/thirdparty/get_raft.cmake
RAFT min-version now derived from RAPIDS_VERSION_MAJOR/RAPIDS_VERSION_MINOR; removed branch-specific variable; renamed local source var to CPM_raft_SOURCE; switched pinned tag to use ${rapids-cmake-checkout-tag}.
Conda Recipes
conda/recipes/cuopt/recipe.yaml, conda/recipes/libcuopt/recipe.yaml
Replaced dep_minor_version with minor_version in contexts and dependency lines; removed an explanatory comment block in the cuopt recipe; aligned dependency references to minor_version.
GitHub Workflow
.github/workflows/nightly.yaml
Matrix switched from cuopt_version to cuopt_branch supplying branch-25.12; CUOPT_BRANCH sourced from matrix; removed inline branch derivation from version.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Release as update-version.sh
  participant VERSION as VERSION
  participant RAPIDSBR as RAPIDS_BRANCH
  Release->>VERSION: write NEXT_FULL_TAG
  Note right of Release: no longer writes to RAPIDS_VERSION
  Release->>RAPIDSBR: read (or validate) RAPIDS_BRANCH as branch input
Loading
sequenceDiagram
  autonumber
  participant CI as ci/build_*.sh
  participant OldVersion as ./RAPIDS_VERSION
  participant NewVersion as ./VERSION
  participant BranchFile as ./RAPIDS_BRANCH
  CI->>OldVersion: (previous) read & export DEPENDENT_PACKAGE_VERSION
  Note right of CI: export removed
  CI->>NewVersion: rely on `VERSION` for versioning
  CI->>BranchFile: read `RAPIDS_BRANCH` for branch identifier
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I found a branch named twenty-five dot twelve,
I hopped through files where versions delve.
One VERSION, one RAPIDS_BRANCH in sight,
I nudged the exports gently out of light.
Thump—build steps hum and branches align.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Refactor build scripts to use RAPIDS_BRANCH and remove RAPIDS_VERSION" is concise and directly related to the substantial changes throughout the codebase. The changes do introduce RAPIDS_BRANCH as a central source (visible in the new RAPIDS_BRANCH file and cmake/rapids_config.cmake modifications) and involve significant simplification of the version handling by removing the write operation to RAPIDS_VERSION while consolidating on RAPIDS_VERSION as the primary version source. While the title doesn't enumerate all changes (such as the replacement of CUOPT_VERSION with RAPIDS_VERSION throughout multiple CMake files), it accurately captures the high-level refactoring objective and represents the main architectural shift in how the build system manages versioning and branching information.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@bdice bdice added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Oct 20, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 052aea8 and 5374751.

📒 Files selected for processing (10)
  • RAPIDS_BRANCH (1 hunks)
  • ci/build_cpp.sh (0 hunks)
  • ci/build_python.sh (0 hunks)
  • ci/release/update-version.sh (0 hunks)
  • cmake/RAPIDS.cmake (3 hunks)
  • cmake/rapids_config.cmake (2 hunks)
  • conda/recipes/cuopt/recipe.yaml (2 hunks)
  • conda/recipes/libcuopt/recipe.yaml (4 hunks)
  • cpp/CMakeLists.txt (0 hunks)
  • cpp/cmake/thirdparty/get_raft.cmake (2 hunks)
💤 Files with no reviewable changes (4)
  • ci/build_cpp.sh
  • ci/build_python.sh
  • ci/release/update-version.sh
  • cpp/CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.1, 3.13, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.1, 3.13, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.1, 3.10, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.1, 3.11, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.1, 3.12, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.1, 3.10, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.1, 3.11, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.0.1, 3.12, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-sh-client / 13.0.1, 3.10, amd64, rockylinux8
  • GitHub Check: checks / check-style
🔇 Additional comments (11)
conda/recipes/cuopt/recipe.yaml (2)

5-6: ✓ Unified version context setup looks correct.

The introduction of minor_version derived directly from version (via RAPIDS_PACKAGE_VERSION) is clean and deterministic. The template formula (version | split("."))[:2] | join(".") correctly extracts major.minor components.


62-62: ✓ Dependency version pinning is consistent and intentional.

All RAPIDS ecosystem dependencies (cudf, cuvs, pylibraft, rmm, raft-dask, rapids-dask-dependency) are correctly pinned to minor_version, enabling coordinated minor-version releases while allowing patch-level flexibility. Internal packages (libcuopt, cuopt-mps-parser) use exact version pinning as appropriate.

Also applies to: 65-65, 73-73, 76-76, 83-83, 85-85, 86-86, 87-87

conda/recipes/libcuopt/recipe.yaml (3)

6-6: ✓ Context variable refactoring aligns with cuopt recipe.

The minor_version derivation in libcuopt/recipe.yaml mirrors the unified approach in cuopt/recipe.yaml, ensuring consistent version sourcing across both packages.


66-66: ✓ Dependency pinning consistent with cuopt recipe.

libraft-headers and librmm are correctly pinned to minor_version across build/host/run contexts. This matches the pinning strategy in the cuopt recipe.

Also applies to: 67-67, 150-150, 159-159


5-6: Verify consistency with broader CMake and build script changes in this PR.

These conda recipe changes introduce minor_version derived from RAPIDS_PACKAGE_VERSION. Per the PR objectives, corresponding CMake configuration and other build scripts should also be refactored to use unified version sources (RAPIDS_BRANCH and centralized version variables). Ensure the broader PR changes maintain consistency in how versions are sourced and derived across all build systems.

RAPIDS_BRANCH (1)

1-1: LGTM!

The branch identifier aligns with the target branch (branch-25.12) and integrates correctly with the new branch handling logic in cmake/rapids_config.cmake.

cmake/RAPIDS.cmake (2)

21-25: LGTM!

The relaxed condition now requires at least one of rapids-cmake-branch or rapids-cmake-version (instead of both), which properly supports the new defaulting logic introduced in cmake/rapids_config.cmake.


36-36: LGTM!

The default branch naming convention change from branch-${rapids-cmake-version} to release/${rapids-cmake-version} aligns with standard RAPIDS repository branching practices.

cmake/rapids_config.cmake (3)

28-35: LGTM!

The new RAPIDS_BRANCH file reading with proper error handling integrates well with the new branch-based versioning strategy.


37-43: LGTM!

The defaulting logic for rapids-cmake-version and rapids-cmake-branch provides sensible fallbacks and properly coordinates with the relaxed requirements in cmake/RAPIDS.cmake.


14-26: VERSION file verified—code change is valid.

The VERSION file exists at the repository root with the correct XX.XX.XX format (currently 25.12.00), matching the regex pattern used in the CMake code. The file path reference is correct, and version parsing will work as expected.

Comment thread cpp/cmake/thirdparty/get_raft.cmake Outdated
Comment thread cpp/cmake/thirdparty/get_raft.cmake Outdated
bdice and others added 4 commits October 20, 2025 16:19
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@bdice bdice requested a review from a team as a code owner October 20, 2025 22:01
@bdice bdice requested review from akifcorduk and kaatish and removed request for a team October 20, 2025 22:01
Copy link
Copy Markdown
Collaborator

@rgsl888prabhu rgsl888prabhu left a comment

Choose a reason for hiding this comment

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

Thank you @bdice with this PR, this change will benefit several users.

Copy link
Copy Markdown
Contributor

@akifcorduk akifcorduk left a comment

Choose a reason for hiding this comment

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

Approving cpp changes.


set(CUOPT_MIN_VERSION_raft "${DEPENDENT_LIB_MAJOR_VERSION}.${DEPENDENT_LIB_MINOR_VERSION}.00")
set(CUOPT_BRANCH_VERSION_raft "${DEPENDENT_LIB_MAJOR_VERSION}.${DEPENDENT_LIB_MINOR_VERSION}")
set(CUOPT_MIN_VERSION_raft "${RAPIDS_VERSION_MAJOR}.${RAPIDS_VERSION_MINOR}.00")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need _raft suffix now that we are fully consolidated with rapids branching?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Think we can directly use it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is structured the same way that cuML does it. I'd like to leave this alone. https://github.com/rapidsai/cuml/blob/d6fa8525533d56c0e8345712870b3117cf9bc581/cpp/cmake/thirdparty/get_raft.cmake#L17

However, I did find an additional fix that was needed, and I addressed that in 955c60f.

@bdice
Copy link
Copy Markdown
Contributor Author

bdice commented Oct 21, 2025

/merge

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/nightly.yaml (1)

25-25: Consider adding error handling for the gh api call.

If the gh api call fails (e.g., invalid branch or API issues), the workflow continues with an empty or undefined SHA. Consider adding error handling to fail fast or provide a meaningful error message.

  run: |
    export DATE=$(date +%F)
-   export SHA=$(gh api -q '.commit.sha' "repos/nvidia/cuopt/branches/${CUOPT_BRANCH}")
+   export SHA=$(gh api -q '.commit.sha' "repos/nvidia/cuopt/branches/${CUOPT_BRANCH}") || { echo "Failed to fetch SHA for branch ${CUOPT_BRANCH}"; exit 1; }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59cfba5 and 955c60f.

📒 Files selected for processing (2)
  • .github/workflows/nightly.yaml (1 hunks)
  • cpp/cmake/thirdparty/get_raft.cmake (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/cmake/thirdparty/get_raft.cmake
🔇 Additional comments (1)
.github/workflows/nightly.yaml (1)

16-16: LGTM! Clean alignment with branch-based workflow pattern.

The refactoring from version-based matrix input to branch-based (cuopt_branch: "branch-25.12") is well-executed. Variable scoping is correct, and the branch identifier is properly threaded through the workflow dispatch call. The existing comment (lines 27–28) clearly explains the distinction between workflow source (--ref) and target source code branch (branch input).

Also applies to: 22-35

@rapids-bot rapids-bot bot merged commit 43fddb3 into NVIDIA:branch-25.12 Oct 21, 2025
173 of 175 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants