From 2f787e1284be39aa4683cbf6e8c4ec5dcb1693c6 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 9 Apr 2025 16:53:05 +0200 Subject: [PATCH] build: note about sunset of gha cache v1 (#22395) ## Description Note about sunset of GitHub Cache service v1 on April 15th, 2025. ## Related issues or tickets * https://gh.io/gha-cache-sunset * https://github.com/docker/build-push-action/issues/1345 * https://github.com/docker/setup-buildx-action/discussions/414 * https://github.com/moby/buildkit/issues/5896 * https://github.com/actions/runner-images/issues/11766#issuecomment-2779675129 ## Reviews - [x] Technical review - [x] Editorial review - [ ] Product review Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .../manuals/build/ci/github-actions/cache.md | 62 ++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/content/manuals/build/ci/github-actions/cache.md b/content/manuals/build/ci/github-actions/cache.md index f005c97cd5..5626447e1e 100644 --- a/content/manuals/build/ci/github-actions/cache.md +++ b/content/manuals/build/ci/github-actions/cache.md @@ -87,9 +87,9 @@ jobs: {{< summary-bar feature_name="Cache backend API" >}} The [GitHub Actions cache exporter](../../cache/backends/gha.md) -backend uses the [GitHub Cache API](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md) +backend uses the [GitHub Cache service API](https://github.com/tonistiigi/go-actions-cache) to fetch and upload cache blobs. That's why you should only use this cache -backend in a GitHub Action workflow, as the `url` (`$ACTIONS_CACHE_URL`) and +backend in a GitHub Action workflow, as the `url` (`$ACTIONS_RESULTS_URL`) and `token` (`$ACTIONS_RUNTIME_TOKEN`) attributes only get populated in a workflow context. @@ -121,6 +121,64 @@ jobs: cache-to: type=gha,mode=max ``` +> [!IMPORTANT] +> +> Starting [April 15th, 2025, only GitHub Cache service API v2 will be supported](https://gh.io/gha-cache-sunset). +> +> If you encounter the following error during your build: +> +> ```console +> ERROR: failed to solve: This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP. For more information: https://gh.io/gha-cache-sunset +> ``` +> +> You're probably using outdated tools that only support the legacy GitHub +> Cache service API v1. Here are the minimum versions you need to upgrade to +> depending on your use case: +> * Docker Buildx >= v0.21.0 +> * BuildKit >= v0.20.0 +> * Docker Compose >= v2.33.1 +> * Docker Engine >= v28.0.0 (if you're building using the Docker driver with containerd image store enabled) +> +> If you're building using the `docker/build-push-action` or `docker/bake-action` +> actions on GitHub hosted runners, Docker Buildx and BuildKit are already up +> to date but on self-hosted runners, you may need to update them yourself. +> Alternatively, you can use the `docker/setup-buildx-action` action to install +> the latest version of Docker Buildx: +> +> ```yaml +> - name: Set up Docker Buildx +> uses: docker/setup-buildx-action@v3 +> with: +> version: latest +> ``` +> +> If you're building using Docker Compose, you can use the +> `docker/setup-compose-action` action: +> +> ```yaml +> - name: Set up Docker Compose +> uses: docker/setup-compose-action@v1 +> with: +> version: latest +> ``` +> +> If you're building using the Docker Engine with the containerd image store +> enabled, you can use the `docker/setup-docker-action` action: +> +> ```yaml +> - +> name: Set up Docker +> uses: docker/setup-docker-action@v4 +> with: +> version: latest +> daemon-config: | +> { +> "features": { +> "containerd-snapshotter": true +> } +> } +> ``` + ### Cache mounts BuildKit doesn't preserve cache mounts in the GitHub Actions cache by default.