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

Re-Add file check to cacheing algorithm #1925

Conversation

TomSweeneyRedHat
Copy link
Member

Add back the file checking mechanisms that were removed as part of the
reworking of the cache in #1792. If we have a 'COPY mytar.tar.xz' command
in the Containerfile and the tar file was regenerated after an intial build,
secondary 'buildah bud' commands would use the cache from the first build
for the tar file instead of regenerating it.

The historyMatches() function (https://github.com/containers/buildah/blob/master/imagebuildah/executor.go#L287)
does not seem to pick up this type of change and I wasn't able to quickly
rework that to do so. We may want to revert back to this check for now,
then tweak the historyMatches to work properly in a follow up PR.

Regardless, I've added a test as part of this PR to catch this issue
going forward.

FWIW, with the exception of the test code, all of the code is a reversion to pre-existing code.

Fixes: #1906

Signed-off-by: TomSweeneyRedHat [email protected]

@rhatdan
Copy link
Member

rhatdan commented Oct 16, 2019

@TomSweeneyRedHat Tests are not happy.

@TomSweeneyRedHat
Copy link
Member Author

Ugh, I swear I spend more time making the tests work in the CI than I do the actual code changes sometimes. This worked fine in my sandbox, but it looks like an environment variable resolution issue in the CI. I'll go hard code it, thanks for the heads up @rhatdan

@TomSweeneyRedHat
Copy link
Member Author

I take the variable bit back, it looks like a git hiccup, it's not seeing my new bud/change-archive directory. Gotta dig.

Add back the file checking mechanisms that were removed as part of the
reworking of the cache in containers#1792.  If we have a 'COPY mytar.tar.xz' command
in the Containerfile and the tar file was regenerated after an intial build,
secondary 'buildah bud' commands would use the cache from the first build
for the tar file instead of regenerating it.

The historyMatches() function (https://github.com/containers/buildah/blob/master/imagebuildah/executor.go#L287)
does not seem to pick up this type of change and I wasn't able to quickly
rework that to do so.  We may want to revert back to this check for now,
then tweak the historyMatches to work properly in a follow up PR.

Regardless, I've added a test as part of this PR to catch this issue
going forward.

Fixes:  containers#1906

Signed-off-by: TomSweeneyRedHat <[email protected]>
@TomSweeneyRedHat
Copy link
Member Author

OMG, second day in a row with a corrupted sandbox. Will have to spin up a new PR for this.

TomSweeneyRedHat added a commit to TomSweeneyRedHat/buildah that referenced this pull request Oct 16, 2019
Try 2 after I accidentally nuked my sandbox for containers#1925

Add back the file checking mechanisms that were removed as part of the
reworking of the cache in containers#1792.  If we have a 'COPY mytar.tar.xz' command
in the Containerfile and the tar file was regenerated after an intial build,
secondary 'buildah bud' commands would use the cache from the first build
for the tar file instead of regenerating it.

The historyMatches() function (https://github.com/containers/buildah/blob/master/imagebuildah/executor.go#L287)
does not seem to pick up this type of change and I wasn't able to quickly
rework that to do so.  We may want to revert back to this check for now,
then tweak the historyMatches to work properly in a follow up PR.

Regardless, I've added a test as part of this PR to catch this issue
going forward.

FWIW, with the exception of the test code, all of the code is a reversion to pre-existing code.

Fixes:  containers#1906

Signed-off-by: TomSweeneyRedHat <[email protected]>
@TomSweeneyRedHat TomSweeneyRedHat deleted the dev/tsweeney/cachetar3 branch August 14, 2020 19:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 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.

With Dockerfile ADD .tar.xz reuses cache even when files changed
2 participants