moby / buildkit

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

Stuck in "exporting to GitHub Actions Cache / preparing build cache for export" using github actions cache #4628

Open brtancik opened 7 months ago

brtancik commented 7 months ago

Hi all! Currently, I'm encountering some issues while uploading the cache to GitHub Actions. I've been stuck for hours with the following problem:

48 exporting to GitHub Actions Cache

48 preparing build cache for export

I captured the following log from the buildkit container:

image

The "-------------------------- AFTER ALMOST 30 MINUTES --------------------------" was added by me.

Currently, I'm using the following version tags:

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

- name: Build and push with cache
  uses: docker/build-push-action@v5
  env:
    DOCKER_BUILDKIT: 1
  with:
    context: ${{ inputs.dockerContext }}
    push: ${{ inputs.dockerPush }}
    file: ${{ inputs.dockerfilePath }}
    tags: ${{ inputs.legacyMode == 'true' && steps.ids-legacy.outputs.tags || steps.ids-not-legacy.outputs.tags }}
    platforms: ${{ inputs.buildPlatform }}
    cache-from: type=gha
    cache-to: type=gha,mode=max
    build-args: ${{ inputs.dockerBuildArgs }}
    provenance: false

Has anyone else encountered this issue before?

Ty in advance!

hanikesn commented 3 months ago

Seeing a similar issue where buildkitd eats all the memory at the same step with a registry cache.

amitie10g commented 3 months ago

Happened to me too, job stuck until timeout. I needed to forcely cancel the workflow and start over. It successfuly pushes after some retries.