Skip to content

Commit

Permalink
build separate arm64 cache
Browse files Browse the repository at this point in the history
workaround for #218
  • Loading branch information
maxheld83 committed Apr 6, 2023
1 parent 74ff213 commit eba09df
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/onbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,34 @@ jobs:
tag_from_git_sha="${{ github.sha }}" \
git_ref_name="${{ github.ref_name }}" \
is_ci=true
# workaround for missing multi-node registry cache, tracked in #218
build-onbuild-armcache:
name: "Build ARM64 Cache"
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Set up QEMU"
uses: docker/setup-qemu-action@v2
with:
platforms: "linux/arm64"
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v2
with:
version: v0.10.4
install: true
- name: "Log in to GHCR"
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: "Build and Push ARM64 Image Cache"
run: |
ARCH="arm64" \
make bake \
tag_from_git_sha="${{ github.sha }}" \
git_ref_name="${{ github.ref_name }}" \
is_ci=true \
bake_args="--set=*.platform=linux/arm64 --set=*.output='type=tar,dest=throwaway.tar'"
9 changes: 6 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ services:
- ${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder:${TAG_FROM_GIT_SHA:-latest}
x-bake:
cache-from:
- "type=registry,ref=${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder/cache:${TAG_FROM_GIT_REF_NAME}"
- "type=registry,ref=${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder/cache:${DEFAULT_BRANCH}"
- "type=registry,ref=${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder/cache/arm64:${TAG_FROM_GIT_REF_NAME}"
- "type=registry,ref=${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder/cache/amd64:${TAG_FROM_GIT_REF_NAME}"
- "type=registry,ref=${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder/cache/arm64:${DEFAULT_BRANCH}"
- "type=registry,ref=${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder/cache/amd64:${DEFAULT_BRANCH}"
cache-to:
- "type=registry,ref=${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder/cache:${TAG_FROM_GIT_REF_NAME},mode=max"
# workaround for missing multi-node registry cache, tracked in #218
- "type=registry,ref=${REGISTRY_PREFIX_GHCR}/${IMAGE_OWNER}/${IMAGE_NAME_ROOT}/onbuild/builder/cache/{ARCH:-amd64}:${TAG_FROM_GIT_REF_NAME},mode=max"

0 comments on commit eba09df

Please sign in to comment.