ci: Docker build crashes with illegal instruction under arm64 emulation - #10706
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Docker build stage now runs on the build platform and selects production dependencies for the target architecture. The release stage copies ChangesDocker build flow
Priority: ⬆️ High Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant Workflow
participant Buildx
participant BuildStage
participant npm
participant ReleaseStage
Workflow->>Buildx: Build for linux/amd64 and linux/arm64/v8
Buildx->>BuildStage: Run build stage on the build platform
BuildStage->>npm: Install production dependencies for TARGETARCH
BuildStage->>npm: Install dependencies and build
BuildStage->>ReleaseStage: Copy /logs
Merge Risk: ⚪ Minimal · up to The changed Docker builds have no established merge-blocking issue after the platform and legacy-builder paths were checked. 🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
Full details: Out of Scope Changes checkExplanation The manual Docker release workflow removes its QEMU setup step. The stated PR scope says that workflow retains QEMU to support builds with earlier Dockerfiles. The removal changes legacy Dockerfile support and is not required to fix the CI or automated release failures in [
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10706 +/- ##
==========================================
- Coverage 93.88% 93.86% -0.02%
==========================================
Files 193 193
Lines 17061 17061
Branches 257 257
==========================================
- Hits 16017 16015 -2
- Misses 1022 1024 +2
Partials 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pull Request
Issue
The Docker image build crashes in about 1 of 10 runs with
qemu: uncaught target signal 4 (Illegal instruction), when Node.js runs under QEMU emulation to build the arm64 image. The crash only occurs on runners with an AVX-512 CPU. It fails theDocker Buildcheck, which is required onbeta,releaseandrelease-8.x.x, and the Docker release job, which then publishes no image; for example9.10.1was missing on Docker Hub until it was published manually.Closes #10705, part of #10681.
Approach
The image is cross-built, so that no code runs under emulation and QEMU is not needed anymore.
FROM --platform=$BUILDPLATFORM). It installs the production dependencies for the architecture of the image withnpm ci --os=linux --cpu=<arch> --libc=musl. Only@node-rs/bcrypthas platform-specific production dependencies, and install scripts were already skipped with--ignore-scripts. The build output inlib/does not depend on the platform.RUNinstruction anymore; a comment says it must not have one. Thelogsfolder owned bynodeis created by copying an empty folder from the build stage withCOPY --chown=node:node.BUILDPLATFORMandTARGETARCH, like the legacy Docker builder and kaniko, run the build stage on their own platform and install the dependencies for it, as before.release-manual-docker.ymlbuilds a ref with a previous Dockerfile, BuildKit falls back to its own bundled QEMU. The missing images of stable v9 releases were already published with the previous workflow. Note that BuildKit would also run aRUNinstruction added to the release stage under its bundled QEMU instead of failing.Docker Buildis unchanged, so the required checks need no change.Native arm64 runners were considered as well. They also avoid emulation, but require one job per platform, a job in each release workflow that merges the pushed images into a multi-platform image, and a job that reports the required
Docker Buildcheck. Pinning a QEMU version was rejected, because the crash already occurred months before the current QEMU version became the default.Verified locally on an arm64 host with Docker 29.5.3, comparing images built with the previous and the new Dockerfile:
linux/amd64andlinux/arm64, the/parse-serverfolder of both images is identical in content, file mode and owner, and so is the image configuration.@node-rs/bcryptbinding loads for the architecture of the image, and the server writes log files as usernode.DOCKER_BUILDKIT=0) and kaniko 1.23.2 build an image with the same/parse-serverfolder as BuildKit. Alinux/arm/v7image builds and runs.Tasks
Summary by CodeRabbit
amd64andarm64, with build steps configured to support cross-platform image builds.