Skip to content

reduce the impact of cache layer exports on build time #6575

@andrewnitu

Description

@andrewnitu

Description

Hello,

While doing some testing of buildkit using the registry cache backend, I observed that quite a bit of time is spent on exporting the cache to the registry. If doing a completely "cold" build, 30 out of 120seconds is spent on this.

  1. Currently the image push and the cache push seem to be sequential. I wonder if it makes sense to parallelize these to speed up build times (and also parallelize the cache layer push, but that's mentioned here allow exporting cache layers in parallel to the remote registry #6123)
  2. It could make sense for some use cases to return early with the digest once the image is pushed, and then either continue with the cache push in the background or allow the client to perform it separately (this second option was mentioned here Possible to export cache in a separate command? #1938). Of course this would change the semantics of the build command as the cache is no longer guaranteed to be already pushed at build completion, but I think it could make sense as an explicit option.

Pretty new to working with buildkit but that's just what observed so far. Would love to hear your thoughts :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions