build-push-action icon indicating copy to clipboard operation
build-push-action copied to clipboard

GitHub Actions Cache - Docker Build

Open ajithshah opened this issue 1 year ago • 27 comments

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 }}

ajithshah avatar Apr 01 '25 16:04 ajithshah

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

andrewhharmon avatar Apr 01 '25 17:04 andrewhharmon

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

newman-dani avatar Apr 01 '25 17:04 newman-dani

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.

patbernard avatar Apr 01 '25 17:04 patbernard

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

newman-dani avatar Apr 01 '25 17:04 newman-dani

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.

bradley-yoo-anrok avatar Apr 01 '25 17:04 bradley-yoo-anrok

yes we tried v6 and still got it as well

andrewhharmon avatar Apr 01 '25 17:04 andrewhharmon

I also tried V6 and am seeing this happen

mmckane avatar Apr 01 '25 17:04 mmckane

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

andrewhharmon avatar Apr 01 '25 17:04 andrewhharmon

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

mmckane avatar Apr 01 '25 17:04 mmckane

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

trautonen avatar Apr 01 '25 17:04 trautonen

Buildkit v0.20+ recently upgraded GHA Cache support to v2: https://github.com/moby/buildkit/issues/5683

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

jpugliesi avatar Apr 01 '25 17:04 jpugliesi

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

aarashy avatar Apr 01 '25 17:04 aarashy

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

johnfountainsomos avatar Apr 01 '25 17:04 johnfountainsomos

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

jpugliesi avatar Apr 01 '25 17:04 jpugliesi

It looks like what we need is docker/actions-toolkit to cut a new release (the latest release is using 4.0.2). See: https://github.com/docker/actions-toolkit/issues/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.

patbernard avatar Apr 01 '25 18:04 patbernard

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

andrewhharmon avatar Apr 01 '25 18:04 andrewhharmon

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

patbernard avatar Apr 01 '25 19:04 patbernard

Are you sure it worked because the brownout just ended?

bradley-yoo-anrok avatar Apr 01 '25 19:04 bradley-yoo-anrok

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.

patbernard avatar Apr 01 '25 19:04 patbernard

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.

crazy-max avatar Apr 01 '25 20:04 crazy-max