-
Notifications
You must be signed in to change notification settings - Fork 28
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
base: main
Are you sure you want to change the base?
Conversation
14bcbbc
to
54acd99
Compare
Documentation preview |
container-toolkit/release-notes.md
Outdated
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
scripts/bump-version.sh
Outdated
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
There was a problem hiding this 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"] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Signed-off-by: Evan Lezar <[email protected]>
Signed-off-by: Evan Lezar <[email protected]>
f13a887
to
659e4c6
Compare
There was a problem hiding this 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" |
There was a problem hiding this comment.
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.
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.
No description provided.