-
Notifications
You must be signed in to change notification settings - Fork 7
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
Workflow to retag docker images with CalVer string #32
Conversation
More human readable Calendar Version (CalVer) tags for docker images published on the docker registry! When there is a new tag made on the git repo, this Continuous Integration workflow will pull down the built docker image, tag it with a string in YYYY.MM.DD format, and push things back to the docker registry. Modified from https://github.com/pangeo-data/pangeo-docker-images/blob/2022.12.01/.github/workflows/Publish.yml
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 two notes on things I copied from https://github.com/pangeo-data/pangeo-docker-images/blob/2e6d92f01e959ad2a5cc224e5090023dab81d828/.github/workflows/Publish.yml#L26-L43 that could probably be removed from this workflow, since the cryointhecloud docker image isn't as complex or big as pangeo-docker-images.
.github/workflows/retag.yml
Outdated
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
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.
Not sure if we actually need buildx here. Does the default GitHub Actions runner come with docker
installed?
Edit: Yes, docker
seems to be installed on the Ubuntu GitHub Actions runner, according to https://github.com/actions/runner-images/blob/ac8ae6b0eeeec50305bf54ffdf588d5bbe9fc145/images/linux/Ubuntu2204-Readme.md#tools
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | ||
- name: Free up disk space | ||
run: | | ||
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc | ||
df -h |
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.
This could probably be removed too, since the cryo-hub-image is only ~2GB in size. Not expecting it to become too big unless some machine learning libraries are added.
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 generally suggest keeping it, because when the disk does become full, it can throw weird errors. And the image size is calculated compressed, while it can definitely become bigger when on disk. And GitHub actions by default only has about 10-12GB of free space, so it can add up fast.
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.
Ok, I've added it back in 014714b. This step will take ~50 seconds to execute. GitHub Actions runners have 14GB of space according to https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources.
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.
Thanks, @weiji14!
The `cryo-hub-image` docker image is currently <2.0GB, so shouldn't be at the limits of GitHub Actions runner yet which is ~14GB.
We're not building any docker images, just pulling, retagging and pushing, so shouldn't need `docker-buildx`.
This reverts commit e35c33d.
.github/workflows/retag.yml
Outdated
|
||
- name: Retag Images | ||
run: | | ||
docker tag cryointhecloud/cryo-hub-image:${SHA12} quay.io/cryointhecloud/cryo-hub-image:latest |
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.
So we explicitly turn off the 'latest' tag here:
hub-image/.github/workflows/build.yaml
Line 43 in f254450
LATEST_TAG_OFF: true |
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.
Fair point. I've removed the retagging with 'latest' at f58fac1.
.github/workflows/retag.yml
Outdated
|
||
- name: Push Tags To Quay.io | ||
run: | | ||
docker push quay.io/cryointhecloud/cryo-hub-image:latest |
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.
Same here about 'latest'
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.
LGTM to merge after removing the 'latest' tag
Co-Authored-By: Yuvi Panda <[email protected]>
Thanks Yuvi for the review! I'll merge this in now 🚀 |
ty, @weiji14! |
More human readable Calendar Version (CalVer) tags for docker images published on the docker registry!
Steps to trigger this workflow:
2022.12.02
)retag.yml
which will:2022.12.02
GitHub Actions workflow adapted from https://github.com/pangeo-data/pangeo-docker-images/blob/2022.12.01/.github/workflows/Publish.yml
Motivated by #11 (comment) and #13 (comment).