qqeasonchen opened a new pull request, #5425:
URL: https://github.com/apache/eventmesh/pull/5425

   Fixes #5424
   
   ### Motivation
   
   Every published `apache/eventmesh` tag is a single-architecture manifest:
   
   ```
   $ docker image inspect apache/eventmesh:2.0.0-snapshot --format 
'{{.Architecture}}'
   amd64
   ```
   
   Nothing in the build is amd64-specific — `dist` is Java bytecode and 
`eclipse-temurin:21-jre`
   is multi-arch — the image is simply built on an amd64 runner with no 
`platforms` declared.
   
   That matters because the runtime is a JVM with a RocksDB offset store, so 
the emulation
   penalty on arm64 hosts (Apple Silicon, Graviton, Ampere) is not marginal, and
   `deploy/kubernetes/runtime-statefulset.yaml` pins `apache/eventmesh:latest` 
without a
   `nodeSelector`, so a mixed-arch cluster schedules amd64 pods onto arm64 
nodes and runs them
   emulated without any signal that it happened.
   
   ### Modifications
   
   * `.github/workflows/docker.yml` — add `docker/setup-qemu-action` (registers 
the binfmt
     handlers for the foreign leg) and `docker/setup-buildx-action` (the plain 
docker driver
     cannot publish a manifest list), then build `platforms: 
linux/amd64,linux/arm64` in one
     `build-push-action` call, so each tag becomes a two-entry manifest list. 
The existing
     tags / labels / `Dockerfile` matrix are untouched.
   * `docker/Dockerfile` — builder stage is now `FROM --platform=$BUILDPLATFORM 
gradle:8.5.0-jdk21`.
     Without this the arm64 leg would run the whole Gradle build under qemu 
*and*
     `gradle:8.5.0-jdk21` has no arm64 variant to resolve, so that leg fails 
outright. The jars
     are bytecode and identical for both architectures, so compilation happens 
once on the
     native build platform; only the runtime stage (base JRE, procps, 
HEALTHCHECK) is
     materialised per target architecture. The runtime stage deliberately stays 
on the target
     platform.
   
   ### Documentation
   
   - Does this pull request introduce a new feature? (no — it extends the 
published artifacts of
     an existing feature)
   - If a feature is not applicable for documentation, explain why? The 
user-visible change is a
     second manifest entry on the same tags; `docker pull 
apache/eventmesh:latest` on arm64
     simply stops warning about a platform mismatch. No configuration or API 
changed, so
     `docs/quickstart/getting-started.md` stays accurate as written.
   
   ### Verification
   
   * ~~Local~~ CI build of both legs, then:
   
   ```
   $ docker buildx imagetools inspect apache/eventmesh:2.0.0-snapshot
   Name:      docker.io/apache/eventmesh:2.0.0-snapshot
   MediaType: application/vnd.oci.image.index.v1+json
   Manifests:
     Name:      docker.io/apache/eventmesh:2.0.0-snapshot@sha256:...
     Platform:  linux/amd64
     Name:      docker.io/apache/eventmesh:2.0.0-snapshot@sha256:...
     Platform:  linux/arm64
   ```
   
   * Run the image on both architectures: `GET /admin/health` → `UP`, and a
     subscribe → publish → poll round trip delivers the event (`smoke-1` / 
`img-smoke-1`).
   * The existing `Image Smoke Test` workflow still passes against the 
multi-arch tag on the
     amd64 runner.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to