From 0779707734c07e7c2a6933bed21bf44d86cccd2a Mon Sep 17 00:00:00 2001 From: hsinhoyeh Date: Mon, 3 Aug 2026 14:06:16 +0800 Subject: [PATCH 1/2] Download the Bazel release matching the build architecture The server image hardcoded bazel-$BAZEL_VERSION-installer-linux-x86_64.sh, so ml_metadata_store_server could only be built on x86_64. This is one of the reasons the published image is amd64-only, which in turn blocks Kubeflow Pipelines on ARM clusters (kubeflow/pipelines#10308). Bazel publishes a linux-arm64 release for 7.7.0, but as a plain binary rather than an installer script, so select the artifact from `dpkg --print-architecture` and install it directly to /usr/local/bin. On x86_64 this is equivalent to the previous installer invocation: the installer's only effect here was to place the same bazel binary on PATH. --- ml_metadata/tools/docker_server/Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ml_metadata/tools/docker_server/Dockerfile b/ml_metadata/tools/docker_server/Dockerfile index 52cbff8f5..9d076b407 100644 --- a/ml_metadata/tools/docker_server/Dockerfile +++ b/ml_metadata/tools/docker_server/Dockerfile @@ -40,13 +40,12 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ ENV BAZEL_VERSION 7.7.0 WORKDIR / RUN mkdir /bazel && \ - cd /bazel && \ - curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ - curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \ - chmod +x bazel-*.sh && \ - ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ - cd / && \ - rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh + ARCH=$(dpkg --print-architecture) && \ + curl -H "User-Agent: Mozilla/5.0" -fSsL -o /usr/local/bin/bazel \ + https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-${ARCH} && \ + curl -H "User-Agent: Mozilla/5.0" -fSsL -o /bazel/LICENSE.txt \ + https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \ + chmod +x /usr/local/bin/bazel ADD . /mlmd-src WORKDIR /mlmd-src From 4374047389b9838309899f9886c7c26688bbfdef Mon Sep 17 00:00:00 2001 From: hsinhoyeh Date: Mon, 3 Aug 2026 17:53:07 +0800 Subject: [PATCH 2/2] Raise the aarch64 assembler baseline so Abseil can build Abseil's absl/debugging/stacktrace.cc emits xpaclri, an ARMv8.3 pointer-authentication instruction. GNU as rejects it at the default armv8-a baseline, so the build fails on aarch64: external/abseil-cpp/absl/debugging/stacktrace.cc [for tool] failed /tmp/ccRV18O3.s:166: Error: selected processor does not support `xpaclri' Pass -march=armv8.3-a when building for arm64. Both --copt and --host_copt are required: the failing target is compiled in the exec configuration, which --copt does not affect, so with --copt alone the error is unchanged. The flag is invalid on x86_64, so it is selected from `dpkg --print-architecture` and x86_64 builds are unaffected. -march=armv8-a+pauth would be preferable, since xpaclri is HINT-space and a no-op on cores without pointer authentication, whereas armv8.3-a makes the binary require ARMv8.3 hardware. GCC 9 on the ubuntu:20.04 builder rejects it, though: cc1: error: invalid feature modifier 'pauth' in '-march=armv8-a+pauth' so a newer builder base image would be the better long-term fix. Verified on master: with this change the image builds clean on aarch64 and metadata_store_server starts. --- ml_metadata/tools/docker_server/Dockerfile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ml_metadata/tools/docker_server/Dockerfile b/ml_metadata/tools/docker_server/Dockerfile index 9d076b407..ea81fc529 100644 --- a/ml_metadata/tools/docker_server/Dockerfile +++ b/ml_metadata/tools/docker_server/Dockerfile @@ -51,7 +51,18 @@ ADD . /mlmd-src WORKDIR /mlmd-src # "-std=c++17" is needed in order to build with ZetaSQL. -RUN bazel build -c opt --action_env=PATH \ +# Abseil's stacktrace.cc emits the ARMv8.3 pointer-authentication instruction +# xpaclri, which the assembler rejects at the default armv8-a baseline. The +# flag is only valid on aarch64, so it is selected by architecture. Note both +# --copt and --host_copt are needed: the failing target is built in the exec +# configuration, which --copt does not affect. +RUN ARCH=$(dpkg --print-architecture) && \ + if [ "$ARCH" = "arm64" ]; then \ + MARCH_FLAGS="--copt=-march=armv8.3-a --host_copt=-march=armv8.3-a"; \ + else \ + MARCH_FLAGS=""; \ + fi && \ + bazel build -c opt --action_env=PATH $MARCH_FLAGS \ --define=grpc_no_ares=true \ //ml_metadata/metadata_store:metadata_store_server --cxxopt="-std=c++17"