Skip to content

perf(images): persist multi-platform build caches#21

Merged
imbajin merged 5 commits into
masterfrom
cx-hubble-build-cache-perf
Jul 12, 2026
Merged

perf(images): persist multi-platform build caches#21
imbajin merged 5 commits into
masterfrom
cx-hubble-build-cache-perf

Conversation

@imbajin

@imbajin imbajin commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add durable Docker Hub registry caches for Hubble, PD, Store, standalone Server, and HStore image builds
  • isolate cache manifests by component and latest/release channel
  • keep the existing GHA fallback for generic reusable image callers
  • let PD/Store/HStore integration prechecks seed cold caches, let amd64 refresh caches, and let arm64 consume them without duplicate exports
  • expose cache strategy and references in job summaries
  • upgrade changed reusable workflows to actions/checkout@v7

Why

Hubble caches had been evicted before the next real publish, while PD/Store/Server arm64 builds commonly spend 40–90 minutes running Maven under QEMU. Registry caches survive long gaps and allow the native BUILDPLATFORM build stage from apache/hugegraph#3092 to be reused by the arm64 runtime image jobs.

Companion Dockerfile change: apache/hugegraph#3092.
Hubble Dockerfile change: apache/hugegraph-toolchain#740.

Cache topology

  • Hubble: hugegraph/hubble:buildcache-latest and buildcache-release
  • PD: hugegraph/pd:buildcache-latest and buildcache-release
  • Store: hugegraph/store:buildcache-latest and buildcache-release
  • HStore Server: hugegraph/server:buildcache-latest and buildcache-release
  • Standalone Server: hugegraph/hugegraph:buildcache-latest and buildcache-release

Verification

  • actionlint passed for all changed workflows
  • YAML, embedded matrix JSON, optional cache fallback, cache channel isolation, and reader/writer assertions passed
  • official action versions were checked against current GitHub releases
  • git diff --check passed
  • independent cross-repository review and targeted re-review passed

The first publish creates cold registry caches. A subsequent publish should be used to measure hot-cache hit rate and arm64 duration. Real arm64 runtime health validation remains required for apache/hugegraph#3092.

imbajin added 3 commits July 12, 2026 16:41
- add an optional registry cache backend to the reusable image workflow
- share the Hubble build cache across latest and release publishes
- preserve the existing GHA cache path for all other components
- expose image, platform, and cache parameters in the workflow summary
- update the reusable image workflow to actions/checkout v7
- use the latest stable major for every shared workflow consumer
- keep the Docker action chain on its current stable major aliases
- use a dedicated registry cache tag for latest builds
- use a separate registry cache tag for release builds
- prevent release cache exports from replacing the master cache index
Copilot AI review requested due to automatic review settings July 12, 2026 08:49
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Jul 12, 2026
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

本次变更为可复用镜像发布工作流增加 registry 构建缓存支持,保留 GHA 缓存回退逻辑,并将构建步骤统一改用解析后的缓存输出;Hubble latest 与 release 工作流分别配置缓存镜像。

Changes

镜像构建缓存

Layer / File(s) Summary
缓存后端解析与输出
.github/workflows/_publish_image_reusable.yml
根据 registry_cache_image 在 registry 与 GHA 缓存策略间切换,输出缓存参数、后端信息及步骤摘要,并将 checkout 升级至 v7。
构建步骤与调用方接入
.github/workflows/_publish_image_reusable.yml, .github/workflows/publish_*_hubble_image.yml
smoke test 和正式构建统一读取缓存输出;latest 与 release 分别配置对应的缓存镜像。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • hugegraph/actions#14:引入并集中管理该复用镜像发布工作流的 Buildx 缓存与发布逻辑。

Poem

小兔抱着缓存跑,
registry 里萝卜好;
GHA 仍在旁边等,
构建参数排成行;
latest、release 一起跳。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次 PR 的核心变化:为镜像构建持久化多平台构建缓存。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cx-hubble-build-cache-perf

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the shared image publishing workflow to optionally use a durable Docker registry-backed BuildKit cache (instead of the default GitHub Actions cache), and applies that option specifically to the Hubble latest/release workflows with separate cache references to avoid cache-manifest contention. It also upgrades the shared checkout step to actions/checkout@v7.

Changes:

  • Add optional registry cache support (type=registry) to _publish_image_reusable.yml, while keeping the GHA cache as the default fallback.
  • Configure Hubble latest/release wrappers to use distinct registry_cache_image tags for isolated caches.
  • Emit cache backend/reference details into the job step summary and bump actions/checkout to v7 in the reusable workflow.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/publish_release_hubble_image.yml Adds a dedicated release cache ref (hugegraph/hubble:buildcache-release) to enable durable registry caching for Hubble release builds.
.github/workflows/publish_latest_hubble_image.yml Adds a dedicated latest cache ref (hugegraph/hubble:buildcache-latest) to enable durable registry caching for Hubble scheduled/latest builds.
.github/workflows/_publish_image_reusable.yml Introduces cache backend selection (registry vs GHA), outputs cache parameters, writes a build-parameter summary, and upgrades checkout to v7.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/_publish_image_reusable.yml Outdated
imbajin added 2 commits July 12, 2026 16:59
- keep registry cache selection optional for shared callers
- preserve GHA cache fallback when the matrix key is absent
- make the reusable workflow contract explicit
- move PD, Store, and Server caches to Docker Hub registry

- seed durable caches during strict integration prechecks

- isolate caches by image and publish channel

- share BUILDPLATFORM cache with read-only arm64 jobs

- upgrade checkout steps and expose cache strategy
@imbajin imbajin changed the title perf(hubble): persist multi-platform build cache perf(images): persist multi-platform build caches Jul 12, 2026
@imbajin imbajin merged commit c3af5a9 into master Jul 12, 2026
1 check passed
@imbajin imbajin deleted the cx-hubble-build-cache-perf branch July 12, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants