Repository navigation
fix(docker): build the UI bundle natively instead of under QEMU (unblocks v0.4.3 release) - #82
Merged
Merged
Conversation
The v0.4.3 release run hung for 6 hours in "Build and push UI". The linux/amd64 half of the UI image built in seconds, but the linux/arm64 half crashed during `npm ci -w ui` under QEMU emulation: qemu: uncaught target signal 4 (Illegal instruction) - core dumped and then never returned, until the 6-hour job limit cancelled the run. The same Dockerfile built both architectures fine in the Sept 19 beta run; the workflow's QEMU image (tonistiigi/binfmt:latest) and the node base image are both unpinned, so the emulation environment changed underneath an unchanged Dockerfile. The builder stage only produces static files (HTML, JS, CSS) that are identical on every architecture, so it does not need to run once per target. Pin it to the CI machine's own platform with `FROM --platform=$BUILDPLATFORM`. The npm install and vite build now run natively and once, which removes the emulated npm ci that crashed (and should make the UI image build faster). The final nginx stage only COPYs the files in, so it is still built per target and the published linux/arm64 image is unchanged. The Controller image is deliberately left alone: it ships node_modules into the runtime image, which may contain per-architecture native code, and it built fine for arm64 in the same run. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EeNrf1VXC34bbCKDsfL4TS
Contributor
🧪 Test Results — ✅ All tests passed
Commit: |
Contributor
Author
|
/pr-beta |
Contributor
🐳 PR Beta Images Published
Commit: Quick test# Pull and run
docker pull ghcr.io/watchwarden-labs/watchwarden-controller:pr-82-beta
docker pull ghcr.io/watchwarden-labs/watchwarden-agent:pr-82-beta
docker pull ghcr.io/watchwarden-labs/watchwarden-ui:pr-82-beta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
v0.4.3release run hung for 6 hours in Build and push UI and was cancelled by the job limit. This changes one line inui/Dockerfileso the UI image no longer runsnpm ciunder QEMU emulation.What happened
In the hung run (#38520682395), the multi-arch UI build split into two branches:
linux/amd64—npm ci+vite buildfinished in about 8 seconds.linux/arm64—npm ci -w uicrashed under QEMU and never returned:Nothing was logged after that until the 6-hour limit cancelled the job.
The same Dockerfile built both architectures fine in the Sept 19 beta build, and nothing in the repo changed in between. The QEMU image the workflow uses (
tonistiigi/binfmt:latest) and thenode:22-alpinebase are both unpinned, so the emulation environment changed underneath an unchanged Dockerfile. I can't tell from the log which install script died.The change
The builder stage only produces static HTML/JS/CSS, which is identical on every architecture, so it doesn't need to run once per target. With this change it runs once, natively, on the CI machine. The final
nginxstage onlyCOPYs those files in, so it is still built per target and the publishedlinux/arm64image is unchanged. As a side effect the UI image should build faster.Deliberately not changed
node_modulesinto the runtime image, which may contain per-architecture native code, so it keeps building per target. It built fine for arm64 in the same run.Test plan
FROMline plus a comment;COPY --from=builderpaths are unchanged./pr-betaon this PR and confirm the multi-arch UI build completes, then check the arm64 image runs (docker run --platform linux/arm64 ghcr.io/watchwarden-labs/watchwarden-ui:pr-<n>-beta).Release note
maincurrently has twochore: update changelog for v0.4.3commits (2a4923fand6a7f7b6), one from each release attempt, and nov0.4.3tag yet. This PR doesn't touch that.Generated by Claude Code