perf(docker): build Java artifacts natively#3092
Conversation
- bind Maven build stages to BUILDPLATFORM - keep all runtime stages target-platform specific - avoid emulated Maven builds for ARM images - cover PD, Store, standalone, and HStore images
There was a problem hiding this comment.
Pull request overview
This PR optimizes multi-arch Docker builds for HugeGraph PD/Store/Server (standalone + hstore) by ensuring Maven build stages run on the native BuildKit builder platform, avoiding slow QEMU execution while keeping runtime stages target-platform specific.
Changes:
- Switch the Maven “build” stage in multiple Dockerfiles to
FROM --platform=$BUILDPLATFORM ...to build Java artifacts natively. - Keep runtime stages as target-platform images (no explicit platform override on the final stage).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| hugegraph-store/Dockerfile | Build stage now targets $BUILDPLATFORM for faster native builds. |
| hugegraph-server/Dockerfile-hstore | Build stage now targets $BUILDPLATFORM for faster native builds. |
| hugegraph-server/Dockerfile | Build stage now targets $BUILDPLATFORM for faster native builds. |
| hugegraph-pd/Dockerfile | Build stage now targets $BUILDPLATFORM for faster native builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3092 +/- ##
============================================
+ Coverage 42.18% 42.24% +0.05%
Complexity 460 460
============================================
Files 817 817
Lines 70244 70244
Branches 9311 9311
============================================
+ Hits 29633 29674 +41
+ Misses 37532 37498 -34
+ Partials 3079 3072 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
imbajin
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: No actionable findings after reviewing all four Dockerfiles and the build/runtime platform boundary. Evidence: static diff review; all visible latest-head checks are green.
VGalaxies
left a comment
There was a problem hiding this comment.
✅ Review summary
Note
The build-platform pinning is consistent across all four Dockerfiles, and this review found no additional actionable issue beyond the existing current-head discussion.
🧪 How this was verified
| Independent check | What it traced | Outcome |
|---|---|---|
| 🏗️ BuildKit semantics | Followed automatic platform arguments, BUILDPLATFORM/TARGETPLATFORM, final-stage architecture, cache/export behavior, and compatibility of the four changed FROM lines. |
The reviewer found no additional platform-scope or wrong-architecture defect beyond the already-reported ARG BUILDPLATFORM discussion. |
| 🔗 Repository integration | Enumerated workflow, script, and Docker invocations for PD, Store, Server, and HStore; then traced Maven/native artifacts built on BUILDPLATFORM into target-platform images. |
The reviewer found no legacy-build incompatibility or host-native artifact leak. |
| ✅ Current-head CI | Checked the four Docker Build CI jobs and the surrounding PD, Store, HStore, Server, dependency, license, and CodeQL jobs. | All current-head checks passed, including each changed Dockerfile. |
🤖 Codex review · GPT-5.6 Sol · effort: xhigh
Summary
Why
Recent arm64 publish jobs spend roughly 40–90 minutes in QEMU while equivalent amd64 jobs complete in under 1–8 minutes. These Docker build stages produce Java distributions that can be shared by the target-specific runtime stages.
Companion workflow and durable registry cache changes are included in hugegraph/actions#21.
Verification
Remaining CI validation
The local Docker daemon was unavailable. The publish workflow should build and start the arm64 PD, Store, standalone Server, and HStore images, verify their health endpoints, and check for native-library load failures. The existing PD/Store tcnative 2.0.25 dependency is x86_64-only regardless of builder architecture, so that pre-existing runtime behavior remains part of the ARM smoke scope.