cache backend for GitHub Actions · Issue #1947 · moby/buildkit (original) (raw)

Currently, a common method to reuse build cache in Github actions is to use cache action together with local cache exporter/importer.

This is inefficient as full cache needs to be saved/loaded every time, and tracking does not happen per blob. Also, weirdnesses like double compression happen because systems do not know about each other.

There is also currently a problem in local exporter where the cache is appended; meaning the directory keeps growing unless it is manually replaced. This should be fixed separately.

We can attempt to write a special cache backend for Github actions case where layer blobs are written to the cache service similar way as they are currently written to the registry on remote cache.

I started writing Go library that allows writing and loading blobs from the cache service. https://github.com/tonistiigi/go-actions-cache There are no docs afaics, so it is reversed engineered from typescript implementation.

Problems/Open topics:

@crazy-max