Skip to content

Add arm64 multi-arch release artifacts (closes #26) - #31

Merged
abienkowski merged 16 commits into
mainfrom
feat/arm64-multi-arch
Sep 12, 2026
Merged

Add arm64 multi-arch release artifacts (closes #26)#31
abienkowski merged 16 commits into
mainfrom
feat/arm64-multi-arch

Conversation

@abienkowski

@abienkowski abienkowski commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements full arm64 support across all three implementations (Go, Rust, TypeScript), enabling releases and deployments on arm64 servers (Hetzner CAX31, AWS Graviton, Oracle Ampere, etc.).

Closes: #26

What's Included

Binary Releases

  • Go: amd64 + arm64 matrix builds with CGO_ENABLED=0 (statically linked)
  • Rust: amd64 + arm64 cross-compilation (x86_64-unknown-linux-musl, aarch64-unknown-linux-musl)
  • TypeScript: Platform-independent Node archive (works on any arch)

Asset naming: docker-socket-policy-{go,rs,ts}-linux-{amd64,arm64}

Docker Images

  • Multi-arch manifest indexes (linux/amd64, linux/arm64)
  • Auto-detection on docker pull — correct architecture selected per host
  • Built via docker buildx with platforms: linux/amd64,linux/arm64

Release Workflow

  • Matrix builds for Go (2 parallel amd64/arm64 jobs)
  • Matrix builds for Rust with cross-compilation (2 parallel jobs)
  • SBOM and Cosign operations conditional (if: matrix.arch_name == 'amd64') to prevent race conditions on image registry
  • All three implementations publish to GitHub releases + GHCR

Documentation

  • reproducible-builds.md: arm64-specific verification examples, multi-arch image documentation
  • README.md: "Supported Architectures" subsection, per-arch binary naming, corrected static linking claims

Impact

Unblocks: ChainSafe/lodestar-infrastructure#9 (docker-socket-policy Ansible role deployment)

The 3x Hetzner CAX31 arm64 hosts in the lodestar fleet (stable-arm64, unstable-arm64, beta-arm64) now have a fully supported install path:

  • Prebuilt arm64 binaries (Go, Rust)
  • Multi-arch Docker images
  • Full verification documentation

Implementation Details

Go (Task 1)

  • Added matrix strategy to release-go job: goarch: [amd64, arm64]
  • Binary environment: CGO_ENABLED: 0, GOOS: linux, GOARCH: ${{ matrix.goarch }}
  • Conditional Docker/SBOM/Cosign gates to amd64 job only

Rust (Task 2)

  • Created .cargo/Cross.toml for cross-compilation config
  • Added matrix strategy to release-rust job with target mapping:
    • x86_64-unknown-linux-musl → amd64
    • aarch64-unknown-linux-musl → arm64
  • Installed cross tool for arm64 cross-compilation
  • Same conditional gating as Go

Dockerfiles (Task 3)

  • Removed hardcoded --platform=linux/amd64 pins from all FROM statements
  • Updated go/Dockerfile: Use ${TARGETARCH} for GOARCH (buildx auto-detect)
  • Updated rs/Dockerfile: Use ${TARGETPLATFORM} with case statement mapping to Rust target triples
  • Updated ts/Dockerfile: Removed pins for consistency (already multi-arch capable)

Verification (Task 8)

  • YAML syntax validated
  • Dependency graph correct (verify → version → release jobs → publish)
  • Race conditions eliminated via conditional gating
  • All edge cases handled

Testing

All changes validated via:

  • Spec compliance review (all requirements met exactly)
  • Code quality review (idiomatically correct, maintainable)
  • Final integration validation (99% confidence)

Related Issues

Builds on:

Enables resolution of:

- Add conditional 'if: matrix.goarch == amd64' to Docker, SBOM, and Cosign steps
- This ensures these operations run only once in the amd64 matrix job
- Add 'platforms: linux/amd64,linux/arm64' to docker/build-push-action
- buildx now creates a single multi-arch image index in one operation
- This eliminates the race condition where both matrix jobs push to the same tag
- Avoids concurrent SBOM filename collisions and Cosign signature races
- Single-arch binaries still build independently in both matrix jobs (correct)
@abienkowski abienkowski added Priority: P1 Added to issues and PRs relating to a high severity bugs. Type: Enhancement Added to issues and PRs when a change includes improvements or optimizations. labels Sep 12, 2026
@abienkowski abienkowski self-assigned this Sep 12, 2026
@abienkowski
abienkowski merged commit a4a7a28 into main Sep 12, 2026
6 checks passed
@abienkowski
abienkowski deleted the feat/arm64-multi-arch branch September 12, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P1 Added to issues and PRs relating to a high severity bugs. Type: Enhancement Added to issues and PRs when a change includes improvements or optimizations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust implementation ignores --listen-socket and is TCP-only (no UnixListener, no fd:// socket activation)

1 participant