Skip to content

perf(docker): build Java artifacts natively#3092

Merged
imbajin merged 1 commit into
masterfrom
cx-pd-store-server-docker-perf
Jul 12, 2026
Merged

perf(docker): build Java artifacts natively#3092
imbajin merged 1 commit into
masterfrom
cx-pd-store-server-docker-perf

Conversation

@imbajin

@imbajin imbajin commented Jul 12, 2026

Copy link
Copy Markdown
Member

Summary

  • build PD, Store, standalone Server, and HStore Java artifacts on the native BuildKit platform
  • keep runtime stages target-platform specific
  • avoid running the full Maven reactor under QEMU for arm64 images

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

  • exact JDK 11 Maven package command passed all 43 modules in 2:05
  • RocksDB JNI, Jansi, JFFI, Zstd, LZ4, Snappy, and Server tcnative packages were inspected for Linux arm64 support
  • protoc/grpc platform tools are build-time Java generators only
  • git diff --check passed
  • independent cross-repository review passed

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.

- 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
Copilot AI review requested due to automatic review settings July 12, 2026 09:03
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. ci-cd Build or deploy perf labels Jul 12, 2026

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 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.

Comment thread hugegraph-server/Dockerfile
Comment thread hugegraph-server/Dockerfile-hstore
Comment thread hugegraph-pd/Dockerfile
Comment thread hugegraph-store/Dockerfile
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.24%. Comparing base (99936be) to head (2c9d15b).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pengzna Pengzna 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.

Reviewed head 2c9d15b. No additional findings after checking all four Dockerfiles, the build/runtime platform split, and the native dependency packaging path.

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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 VGalaxies 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.

✅ 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

@imbajin imbajin merged commit a802912 into master Jul 12, 2026
22 checks passed
@imbajin imbajin deleted the cx-pd-store-server-docker-perf branch July 12, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd Build or deploy perf size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants