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

Stack fix & create new volume cache for kaniko instead of re-using build cache #1789

Merged
merged 10 commits into from
Jun 21, 2023

Conversation

natalieparellano
Copy link
Member

This removes the unnecessary restriction that the build cache must be a volume cache in order to use extensions.

This removes the unnecessary restriction that the build cache must be a volume cache
in order to use extensions.

Signed-off-by: Natalie Arellano <[email protected]>
@natalieparellano natalieparellano requested review from a team as code owners May 30, 2023 21:55
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label May 30, 2023
@github-actions github-actions bot added this to the 0.30.0 milestone May 30, 2023
@natalieparellano natalieparellano mentioned this pull request May 30, 2023
5 tasks
Comment on lines +147 to +155
if c.Build.Format == CacheBind {
if resolvedPath, err = filepath.Abs(c.Build.Source); err != nil {
return errors.Wrap(err, "resolve absolute path")
}
c.Build.Source = filepath.Join(resolvedPath, "build-cache")
}
if c.Launch.Format == CacheBind {
if resolvedPath, err = filepath.Abs(c.Launch.Source); err != nil {
return errors.Wrap(err, "resolve absolute path")
Copy link
Member Author

Choose a reason for hiding this comment

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

Totally unrelated change... I can pull it out of this PR if desired. Looking through the code it seems the current implementation unnecessarily skips resolving the launch cache when the build cache is a bind.

@jjbustamante jjbustamante added type/bug Issue that reports an unexpected behaviour. and removed type/enhancement Issue that requests a new feature or improvement. labels Jun 7, 2023
@jjbustamante
Copy link
Member

@natalieparellano

I can see you have the following error message during the test execution:

ERROR: failed to read builder image: failed to create cache directory: mkdir /kaniko/cache: permission denied

I have something similar in my flattened fixes PR, do you have any thoughts on root cause for that?

@natalieparellano
Copy link
Member Author

Thanks for the review @jjbustamante! This looks to be an issue in the lifecycle - I put up buildpacks/lifecycle#1117

@natalieparellano
Copy link
Member Author

I've confirmed manually that lifecycle built from main together with the fix from #1795 should cause the test that's currently failing to go green; when lifecycle 0.17.0-rc.1 is out, we can update this PR to point to the lifecycle release candidate in DefaultLifecycleVersion

only add the stack arg to lifecycle for older platform APIs
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Jun 15, 2023
Signed-off-by: Natalie Arellano <[email protected]>
@github-actions github-actions bot added the type/chore Issue that requests non-user facing changes. label Jun 15, 2023
Signed-off-by: Natalie Arellano <[email protected]>
The fixture changed, so its SHA changed

Signed-off-by: Natalie Arellano <[email protected]>
@natalieparellano natalieparellano changed the title Create new volume cache for kaniko instead of re-using build cache Stack fix & create new volume cache for kaniko instead of re-using build cache Jun 16, 2023
…m api

Without this change, users would be required to upgrade their lifecycle to 0.17.0
when consuming pack 0.30.0 if using build image extension,
as the restorer would fail to write to the /kaniko directory.

Signed-off-by: Natalie Arellano <[email protected]>
Signed-off-by: Natalie Arellano <[email protected]>
@jkutner jkutner enabled auto-merge June 21, 2023 15:49
@jkutner jkutner merged commit 21b9a3a into main Jun 21, 2023
@jkutner jkutner deleted the fix/kaniko-cache branch June 21, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issue that reports an unexpected behaviour. type/chore Issue that requests non-user facing changes. type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants