You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In coder/kaniko#25 we added support for multi-stage cache probing. While testing the implementation we noticed that sometimes an instruction (e.g. RUN systemctl enable ssh) doesn't change any files. This means the snapshotter won't create a tar archive and the cache layer won't be pushed to the remote registry.
This is problematic when running the cache probe as these instructions will not have a matching cache.
We also can't assume that a missing cache is OK because the hash of the instruction does not affect the next instruction (bug?). Essentially the instruction could be modified (RUN systemctl enable ssh => RUN systemctl disable ssh) and we'd still have a cache hit if we assumed a missing cache was OK.
Potential solutions to fix the problem:
Push empty cache layers for instructions with no-change
Allow md5(RUN systemctl enable ssh) to be part of the next instructions cache key
The text was updated successfully, but these errors were encountered:
mafredri
changed the title
Allow cache probing to work when instructions consist of layers where no files were changed
Allow cache probing to work when instructions (e.g. RUN) don't change any files
Aug 27, 2024
Related: #230
In coder/kaniko#25 we added support for multi-stage cache probing. While testing the implementation we noticed that sometimes an instruction (e.g.
RUN systemctl enable ssh
) doesn't change any files. This means the snapshotter won't create a tar archive and the cache layer won't be pushed to the remote registry.This is problematic when running the cache probe as these instructions will not have a matching cache.
We also can't assume that a missing cache is OK because the hash of the instruction does not affect the next instruction (bug?). Essentially the instruction could be modified (
RUN systemctl enable ssh
=>RUN systemctl disable ssh
) and we'd still have a cache hit if we assumed a missing cache was OK.Potential solutions to fix the problem:
md5(RUN systemctl enable ssh)
to be part of the next instructions cache keyThe text was updated successfully, but these errors were encountered: