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

cache-image input to enable/disable caching of binfmt image

Open crazy-max opened this issue 1 year ago • 1 comments

follow-up https://github.com/docker/actions-toolkit/pull/200 related to https://github.com/docker/setup-qemu-action/issues/110

Tested through ci workflow

first run

setup-qemu-action saves image to hosted tool cache: https://github.com/docker/setup-qemu-action/actions/runs/9775565828/job/26986231861#step:3:113

And post cache to upload to GitHub Cache store: https://github.com/docker/setup-qemu-action/actions/runs/9775565828/job/26986231861#step:7:3

image

second run

download image from cache and load it: https://github.com/docker/setup-qemu-action/actions/runs/9775565828/job/26986391188#step:3:105

image


See cache entries as well: https://github.com/docker/setup-qemu-action/actions/caches

crazy-max avatar Apr 12 '24 11:04 crazy-max

How does this cache get invalidated?

when image is downloaded from cache it first loads it to docker store: https://github.com/docker/setup-qemu-action/actions/runs/9775565828/job/26986391188#step:3:110

and to make sure it's up to date we are doing a new docker pull: https://github.com/docker/setup-qemu-action/actions/runs/9775565828/job/26986391188#step:3:113

if image is up to date then we got https://github.com/docker/setup-qemu-action/actions/runs/9775565828/job/26986391188#step:3:116

Status: Image is up to date for tonistiigi/binfmt:master

Otherwise hosted tool cache is evicted and new image is saved in place.

More info on actions-toolkit repo: https://github.com/docker/actions-toolkit/blob/c70efab546578fc88fb6528cd28de42705cda4be/src/docker/docker.ts#L108

crazy-max avatar Jul 03 '24 09:07 crazy-max