Use docker Github actions to tag containers#48
Open
dpw13 wants to merge 1 commit intoprometheus:mainfrom
Open
Conversation
5f43011 to
686488d
Compare
Author
|
Fixed the repository setting, the default image name (now tracks the repository name), and only sets the |
SuperQ
reviewed
Nov 11, 2025
Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
686488d to
d2373ac
Compare
SuperQ
reviewed
Nov 11, 2025
| - name: Determine latest | ||
| id: update_latest | ||
| run: | | ||
| if [ ${{ startsWith(github.ref, 'refs/tags/v3.') }} ] |
Member
There was a problem hiding this comment.
These CI actions are used all over the Prometheus ecosystem. We have v0, v1, etc releases stil.
Maybe we should parameterize this, with something like: refs/tags/${{ inputs.latest_tag_prefix }},
Then set the default to just v, and then when we update Prometheus, we can specify v3.
Also, how does this avoid prerelease?
Member
|
This may still be a useful change, but we've fixed the immediate issue in #65 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes prometheus/prometheus#16238
Rewrite of #41
This PR changes promci to use
docker/metadata-actionto generate tags for the generated docker containers. We also get nice labels pulled from the Github project metadata for free. The PR also replaces calls tomake docker,make docker-publishandmake docker-manifestwithdocker/build-push-actionwhich will build the specified Dockerfile for all specified platforms and push them with the specified tags.Please note that I'm certainly not a Github actions expert and this is just my first attempt at implementing what I understand to be best practices for building and pushing docker images using GH actions. Please review carefully!
Of particular note: using
docker/build-push-actionmay not be strictly necessary. It is likely possible to modify the Makefile in the prometheus project to accept the set of tags produced bydocker/metadata-action. It seemed that using build-push-action was a better solution though as it requires less synchronization between the two repos and that restructuring the Makefile to consume a set of tags instead of just one was going to be more trouble than it's worth, as the Makefile target is only one or twodockercommands. Keeping the changes only in thepromcirepo seemed easier and simpler.If this change is accepted, the
prometheusrepo will need a follow-up PR to update the SHA of thepromciaction and will also need to specify thegithub_tokeninput when callingpublish_mainin addition topublish_release.I had quite a bit of difficulty testing this change locally. I was able to locally verify the tags and labels generated by
metadata-actionwhen called with apushaction torefs/tags/v3.5.0usingact:I was not able to successfully test actually building and pushing the docker image though, as I wasn't able to get the full CI build and test system running without error locally. I would love some advice on how to properly test these changes using the full CI pipeline, if possible.