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

stage_executor,cache-to: attempt to push cache only when cacheKey is valid #4650

Merged
merged 1 commit into from
Mar 11, 2023

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented Mar 9, 2023

Buildah's layer caching does not generates cache key or uses a layer from store if RUN --mount is used to make sure that always freshly mounted content is used in the RUN instruction, in such case there is no use of even pushing the cache since it will be never used by buildah.

Make sure that stage executor attempts to push cache only if cacheKey is generated.

Closes: #4647

What type of PR is this?

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
/kind other

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

stage_executor,cache-to: attempt to push cache only when cacheKey is valid

Buildah's layer caching does not generates cache key or uses a layer
from store if `RUN --mount` is used to make sure that always freshly
mounted content is used in the `RUN` instruction, in such case there is
no use of even pushing the cache since it will be never used by buildah.

Make sure that stage executor attempts to push cache only if cacheKey is
generated.

Closes: containers#4647

Signed-off-by: Aditya R <arajan@redhat.com>
@flouthoc
Copy link
Collaborator Author

flouthoc commented Mar 9, 2023

@nalind @containers/buildah-maintainers PTAL

@rhatdan
Copy link
Member

rhatdan commented Mar 9, 2023

LGTM

@rhatdan
Copy link
Member

rhatdan commented Mar 9, 2023

@blue42u PTAL

@rhatdan
Copy link
Member

rhatdan commented Mar 10, 2023

@nalind @giuseppe @vrothberg @umohnani8 PTAL

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member

rhatdan commented Mar 11, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Mar 11, 2023
@rhatdan rhatdan merged commit bae9047 into containers:main Mar 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--cache-to fails on RUN --mount=type=cache,from
3 participants