Skip to content

GitHub Actions Cache - Docker Build #1345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ajithshah opened this issue Apr 1, 2025 · 27 comments
Closed

GitHub Actions Cache - Docker Build #1345

ajithshah opened this issue Apr 1, 2025 · 27 comments

Comments

@ajithshah
Copy link

ajithshah commented Apr 1, 2025

This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP

ERROR: 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

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
Reference
Check build summary support

      - name: Docker Build and Push
        uses: docker/build-push-action@v6
        with:
          context: .
          file: ${{ inputs.dockerfile }}
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          platforms: ${{ inputs.docker_image_platforms }}
          build-args: |
            IMAGE_TAG=${{ steps.meta.outputs.tags }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
          github-token: ${{ secrets.TOKEN_GITHUB }}
@andrewhharmon
Copy link

andrewhharmon commented Apr 1, 2025

is this indicating version 3.2.4 of actions/cache is being used and this indicates that it's deprecated?

Editing this out, as I linked to the action instead of the node library

@newman-dani
Copy link

newman-dani commented Apr 1, 2025

I was able to bypass the error by setting no-cache: true but it does increase an action execution time.

UPD.
Started to fail again

@patbernard
Copy link

patbernard commented Apr 1, 2025

is this indicating version 3.2.4 of actions/cache is being used and this indicates that it's deprecated?

If you look at the latest release for v6, it's pointing to 4.0.2 - which should be fine: https://github.com/docker/build-push-action/blob/v6.15.0/yarn.lock

Edit: @bradley-yoo-anrok good catch. The latest version of build-push-action is pinned to a deprecated version. I was under the impression that v4.* was okay from this notice: https://github.blog/changelog/2025-01-15-github-actions-ubuntu-20-runner-image-brownout-dates-and-other-breaking-changes/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down

But that scope is obviously larger than the original notice now.

@newman-dani
Copy link

@patbernard I do use 471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 and still getting it.

@bradley-yoo-anrok
Copy link

bradley-yoo-anrok commented Apr 1, 2025

I don't think 4.0.2 is fine. if you look at the original deprecation notice, 4.1.2 is deprecated.

I can't believe the github's own decomission notice contains examples of upgrades that doesn't work.

@andrewhharmon
Copy link

yes we tried v6 and still got it as well

@mmckane
Copy link

mmckane commented Apr 1, 2025

I also tried V6 and am seeing this happen

@andrewhharmon
Copy link

I think this is the package being used here. it says v4.0.0 should be good.

@mmckane
Copy link

mmckane commented Apr 1, 2025

if it helps I am using docker/setup-buildx-action@v3 as well

@trautonen
Copy link

I'm using the latest docker/setup-buildx-action@v3 which yarn.lock currently points to

"@actions/cache@npm:^4.0.2":
  version: 4.0.2
  resolution: "@actions/cache@npm:4.0.2"

and the builds are failing

@jpugliesi
Copy link

jpugliesi commented Apr 1, 2025

Buildkit v0.20+ recently upgraded GHA Cache support to v2: moby/buildkit#5683

But Github's deprecation notice shows version <4.0 will are being deprecated

@aarashy
Copy link

aarashy commented Apr 1, 2025

Anybody know if its possible to use runs-on instead? We like this cache way better

@johnfountainsomos
Copy link

Buildkit v0.20+ fixes this: moby/buildkit#5683

You can upgrade by updating the docker/setup-buildx-action that's commonly run before this build-push-action:

- uses: docker/setup-buildx-action@v3
  with:
    version: v0.20.0

this did not work for us. still the same failure

@jpugliesi
Copy link

jpugliesi commented Apr 1, 2025

Buildkit v0.20+ fixes this: moby/buildkit#5683
You can upgrade by updating the docker/setup-buildx-action that's commonly run before this build-push-action:

- uses: docker/setup-buildx-action@v3
  with:
    version: v0.20.0

this did not work for us. still the same failure

Indeed - v0.20 upgrades to cache API v2, while cache <v4.0 is being deprecated - updated my comment

@patbernard
Copy link

It looks like what we need is docker/actions-toolkit to cut a new release (the latest release is using 4.0.2). See: docker/actions-toolkit#643

Then docker/build-push-action can be updated to use the latest version of docker/actions-toolkit and we'll be on a supported version of actions/cache.

@andrewhharmon
Copy link

andrewhharmon commented Apr 1, 2025

perhaps not as 4.0.0 and higher of the node library should support this .

@patbernard
Copy link

I think that did the trick. I ran the changes on a fork, and it worked for me: https://github.com/patbernard/build-push-action/tree/patbernard/update-cache-action-version

E.g.

    - name: Build and push image
      uses: patbernard/build-push-action@patbernard/update-cache-action-version

@bradley-yoo-anrok
Copy link

bradley-yoo-anrok commented Apr 1, 2025

Are you sure it worked because the brownout just ended?

@patbernard
Copy link

patbernard commented Apr 1, 2025

Are you sure it worked because the brownout just ended?

I'm not sure now. 😢 I'll have to test again on April 8th if there's no other traction between now any then.

I did test just the bump from 0.56 -> 0.57 and that still had the issue. So the only other test I did that was after the brown-out ended was using main instead of 0.57 of the actions-toolkit.


Edit: Looking at this https://npmdiff.dev/%40actions%2Fcache/4.0.2/4.0.3/, I really doubt the 4.0.3 version fixes this. Feeling more confident it only worked because the brownout concluded.

@crazy-max
Copy link
Member

crazy-max commented Apr 1, 2025

Edit: Looking at this https://npmdiff.dev/%40actions%2Fcache/4.0.2/4.0.3/, I really doubt the 4.0.3 version fixes this. Feeling more confident it only worked because the brownout concluded.

I don't think 4.0.2 is fine. if you look at the original deprecation notice, 4.1.2 is deprecated.

actions/cache action should not be confused with the @actions/cache module. We are not using this library for type=gha cache backend but https://github.com/tonistiigi/go-actions-cache which supports the new cache service v2.

ERROR: 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

If you have this issue you're likely using BuildKit < 0.20.0 or Buildx < v0.21.0 that don't support cache service v2. This can happen on self-hosted runners so to make sure you're using the latest version of Buildx, either update your self-hosted runner or set version: latest in setup-buildx-action:

      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
        with:
          version: latest

Also it would be good if someone can give a link to the workflow run so we can take a look or full logs of the workflow.

@aleksey-perplexity
Copy link

I am using v0.20.2 of the buildkit, cached in our ECR:

    - name: Set up Docker Buildx # required for build cache
      id: buildx
      uses: docker/setup-buildx-action@v3
      with:
        driver-opts: image=[redacted].dkr.ecr.us-east-1.amazonaws.com/buildkit:v0.20.2
        install: true

This last step in my workflow is failing:

    - name: Build locally
      uses: docker/build-push-action@v6
      ...

Am I using the wrong version of something?

@crazy-max
Copy link
Member

Am I using the wrong version of something?

Check Buildx >= 0.21.0 as well: #1345 (comment)

@mbazalik
Copy link

mbazalik commented Apr 8, 2025

I can confirm, having same issue using buildx v0.22.0, buildkit v0.20.2, build-push-action v6 :(

@mbazalik
Copy link

mbazalik commented Apr 8, 2025

I stand corrected, was using buildx v0.20.0, trying now with v0.22.0

@mbazalik
Copy link

mbazalik commented Apr 8, 2025

with buildx v0.22.0 it works

@vovimayhem
Copy link

with buildx v0.22.0 it works

Worked for me as well. @crazy-max Maybe setting the docker/setup-buildx-action to use this BuildX version by default should work?

aevesdocker pushed a commit to docker/docs that referenced this issue Apr 9, 2025
## Description

Note about sunset of GitHub Cache service v1 on April 15th, 2025.

## Related issues or tickets

* https://gh.io/gha-cache-sunset
* docker/build-push-action#1345
* docker/setup-buildx-action#414
* moby/buildkit#5896
*
actions/runner-images#11766 (comment)

## Reviews

<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->

- [x] Technical review
- [x] Editorial review
- [ ] Product review

Signed-off-by: CrazyMax <[email protected]>
@crazy-max
Copy link
Member

Note about sunset of GHA cache service v1 added to our docs: https://docs.docker.com/build/ci/github-actions/cache/#github-cache

@docker docker locked as resolved and limited conversation to collaborators Apr 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests