Skip to content

Conversation

@rgsl888prabhu
Copy link
Collaborator

@rgsl888prabhu rgsl888prabhu commented Aug 11, 2025

Description

Merge update version which was earlier split was cuOpt and Rapids into one since we are in sync with versions now.
And also fix failure in version updates and bugs around it.

Issue

closes #262

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

@rgsl888prabhu rgsl888prabhu self-assigned this Aug 11, 2025
@rgsl888prabhu rgsl888prabhu requested a review from a team as a code owner August 11, 2025 16:54
@rgsl888prabhu rgsl888prabhu added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Aug 11, 2025
@anandhkb anandhkb added this to the 25.10 milestone Aug 11, 2025
@rgsl888prabhu
Copy link
Collaborator Author

@jameslamb may I get your review on this

Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Now that cuopt and RAPIDS will have aligned versions, there is a lot of opportunity for consolidating things in this new update-version.sh script. I left some specific examples I saw where things should be grouped into a smaller set of updates.

That'll make it run a little faster, reduce the risk of inconsistencies, and reduce the effort to maintain this.

Please also test this. Something like this:

./ci/release/update-version.sh '25.12.00'

# does the diff look like what you'd expect?
git diff

# did it catch everything?
git grep -E '24\.|25\.'

@rgsl888prabhu
Copy link
Collaborator Author

wanted to keep them separate in case if we need to be out of sync in future, but I think it can be done quite easily, will update PR as per your review

Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. I've left some more suggestions.

@rgsl888prabhu
Copy link
Collaborator Author

@jameslamb May I get your review on this ?

Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Approving this so you can keep moving forward. But if you haven't already, please do test it one more time, in the way I described in #286 (review)

I also think you should write up a follow-up issue about consolidating the references to versions in this project. I left a couple of suggestions, but overall there are very very many hard-coded 25.10 around the source code that all need to be kept in sync.

For inspiration, you could look at some of the PRs @KyleFromNVIDIA put up around RAPIDS implementing similar things to what I've suggested here: rapidsai/build-planning#15

# Server version update
sed_runner 's/'"\"version\": \"[0-9][0-9].[0-9][0-9]\""'/'"\"version\": \"${NEXT_SHORT_TAG}\""'/g' python/cuopt_server/cuopt_server/utils/data_definition.py
sed_runner 's/'"\"client_version\": \"[0-9][0-9].[0-9][0-9]\""'/'"\"client_version\": \"${NEXT_SHORT_TAG}\""'/g' python/cuopt_server/cuopt_server/utils/routing/data_definition.py
sed_runner 's/'"\"client_version\": \"[0-9][0-9].[0-9][0-9]\""'/'"\"client_version\": \"${NEXT_SHORT_TAG}\""'/g' python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be good to calculate this programmatically, in Python code instead.

e.g.

Should rely on this constant:

Same advice goes for all 3 of these lines.

sed_runner 's/'"\"client_version\": \"[0-9][0-9].[0-9][0-9]\""'/'"\"client_version\": \"${NEXT_SHORT_TAG}\""'/g' python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py

# Doc update
sed_runner 's/'"version = \"[0-9][0-9].[0-9][0-9]\""'/'"version = \"${NEXT_SHORT_TAG}\""'/g' docs/cuopt/source/conf.py
Copy link
Member

Choose a reason for hiding this comment

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


