Skip to content

Add tooling to bump container-toolkit version #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

elezar
Copy link
Member

@elezar elezar commented Jun 2, 2025

No description provided.

@elezar elezar self-assigned this Jun 2, 2025
@elezar elezar force-pushed the release-container-toolkit-v1.17.8 branch 2 times, most recently from 14bcbbc to 54acd99 Compare June 3, 2025 13:22
Copy link

github-actions bot commented Jun 3, 2025

Documentation preview

https://nvidia.github.io/cloud-native-docs/review/pr-185

The following `container-toolkit` containers are included:

- `nvcr.io/nvidia/k8s/container-toolkit:v1.17.8-ubi8`
- `nvcr.io/nvidia/k8s/container-toolkit:v1.17.8-ubuntu20.04` (also as `nvcr.io/nvidia/k8s/container-toolkit:v1.17.8`)

## NVIDIA Container Toolkit 1.17.7
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think its necessary to update the known issue section of 1.17.7 with a recommendation to upgrade to using 1.17.8 to avoid the bug? possibly unnecessary, since we already mention in the current note that the issue is fixed in the next patch release

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so. We also call out:

If you are impacted by this issue, its recommended that you continue to use Container Toolkit v1.17.6 and pin all dependencies to v1.17.6 until this issue is resolved in the next patch release.

Copy link
Collaborator

Choose a reason for hiding this comment

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

just to confirm, this script is to allow folks to update all the version information for a component without having to manually update the files?

Some notes, all the components have a version (old format) and version1 (new format) file. So we'd have to also update the version file for each component to use the new format, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that was the intent of this script. Note that I still don't see the purpose for having both version files present in the repo at a given time -- but maybe my understanding of the document generation is incomplete.

cdesiniotis
cdesiniotis previously approved these changes Jun 9, 2025
Copy link
Contributor

@cdesiniotis cdesiniotis left a comment

Choose a reason for hiding this comment

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

@a-mccarthy the overall content lgtm. Feel free to directly apply your suggestions / nits. I think we can proceed and merge this while @elezar is out.

Copy link
Member

@mikemckiernan mikemckiernan left a comment

Choose a reason for hiding this comment

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

Before doing it this way, please consider using source_subtitutions.

html_extra_path = ["versions1.json"]
html_extra_path = ["versions.json"]
Copy link
Member

Choose a reason for hiding this comment

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

There were two reasons for using versions1.json:

  • It avoided clobbering the older format that was used before NVIDIA Sphinx Theme. This way, if someone stumbled on an older version of the docs, the version menu would still work.
  • Naming the file versions1.json is a bit of a convention across docs projects at NVIDIA, kinda because we've nearly all migrated to using NVIDIA Sphinx Theme.

IMO, not worth changing and kind of worth it to keep as-is for continuity across projects.

Copy link
Member Author

Choose a reason for hiding this comment

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

Question: Are the docs not built from a specific commit? Meaning that as long as that specific commit has the "correct" version information then using versions.json should be fine?

@elezar elezar force-pushed the release-container-toolkit-v1.17.8 branch from f13a887 to 659e4c6 Compare June 11, 2025 14:29
@elezar elezar changed the title Release container toolkit v1.17.8 Add tooling to bump container-toolkit version Jun 11, 2025
@elezar elezar dismissed cdesiniotis’s stale review June 12, 2025 11:04

Change scope of PR.

@ArangoGutierrez ArangoGutierrez requested a review from Copilot June 27, 2025 11:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new shell script to bump the container-toolkit version while migrating file references from versions1.json to versions.json. Key changes include:

  • Adding a new script (scripts/bump-version.sh) to automate version bumps.
  • Updating repo.toml and README.md to reference versions.json.
  • Removing the outdated container-toolkit/versions1.json file.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/bump-version.sh New version bump script using yq and sed for updating version info
repo.toml Updated file paths to reference versions.json
container-toolkit/versions1.json Removed outdated version JSON file
container-toolkit/versions.json Introduced new version JSON schema with added fields
README.md Documentation updated to reflect changes in version file names

VERSIONS_JSON="$COMPONENT/versions.json"
if [[ -f "$VERSIONS_JSON" ]]; then
echo "Updating $VERSIONS_JSON..."
yq -p=json -o=json -i '. = [{"preferred": "true", "url": "../'"${NEW_VERSION}"'", "version": "'"${NEW_VERSION}"'"}] + [(.[0] | del(.preferred))] + .[1:]' "$VERSIONS_JSON"
Copy link
Preview

Copilot AI Jun 27, 2025

Choose a reason for hiding this comment

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

[nitpick] The complex inline yq command impacts readability and maintainability; consider refactoring parts into intermediate variables or adding inline comments to clarify its intent.

Suggested change
yq -p=json -o=json -i '. = [{"preferred": "true", "url": "../'"${NEW_VERSION}"'", "version": "'"${NEW_VERSION}"'"}] + [(.[0] | del(.preferred))] + .[1:]' "$VERSIONS_JSON"
echo "Preparing new version entry for $VERSIONS_JSON..."
NEW_VERSION_ENTRY='[{"preferred": "true", "url": "../'"${NEW_VERSION}"'", "version": "'"${NEW_VERSION}"'"}]'
REMOVE_PREFERRED='[(.[0] | del(.preferred))]'
REMAINING_ENTRIES='.[1:]'
# Update the versions.json file with the new version entry
yq -p=json -o=json -i ". = ${NEW_VERSION_ENTRY} + ${REMOVE_PREFERRED} + ${REMAINING_ENTRIES}" "$VERSIONS_JSON"

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants