satackey / action-docker-layer-caching

[CAUTION] This repository is not actively maintained. / Enable Docker layer caching in your GitHub Actions workflow.
https://github.com/marketplace/actions/docker-layer-caching
MIT License
421 stars 55 forks source link

Increases pipeline times instead of decreasing it #305

Open simplenotezy opened 2 years ago

simplenotezy commented 2 years ago

Describe the bug Prior to adding layer caching build took ~2 minutes and 45 seconds.

After adding it, the build time takes 2 minutes and 23 seconds.

However, the actual step (satackey/action-docker-layer-caching@v0.0.11) that's added takes 2 minutes.

So all in all, this increases the overall build time, instead of decreasing it. Any ideas why?

simplenotezy commented 2 years ago

This could be due to the fact that I don't really understand the: https://github.com/satackey/action-docker-layer-caching#docker-build

What is the "post run"?

Is there a full example somewhere?

calteran commented 2 years ago

I'm seeing this too. It seems that over time this is adding more and more layers to the cache, which have to be downloaded and re-uploaded with every build. Cached items expire after 7 days of no use, but if you are frequently running actions, you never expire objects. Github is looking to add a way to manually expire the cache, but ideally that functionality would be built into this action directly.

isra00 commented 2 years ago

I disabled this action and my build went from 19 min to 8 min. The workflow file is not especially Docker intensive: build a multi-stage image for Development, run the tests, build the Prod image (which uses 80% of the Dev layers):

With Action Docker Layer Caching (19min 56sec): https://github.com/isra00/neo-transposer/actions/runs/3213724751 Without Action Docker Layer Caching (8min): https://github.com/isra00/neo-transposer/actions/runs/3214129406