Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ http_archive(
build_file = "//ml_metadata:postgresql.BUILD",
workspace_file_content = "//ml_metadata:postgresql.WORKSPACE",
sha256 = "1cb8e3a59861be5175878159fc3a41240c379e9aabaabba8288e6cfd6980fff0",
patches = ["//ml_metadata/third_party:postgresql.patch"],
strip_prefix = "postgresql-12.17",
urls = [
"https://ftp.postgresql.org/pub/source/v12.17/postgresql-12.17.tar.gz",
Expand Down Expand Up @@ -52,10 +53,10 @@ http_archive(

http_archive(
name = "boringssl",
sha256 = "f69738ca17f1dd30ae3ddb1fa7519245044737d27c8a3defa7a94718d9dfd724",
strip_prefix = "boringssl-68dcc7f7b816e199c8f373ea0a2d6a4e1f526e2d",
sha256 = "579cb415458e9f3642da0a39a72f79fdfe6dc9c1713b3a823f1e276681b9703e",
strip_prefix = "boringssl-648cbaf033401b7fe7acdce02f275b06a88aab5c",
urls = [
"https://github.com/google/boringssl/archive/68dcc7f7b816e199c8f373ea0a2d6a4e1f526e2d.tar.gz",
"https://github.com/google/boringssl/archive/648cbaf033401b7fe7acdce02f275b06a88aab5c.tar.gz",
],
)

Expand Down
2 changes: 2 additions & 0 deletions ml_metadata/metadata_store/metadata_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
types can be created on the fly.
"""

from absl import flags
flags.FLAGS(['pytest'])
import enum
import random
import time
Expand Down
37 changes: 37 additions & 0 deletions ml_metadata/third_party/postgresql.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git src/port/pg_bitutils.c src/port/pg_bitutils.c
index 7847e8a..17714af 100644
--- src/port/pg_bitutils.c
+++ src/port/pg_bitutils.c
@@ -12,12 +12,14 @@
*/
#include "c.h"

+#if !defined(__ppc__) && !defined(__PPC__) && !defined(__ppc64__) && !defined(__PPC64__)
#ifdef HAVE__GET_CPUID
#include <cpuid.h>
#endif
#ifdef HAVE__CPUID
#include <intrin.h>
#endif
+#endif

#include "port/pg_bitutils.h"

@@ -141,6 +143,7 @@ int (*pg_popcount64) (uint64 word) = pg_popcount64_slow;
static bool
pg_popcount_available(void)
{
+#if !defined(__ppc__) && !defined(__PPC__) && !defined(__ppc64__) && !defined(__PPC64__)
unsigned int exx[4] = {0, 0, 0, 0};

#if defined(HAVE__GET_CPUID)
@@ -152,6 +155,9 @@ pg_popcount_available(void)
#endif

return (exx[2] & (1 << 23)) != 0; /* POPCNT */
+#else
+ return false;
+#endif
}

/*
39 changes: 34 additions & 5 deletions ml_metadata/tools/docker_server/Dockerfile.konflux
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,59 @@ RUN dnf install -y -q \
git \
findutils \
python3

RUN arch=$(uname -m) && \
echo "Detected architecture: $arch" && \
if [ "$arch" = "ppc64le" ]; then \
echo "Setting up for ppc64le..." && \
dnf install -y -q java-11-openjdk-devel wget; \
fi


# Set environment for Bazel and Java
ENV JAVA_HOME=/usr/lib/jvm/java-11
ENV PATH=$JAVA_HOME/bin:$PATH
ENV BAZEL_VERSION=5.3.0
ENV BAZEL_JOBS=8

# Set up Bazel 5.3.0
ENV BAZEL_VERSION 5.3.0
WORKDIR /
RUN mkdir /bazel && \

RUN arch=$(uname -m) && \
if [ "$arch" = "ppc64le" ]; then \
echo "Setting up for ppc64le..." && \
wget https://ftp2.osuosl.org/pub/ppc64el/bazel/el8/bazel-${BAZEL_VERSION} && \
chmod +x bazel-${BAZEL_VERSION} && \
mv bazel-${BAZEL_VERSION} /usr/local/bin/bazel && \
ln -s /usr/local/bin/bazel /usr/bin/bazel && \
bazel --version; \
elif [ "$arch" = "x86_64" ]; then \
echo "Setting up for x86_64..." && \
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
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh; \
else \
echo "Unsupported architecture: $arch" >&2 && \
exit 1; \
fi


COPY . /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 \
--copt="-Wno-maybe-uninitialized" \
--jobs=${BAZEL_JOBS} \
//ml_metadata/metadata_store:metadata_store_server \
--cxxopt="-std=c++17" --host_cxxopt="-std=c++17" \
--verbose_failures


# copying libmysqlclient source onto THIRD_PARTY folder.
RUN mkdir -p /mlmd-src/third_party
RUN cp -RL /mlmd-src/bazel-mlmd-src/external/libmysqlclient /mlmd-src/third_party/mariadb-connector-c
Expand Down
1 change: 1 addition & 0 deletions ml_metadata/tools/docker_server/Dockerfile.redhat
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ 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 \
--copt="-Wno-maybe-uninitialized" \
//ml_metadata/metadata_store:metadata_store_server \
--cxxopt="-std=c++17" --host_cxxopt="-std=c++17"

Expand Down