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 custom tag for stages image, for build-kit only #160

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

KawtharAlakri
Copy link

This PR supposed to fix the issue #157 and allow custom tag naming for the stages/cache image for build kit.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
@whoan
Copy link
Owner

whoan commented Aug 11, 2024

Hi @KawtharAlakri. Thank you for your pull request.
I am not sure it solves much as latest was used only for the last stage and your change only allows you to change the tag of the latest stage. If you have an image which has N stages, the previous ones will keep on having the default value:

stage_image=$(_get_full_stages_image_name):$stage_number

Unless I am missing something, I think I am not going to merge this one.

@KawtharAlakri
Copy link
Author

Hi @whoan
I updated the code to add the custom name to the stages as well as fixing the your comments.

@KawtharAlakri KawtharAlakri requested a review from whoan August 21, 2024 09:43
@whoan
Copy link
Owner

whoan commented Aug 26, 2024

@KawtharAlakri I have no time to test this now as I am moving but please bear with me I will get to it soon

@@ -96,9 +96,13 @@ _get_stages_image_name() {
echo "${INPUT_STAGES_IMAGE_NAME:-${INPUT_IMAGE_NAME}-stages}"
}

_get_stages_image_tag() {
echo "${INPUT_STAGES_IMAGE_TAG:-latest}"
Copy link
Owner

Choose a reason for hiding this comment

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

this would make all stages to have tags like latest-1, latest-2, ... under legacy behavior (no buildkit) which I don't see it better than current behav.

@whoan
Copy link
Owner

whoan commented Aug 28, 2024

@KawtharAlakri Could you please clearly state what problem this new attribute is fixing? I tried to put some reasoning about original decision in #157

I am still not sure this is really useful. I can still change latest to something else if that's bothering for the unique cache image when Buildkit is used, but would like to know why current behavior is a problem first.

@KawtharAlakri
Copy link
Author

@whoan Thanks for clarifying your original decision reasoning. However, the issue I faced (and probably the one who created the issue) is that I wanted to use this action in a context where multiple images are being built and stored in the same repository, which requires different naming for their cache to not overlap. and that was the only issue that prevented me from using your action, so I thought it worths some contribution.

@whoan
Copy link
Owner

whoan commented Aug 29, 2024

@whoan Thanks for clarifying your original decision reasoning. However, the issue I faced (and probably the one who created the issue) is that I wanted to use this action in a context where multiple images are being built and stored in the same repository, which requires different naming for their cache to not overlap. and that was the only issue that prevented me from using your action, so I thought it worths some contribution.

I understand better now. Thanks.
Can't you fix that issue by using a different stages_image_name per build? in that way each build will have a different cache and will not overlap.

Update: Maybe I can use the same image name's tag for the cache?

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