From fd0d75c4ea7a2a7483ee6d50e8ab9ef6586ec465 Mon Sep 17 00:00:00 2001 From: amitmukati-2604 Date: Wed, 15 Feb 2023 17:20:04 +0530 Subject: [PATCH] Adding multi-arch support for linux/ppc64le in ml-metadata --- ml_metadata/tools/docker_server/Dockerfile | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ml_metadata/tools/docker_server/Dockerfile b/ml_metadata/tools/docker_server/Dockerfile index 0b4121354..740621891 100644 --- a/ml_metadata/tools/docker_server/Dockerfile +++ b/ml_metadata/tools/docker_server/Dockerfile @@ -32,26 +32,36 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ software-properties-common \ git \ python-dev \ - python3-distutils + python3-distutils \ + openjdk-8-jdk # Set up Bazel 3.7.2 ENV BAZEL_VERSION 3.7.2 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=$(arch) && \ + if [ "$arch" = "x86_64" ]; then \ + 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; \ + elif ["$arch" = "ppc64le"]; then \ + 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 https://ftp2.osuosl.org/pub/ppc64el/bazel/ubuntu_18.04/bazel_bin_ppc64le_$BAZEL_VERSION --output /usr/bin/bazel && chmod +x /usr/bin/bazel && \ + cd / && \ + rm -f /bazel/bazel_bin_ppc64le_$BAZEL_VERSION; \ + else \ + echo "Architecture Not Suppoted"; \ + fi 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 \ - --define=grpc_no_ares=true \ + --define=grpc_no_ares=true --jobs=8 \ //ml_metadata/metadata_store:metadata_store_server --cxxopt="-std=c++17" # copying libmysqlclient source onto THIRD_PARTY folder.