Skip to content

Run Docker frontend builds on BUILDPLATFORM and bound stalled npm installs - #9

Merged
satomic merged 2 commits into
mainfrom
copilot/fix-docker-build-timeouts
Sep 13, 2026
Merged

satomic merged 2 commits into
mainfrom
copilot/fix-docker-build-timeouts

Conversation

Copilot AI commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

The release image build was stalling in the linux/arm64 frontend npm ci step for hours with no timeout and weak diagnostics. The observed evidence pointed to an unfinished ARM frontend dependency install, but not to a confirmed TypeScript/build failure or a single proven root cause.

  • Frontend build stage

    • Move the Node frontend stage to the builder platform so npm ci and npm run build execute natively even when publishing a multi-arch image.
    • Keep the Python runtime stage and published linux/amd64,linux/arm64 image behavior unchanged.
    FROM --platform=$BUILDPLATFORM node:22-alpine AS frontend
  • npm install visibility and failure diagnosis

    • Keep npm ci lockfile-based semantics.
    • Add foreground lifecycle-script output, timing, and info-level logs so stalls are visible while the install is running.
    • Add bounded fetch retry/timeouts.
    • On failure, print sanitized npm debug logs and preserve the original exit status.
  • Registry/mirror behavior

    • Normalize frontend/package-lock.json resolved URLs to canonical registry.npmjs.org tarballs.
    • Pair that with npm registry host replacement so the existing NPM_REGISTRY build arg remains effective instead of being bypassed by environment-specific lockfile URLs.
  • Workflow timeout bounds

    • Add an explicit timeout-minutes: 60 to the build job.
    • Bound the build step and smoke-test step separately so release builds fail fast instead of consuming the default multi-hour window.
    • Preserve current publishing rules: PRs still build without pushing, version tags still publish semver aliases plus latest, and branch dispatches still avoid moving latest.
  • Operational note

    • This mitigates the observed emulated ARM frontend bottleneck by removing static-asset installation/build work from the target-platform path.
    • Re-running the old workflow run/tag will not pick up this change; validation should happen from a branch containing the fix, and release publication should use a new version tag that includes it.

Co-authored-by: satomic <9782493+satomic@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Docker build with timeouts and npm logging Run Docker frontend builds on BUILDPLATFORM and bound stalled npm installs Sep 13, 2026
Copilot AI requested a review from satomic September 13, 2026 03:12
@satomic
satomic marked this pull request as ready for review September 13, 2026 03:21
@satomic
satomic merged commit 859843a into main Sep 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants