Skip to content
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

Multi arch build / GHA cache #1311

Closed
3 tasks done
ro0NL opened this issue Jan 28, 2025 · 5 comments
Closed
3 tasks done

Multi arch build / GHA cache #1311

ro0NL opened this issue Jan 28, 2025 · 5 comments

Comments

@ro0NL
Copy link

ro0NL commented Jan 28, 2025

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

We're building multi arch Dockerfile (AMD/ARM)

Using a matrix of runners we noticed the default runner (ubuntu-latest) leverages GHA cache, but our custom runner doesnt.

cache-from: type=gha
cache-to: type=gha,mode=max

Are we missing something?

Image

Expected behaviour

Fast build

Actual behaviour

Slow build

Repository URL

No response

Workflow run URL

No response

YAML workflow

runs-on: ${{ matrix.runner }}
        steps:
            -
                uses: actions/checkout@v4.2.2
            -
                uses: docker/setup-buildx-action@v3.8.0
            -
                id: build
                uses: docker/build-push-action@v6.13.0
                with:
                    context: .
                    load: true
                    # https://docs.docker.com/build/ci/github-actions/cache/#github-cache
                    cache-from: type=gha
                    cache-to: type=gha,mode=max

Workflow logs

No response

BuildKit logs


Additional info

No response

@crazy-max
Copy link
Member

we noticed the default runner (ubuntu-latest) leverages GHA cache, but our custom runner doesnt.

Would need workflow logs and BuildKit logs to figure out what's going on. Just a heads-up: we don't support or test outside of GitHub-hosted runner infrastructure, though we can assist on a best-effort basis. Thanks for your understanding.

@ro0NL
Copy link
Author

ro0NL commented Jan 28, 2025

@ro0NL
Copy link
Author

ro0NL commented Jan 28, 2025

so first (due to timing) the AMD build kicks off, it's cached: #13 CACHED

then the ARM build kicked off, which is not cached.

after both builds, we start a push in a single job (platforms: linux/amd64,linux/arm64), which should leverage previous build cache.

However in the push job we noticed the latter build (ARM) is actually cached, and the AMD build isnt.

As if they are both sharing the same cache key.

@ro0NL
Copy link
Author

ro0NL commented Jan 28, 2025

will close due to unsupported features. being;

  • build (multi arch, cached)
  • test
  • push (cached)

As if they are both sharing the same cache key.

@crazy-max
Copy link
Member

Does it work if you put a scope matching the runner instance like:

                    cache-from: type=gha,scope=build-${{ matrix.runner }}
                    cache-to: type=gha,scope=build-${{ matrix.runner }},mode=max

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants