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

coder/kaniko: support multi-stage builds with DoCacheProbe #230

Closed
johnstcn opened this issue Jun 11, 2024 · 1 comment · Fixed by #325
Closed

coder/kaniko: support multi-stage builds with DoCacheProbe #230

johnstcn opened this issue Jun 11, 2024 · 1 comment · Fixed by #325
Assignees

Comments

@johnstcn
Copy link
Member

johnstcn commented Jun 11, 2024

coder/kaniko#12 added support for performing a 'fake' build (e.g. ProbeCache)

However, this does not appear to work with multi-stage builds (coder/kaniko#12 (comment))

Add support for multi-stage builds. This will require changes to our Kaniko fork.

@mafredri
Copy link
Member

To support multi-stage cache probes, we'll need a way to deduce the hash of dependencies between stages when operating in cache probe-mode.

Some ideas off the top of my head:

  1. Use a tar reader/filesystem on the previous stage cache archive
    • Kaniko uses os and reads files directly, this will fail unless the previous stage has been extracted
    • Potentially slow, may require decompression and reading of the entire archive
    • Faster than normal extraction, small files are part of the tar stream and don't add overhead
  2. Allow cached stage to be extracted
    • Slow, potentially very little benefit in cache probing
  3. Modify cache archive/image to include metadata (i.e. file hashes of cross-stage dependencies)?
    • Probably doable, we can pre-compute cross-stage dependencies
    • Probably jank
  4. Through some magic, allow the stage archive/hash to represent the cache-ability of the directive

I'm open to better ideas here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants