Skip to content

Conversation

@rezarajan
Copy link
Contributor

@rezarajan rezarajan commented Nov 21, 2025

Changelog

  • switch to GitHub Actions cache to prevent runner disk exhaustion
  • refactor to use a matrix strategy for both amd64 and arm64
  • remove qemu (Remove QEMU #300)

Summary by cubic

Switched the Docker CI workflow to GitHub Actions cache to prevent runner disk exhaustion and simplified multi-arch builds. Replaced duplicate jobs with a single matrix for amd64 and arm64, removing QEMU by using a native arm64 runner.

  • Bug Fixes

    • Use cache-from/to: type=gha to move buildx cache off the runner disk.
    • Scope buildx caches per arch to avoid overwrites.
  • Refactors

    • Combine separate jobs into a matrix (amd64, arm64) with arch-specific runners.
    • Remove QEMU; build arm64 on ubuntu-24.04-arm.
    • Pin all actions to commit SHAs.
    • Standardize image tag suffixes via docker/metadata-action.

Written for commit 7ab77a9. Summary will update automatically on new commits.

Summary by CodeRabbit

  • Chores
    • Consolidated architecture-specific CI jobs into a unified matrix-driven build.
    • Added conditional runner selection per architecture and a dedicated Docker build step.
    • Improved caching strategy for faster, more reliable builds and removed redundant cache steps.
    • Retained image metadata and build/push behavior while simplifying workflow configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

… exhaustion

- refactor to use a matrix strategy for both amd64 and arm64
- remove qemu (blinklabs-io#300)

Signed-off-by: Reza Rajan <28660160+rezarajan@users.noreply.github.com>
@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

📝 Walkthrough

Walkthrough

Consolidates separate amd64 and arm64 CI Docker jobs into a single matrix-driven job over arch [amd64, arm64]. Replaces fixed runner with a conditional selection (uses ubuntu-24.04-arm for arm64, ubuntu-latest otherwise). Removes explicit QEMU and per-arch local-cache setup; switches build cache to GitHub Actions cache (cache-from/type=gha, cache-to/type=gha,mode=max) scoped by buildkit-${{ matrix.arch }}. Computes image suffix via matrix expression (-arm64v8 for arm64, -amd64 for amd64) and adds a new "Build Docker image" step prior to build-push, preserving metadata/labels usage.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify matrix job produces identical artifacts for both architectures and that the suffix expression is correct.
  • Confirm conditional runner expression evaluates as intended and that ubuntu-24.04-arm is available when required.
  • Review cache scope naming (buildkit-${{ matrix.arch }}) and type=gha usage for correctness and expected cache reuse.
  • Check the new "Build Docker image" step integrates with the metadata action and does not duplicate labels/tags.
  • Ensure removal of explicit QEMU and per-arch cache steps does not break cross-arch builds.

Files/areas to pay extra attention to:

  • .github/workflows/ci-docker.yml — matrix, runner condition, cache configuration, and new step interactions.

Possibly related PRs

  • feat: cardano-node 10.5.3 #302 — Also modifies .github/workflows/ci-docker.yml, changing runner selection and build-job configuration; overlaps on CI job structure.
  • ci: change runners #303 — Alters runner selection/configuration in the same workflow file; related to runner assignment changes.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly captures the main objective of switching to GitHub Actions cache to prevent runner disk exhaustion, which aligns with the primary change in the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rezarajan
Copy link
Contributor Author

Testing out the ci-docker workflow before making any changes to the publish workflow.

Signed-off-by: Reza Rajan <28660160+rezarajan@users.noreply.github.com>
Signed-off-by: Reza Rajan <28660160+rezarajan@users.noreply.github.com>
Signed-off-by: Reza Rajan <28660160+rezarajan@users.noreply.github.com>
@rezarajan
Copy link
Contributor Author

CI builds with the gha cache finished ✅

@rezarajan
Copy link
Contributor Author

rezarajan commented Nov 21, 2025

Issue

While the GHA cache works, and can be used in future runs, the last finished build in the pipeline will overwrite the cache since it does not have any unique references (arch, build target/tags).

See [Docker Docs on gha cache] (https://docs.docker.com/build/cache/backends/gha/#scope).

Scope is a key used to identify the cache object. By default, it is set to buildkit. If you build multiple images, each build will overwrite the cache of the previous, leaving only the final cache.

TODO: Include scope for cache to avoid overwriting.

@rezarajan rezarajan force-pushed the ci/cachefix branch 5 times, most recently from 8cadc55 to 2d9f4c8 Compare November 21, 2025 20:16
@rezarajan rezarajan marked this pull request as ready for review November 21, 2025 20:18
@rezarajan rezarajan requested review from a team as code owners November 21, 2025 20:18
Copy link
Member

@wolf31o2 wolf31o2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking the per-architecture caches is not acceptable. This is why we don't use the gha cache type. It cannot support the proper cache necessary to cache both builds. Having an unpredictable cache is not the answer here.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Signed-off-by: Reza Rajan <28660160+rezarajan@users.noreply.github.com>
@rezarajan
Copy link
Contributor Author

Breaking the per-architecture caches is not acceptable. This is why we don't use the gha cache type. It cannot support the proper cache necessary to cache both builds. Having an unpredictable cache is not the answer here.

Agreed. I am testing out a new build with scoped caches (see updated comment). This should avoid per-architecture overwrites.

To preserve the cache for multiple builds, you can specify this scope attribute with a specific name.

For this I have opted to use the pattern buildkit-<arch>, which should preserve cache for each architecture defined in the matrix.

Signed-off-by: Reza Rajan <28660160+rezarajan@users.noreply.github.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@rezarajan rezarajan requested a review from wolf31o2 November 21, 2025 22:08
@rezarajan rezarajan marked this pull request as draft November 21, 2025 22:12
@rezarajan
Copy link
Contributor Author

@wolf31o2 please review - this should work but needs to be tested with a workflow run to validate.

@wolf31o2
Copy link
Member

I started them back up. I cancelled your earlier runs because I was trying to get 10.5.3 built and needed the available runner slots.

@rezarajan
Copy link
Contributor Author

@wolf31o2 the build succeeded; can you re-run the same workflow to check if the cache hits?

@rezarajan
Copy link
Contributor Author

rezarajan commented Nov 22, 2025

@wolf31o2 looks like cache works! Builds run in a few seconds. Do you want to merge this for now? The publish workflow can perhaps be updated later in another PR with a similar strategy.

@wolf31o2 wolf31o2 marked this pull request as ready for review November 22, 2025 22:32
@wolf31o2
Copy link
Member

I ran it again just for fun and it's so fast. Thank you.

@wolf31o2 wolf31o2 merged commit 69f30b9 into blinklabs-io:main Nov 22, 2025
10 of 12 checks passed
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants