Skip to content
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

add: utility script to upgrade docker-snap version #199

Merged
merged 6 commits into from
Jan 13, 2025

Conversation

locnnil
Copy link
Contributor

@locnnil locnnil commented Dec 14, 2024

  • It works by running it from the base root of the project:
./upgrade.sh

It generates the necessary changes on snap/snapcraft.yaml by fetching the latest version available for Moby
using the GitHub API.
And then, based on the Dockerfile for the latest version, it fetches the necessary tags for the other parts of docker-snap.
It also updates the comments with the new version for the Moby Engine.


PS: It has well known that the script generates some undesired changes like: It deletes the blank lines on the snap/snapcraft.yaml file, this is because of how yq behaves (since it serializes and deserializes the YAML file). And it's not something that I'm willing to fix on this script with this PR. The undesired changed can be removed by doing git restore snap/snapcraft.yaml -p and selecting the changes that you want to discard. Or also by doing git add -p and adding to the stage area only the changes that you want and discarding the other ones with git restore ..

- It works by running it from the base root of the project:
```
./.github/workflows/upgrade.sh
```
It generates the necessary changes on snap/snapcraft.yaml
by fetching the latest version available for Moby
using the GitHub api.
And then based on the Dockerfile for the latest version, it
fetches the necessary tags for the other parts of docker-snap.
It only changes the needed code and not the comments.

Signed-off-by: Lincoln Wallace <[email protected]>
Copy link
Member

@farshidtz farshidtz left a comment

Choose a reason for hiding this comment

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

Nice utility script. Not sure if this should under workflows, considering a workflow for this doesn't exist yet.

.github/workflows/upgrade.sh Outdated Show resolved Hide resolved
@locnnil locnnil requested review from farshidtz and removed request for farshidtz December 16, 2024 15:39
@locnnil locnnil requested a review from farshidtz December 16, 2024 16:23
upgrade.sh Outdated Show resolved Hide resolved
@locnnil locnnil requested a review from farshidtz December 16, 2024 17:04
 * helper to check if yq is present.
 * helper to check the need of update.
 * replace all occurencies of the old engine version
    for the new one in the comments.

Signed-off-by: Lincoln Wallace <[email protected]>
Copy link
Member

@farshidtz farshidtz left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks.
I noticed that this is not upgrading the Nvidia runtime parts. Would be useful to also upgrade nvidia-container-toolkit and libnvidia-container, but that needs to rely on a reference (major version number?) to avoid breaking changes.

@locnnil locnnil merged commit 71fd0c0 into canonical:main Jan 13, 2025
2 checks passed
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.

2 participants