-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Skip image tag info is lost #3636
Comments
@wwadge Thanks for filing the issue. We usually log what has been pushed here and mention whether something was skipped in this code snippet when building an image. Could you provide us with more information on what is missing at the moment? |
That log is good but not sufficient for my use case is different so let me describe it. We have a monorepo and we build images for each module inside it. Most of the modules remain untouched and using the feature in the existing code we can skip the build/tags of anything that hasn't changed. Now after the build process is complete we need to invoke other tooling (eg kubectl/skaffold, updates to jira, whatever) on only the images that have changed so we need to come up with some kind of list that says: these modules had new images pushed out so go ahead and release them while these other modules were unchanged so we can skip them. Therefore we need a way that at the end of the jib process we can ask either the build system (gradle for eg) or in a simpler way: traverse the filesystem for the jib json files that are being created to figure out which modules have changed. Something like having a field like imagePushed = true/false or a jib.imagepushed file created in each module |
I see, thanks for the context! To double check, would it be possible in the CI to determine if the digest of the image produced changed? Otherwise, Jib generates an jib-image.json file which includes the metadata of the image built as shown in (#2227) so adding a field there could be a possibility. Will leave this issue open if you'd like to explore this further or contribute. |
It would, but it would be inefficient since Jib is already doing that in the first place, i.e. it already has that info as part of it's execution. It also has the possibility of race conditions (= looks like it changed even though I haven't built it in this build). Will try to submit a MR for this |
That's valid, you're right that the check would have to be done twice. Adding the pushed image bit in a metadata file seems helpful in any case. Looking forward to it. |
PR here: #3641 |
Thanks for your contribution! |
Thanks again for your contribution @wwadge! |
#2360
In that issue, support was added to skip pushing tags of unchanged images, however that information of what was pushed isn't recorded making it difficult to follow up with external tooling.
It would be good to create a file or update the existing json output to mark if a new tag was pushed out.
The text was updated successfully, but these errors were encountered: