moby / buildkit

concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
https://github.com/moby/moby/issues/34227
Apache License 2.0
8k stars 1.12k forks source link

Contributing a new generic remote cache backend which works using pre-signed URLs #5160

Open prajjwaldimri opened 1 month ago

prajjwaldimri commented 1 month ago

At WarpBuild, we provide an alternative to GitHub's Cache in our custom runners. Recently, some of our customers have requested support for a cache backend in buildkit, similar to GitHub Actions (GHA).

We initially explored the S3 backend, but it doesn't suit our needs as it lacks support for pre-signed URLs and requires access keys and secret keys, which we cannot inject into all of our runners. The GHA backend also poses challenges because, while it downloads using pre-signed URLs, uploads are managed through GitHub's backend servers.

Given the complexity of maintaining support for various cache backends from different services, we propose contributing a generic remote cache backend that uses pre-signed URLs for both downloading and uploading layers.

This backend would be straightforward, requiring only a remote URL and a token as input. The remote APIs would be responsible for generating pre-signed URLs for downloads and uploads. This approach can be supported by any storage type that offers pre-signed URL capabilities (e.g., S3, GCS, Azure Blob, R2, etc.).

The methods would be similar to those in the gha backend:

As this is a significant feature, we would like to seek your opinions before proceeding. Is this a feature that BuildKit would consider accepting? Additionally, could you provide guidance on how we should contribute such a feature?

Regards,
Prajjwal

guptaankit015 commented 1 month ago

+1.