Open edmorley opened 5 days ago
I presume this is related to:
This issue causes my CNB's integration test suite to take 9 minutes locally instead of 39 seconds.
It seems this issue has been known for some time (but unfortunately not documented in an easy to discover way) and that a solution here is currently blocked on upstream Docker API additions.
I think we should:
Thank you @edmorley for the analysis and suggested actions - I agree with what you've proposed here. Given that points 1-3 are low hanging fruit, I've marked this as a good first issue. If anyone is interested in taking it up, I'd be happy to guide.
Summary
When using the containerd image store (which is now the default for new installs for Docker for Desktop), along with an ephemeral builder image (ie: one where additional buildpacks have been added beyond the ones in the builder, or the group order has been overridden), there is a 20 second delay/hang before the "Analyzing" phase starts, plus image exporting takes 9 seconds instead of milliseconds. This occurs even if the build is forced to trusted mode using
--trust-extra-buildpacks
.Reproduction
Steps
Use containerd for pulling and storing images
is enabled.mkdir testcase && cd $_
touch Procfile
time pack build --builder heroku/builder:24 --pull-policy if-not-present --timestamps --verbose --buildpack heroku/procfile --trust-extra-buildpacks testcase
Current behavior
With containerd enabled:
With containerd disabled:
The majority of the delay occurs at these two places:
~20 second delay here:
~9 second delay when exporting the app image:
When containerd is disabled, the timings for the problematic sections shown above are instead:
~40ms delay (rather than 20 seconds):
~30ms delay when exporting the app image (rather than 9 seconds):
Full logs:
Expected behavior
pack build
duration is very similar regardless of whether containerd is enabled or not (eg is under 2 seconds for both).Environment
pack info
docker info