-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
remotecache: allow exporting root cache records #4803
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Allow exporting layers of root sources, like base images to remote cache. Normally, this is not done as it is considered wasteful as pulling cache vs. pulling source image again does not have benefits. Skipping base images in cache has other side effects though, for example provenance of a cached build that is on top of previous base image does not list the layers for the LLB image step because that step did not run (because its children were fully cached) and the image step itself does not have a layer chain associated with it in the cache. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@@ -36,6 +36,7 @@ type Exporter interface { | |||
|
|||
type Config struct { | |||
Compression compression.Config | |||
WithRoots bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a godoc comment to explain the "roots"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local source exports roots by default to allow air-gapped builds
with local cache sources if they only match the base image and
no records on top of them.
I'm not sure I understand this case - does this happen particularly often?
@@ -75,13 +78,24 @@ func getConfig(attrs map[string]string) (*Config, error) { | |||
return nil, errors.Wrap(err, "failed to parse timeout for github actions cache") | |||
} | |||
} | |||
|
|||
rootfs := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rootfs := false | |
roots := false |
Not sure I understand. Are you asking if |
Allow exporting layers of root sources, like base images to
remote cache. Normally, this is not done as it is considered
wasteful as pulling cache vs. pulling source image again
does not have benefits.
Skipping base images in cache has other side effects though,
for example provenance of a cached build that is on top of
previous base image does not list the layers for the
LLB image step because that step did not run (because its
children were fully cached) and the image step itself
does not have a layer chain associated with it in the cache.
Local source exports roots by default to allow air-gapped builds
with local cache sources if they only match the base image and
no records on top of them. A future follow-up could be to consider
exporting roots by default all the time but marking them in a
special way so they can be skipped from loading.