# Doc update
sed_runner 's/'"version = \"[0-9][0-9].[0-9][0-9]\""'/'"version = \"${NEXT_SHORT_TAG}\""'/g' docs/cuopt/source/conf.py
sed_runner 's/'"PROJECT_NUMBER = [0-9][0-9].[0-9][0-9]"'/'"PROJECT_NUMBER = ${NEXT_SHORT_TAG}"'/g' cpp/doxygen/Doxyfile
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines +92 to +104
# Update VERSIONS.json
VERSIONS_FILE="docs/cuopt/source/versions1.json"
# Only update if NEXT_FULL_TAG is not already present
if ! grep -q "\"version\": \"${NEXT_FULL_TAG}\"" "${VERSIONS_FILE}"; then
# Remove preferred and latest flags, but keep the version entry and URL
sed_runner '/"name": "latest",/d' "${VERSIONS_FILE}"
sed_runner '/"preferred": true,\?/d' "${VERSIONS_FILE}"
# Remove trailing comma after "url": ... in all version entries
sed_runner 's/\("url": "[^"]*"\),/\1/' "${VERSIONS_FILE}"
# Add new version entry with both preferred and latest flags
NEW_VERSION_ENTRY=' {\n "version": "'${NEXT_FULL_TAG}'",\n "url": "../'${NEXT_FULL_TAG}'/",\n "name": "latest",\n "preferred": true\n },'
sed_runner "/\[/a\\${NEW_VERSION_ENTRY}" "${VERSIONS_FILE}"
fi
Copy link
Member

Choose a reason for hiding this comment

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

I think you might find this easier to maintain if it was in Python.

I recommend looking into what I just did over in the docs repo:

I think you should have a small Python script that populates versions1.json, and a pre-commit hook that runs it.

And that script should read from ./VERSION at the root of the repo.

That'd simplify update-version.sh, and make it easier to keep that file up to date.

Comment on lines +106 to +109
# RTD update
sed_runner "/^set(cuopt_version/ s/[0-9][0-9].[0-9][0-9].[0-9][0-9]/${NEXT_FULL_TAG}/g" python/cuopt/CMakeLists.txt
sed_runner "/^set(cuopt_version/ s/[0-9][0-9].[0-9][0-9].[0-9][0-9]/${NEXT_FULL_TAG}/g" python/cuopt/cuopt/linear_programming/CMakeLists.txt
sed_runner "/^set(cuopt_version/ s/[0-9][0-9].[0-9][0-9].[0-9][0-9]/${NEXT_FULL_TAG}/g" python/libcuopt/CMakeLists.txt
Copy link
Member

Choose a reason for hiding this comment

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

It should be possible to derive all of these in CMake, at configure time, from other variables.

Re-using all of these variables:

if(_rapids_version MATCHES [[^([0-9][0-9])\.([0-9][0-9])\.([0-9][0-9])]])
set(RAPIDS_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(RAPIDS_VERSION_MINOR "${CMAKE_MATCH_2}")
set(RAPIDS_VERSION_PATCH "${CMAKE_MATCH_3}")
set(RAPIDS_VERSION_MAJOR_MINOR "${RAPIDS_VERSION_MAJOR}.${RAPIDS_VERSION_MINOR}")
set(RAPIDS_VERSION "${RAPIDS_VERSION_MAJOR}.${RAPIDS_VERSION_MINOR}.${RAPIDS_VERSION_PATCH}")
else()

done

# PYTHON for RAPIDS
sed_runner "/DOWNLOAD.*rapids-cmake/ s/branch-[0-9][0-9].[0-9][0-9]/branch-${NEXT_SHORT_TAG}/g" python/cuopt/CMakeLists.txt
Copy link
Member

Choose a reason for hiding this comment

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

This should be grouped with the other CMakeLists.txt updates further up.

And similar to my comment on those, I think it'd be better to move this logic into CMake code itself.

@rgsl888prabhu
Copy link
Collaborator Author

rgsl888prabhu commented Aug 20, 2025

Approving this so you can keep moving forward. But if you haven't already, please do test it one more time, in the way I described in #286 (review)

I also think you should write up a follow-up issue about consolidating the references to versions in this project. I left a couple of suggestions, but overall there are very very many hard-coded 25.10 around the source code that all need to be kept in sync.

For inspiration, you could look at some of the PRs @KyleFromNVIDIA put up around RAPIDS implementing similar things to what I've suggested here: rapidsai/build-planning#15

Yes, I had tested by applying new version, but will test again once I have added new suggestions, thank you for such a detailed review.

@rgsl888prabhu
Copy link
Collaborator Author

/merge

@rapids-bot rapids-bot bot merged commit f869719 into NVIDIA:branch-25.10 Aug 20, 2025
73 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.

[BUG] Update version script is not covering all the version format

4 participants