setup-buildx-action icon indicating copy to clipboard operation
setup-buildx-action copied to clipboard

Support to retain cache

Open ibalajiarun opened this issue 2 years ago • 9 comments

This PR adds support to keep the cache state when the builder is removed in the post-action step. For certain usecases such as CI builds, it is helpful to keep the cache and reuse it with re-created builders. For this purpose, there is a new keep-state optional actions flag that defaults to false.

To support cache reuse, this PR also allows specifying a custom name to the builder, since cache reuse is no possible with the exiting random names generated using uuid.v4(). For this purpose, there is a new name optional actions flag.

ibalajiarun avatar Feb 27 '23 18:02 ibalajiarun

Hey @crazy-max , can I get a review on this one?

ibalajiarun avatar Apr 17 '23 23:04 ibalajiarun

/cc @jedevc

ibalajiarun avatar Apr 18 '23 22:04 ibalajiarun

Thanks for the review @crazy-max. I've addressed your feedback.

We have been using this change at aptos-labs/aptos-core for over a month now with persistent self-hosted runners and have seen speed ups of up to 50% in build times.

https://github.com/aptos-labs/aptos-core/blob/751153f20f3068ed71cfe3d79ab9fe0212cc4107/.github/actions/docker-setup/action.yaml#L41-L58

ibalajiarun avatar Apr 19 '23 16:04 ibalajiarun

@crazy-max can we get this merged please?

ibalajiarun avatar May 31 '23 04:05 ibalajiarun

Any movement on this?

zpiazza-combocurve avatar Dec 27 '23 18:12 zpiazza-combocurve

just stumpled upon this, the --keep-state flag in docker buildx rm for self-hosted runners could speed up builds drastically.

what is needed to get any movement on this?

tobiaszuercher avatar Mar 26 '24 10:03 tobiaszuercher

@ibalajiarun @crazy-max can we take another look at this? Would be great to have.

rarecrumb avatar Jun 13 '24 20:06 rarecrumb

This PR might be the missing piece of my ultimate caching pipeline quest. Any chance it will be merged in the near future?

nelyodev avatar Jul 05 '24 15:07 nelyodev