forked from google/ml-metadata
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix MLMD build on Fedora Signed-off-by: Andrea Lamparelli <[email protected]> * Revert zetasql upgrade and switch to ubi8 (#2) --------- Signed-off-by: Andrea Lamparelli <[email protected]>
- Loading branch information
Showing
7 changed files
with
169 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Ignore bazel target dirs | ||
bazel-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
FROM fedora:38 as builder | ||
|
||
RUN dnf update -y && \ | ||
dnf install -y \ | ||
which \ | ||
patch \ | ||
gcc \ | ||
clang \ | ||
cmake \ | ||
make \ | ||
musl-devel \ | ||
openssl \ | ||
curl \ | ||
ca-certificates \ | ||
unzip \ | ||
git \ | ||
python-is-python3 \ | ||
python3-devel | ||
|
||
# Set up Bazel 5.3.0 | ||
ENV BAZEL_VERSION 5.3.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 | ||
|
||
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 \ | ||
//ml_metadata/metadata_store:metadata_store_server \ | ||
--cxxopt="-std=c++17" --host_cxxopt="-std=c++17" | ||
|
||
# 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 | ||
|
||
FROM fedora:38 | ||
|
||
COPY --from=builder /mlmd-src/bazel-bin/ml_metadata/metadata_store/metadata_store_server /bin/metadata_store_server | ||
COPY --from=builder /mlmd-src/third_party /mlmd-src/third_party | ||
|
||
ENV GRPC_PORT "8080" | ||
ENV METADATA_STORE_SERVER_CONFIG_FILE "" | ||
|
||
# Introduces tzdata package here to avoid LoadTimeZone check failed error in the metadata store server. | ||
RUN dnf update -y && \ | ||
dnf install -y \ | ||
tzdata | ||
|
||
ENTRYPOINT \ | ||
"/bin/metadata_store_server" \ | ||
"--grpc_port=${GRPC_PORT}" \ | ||
"--metadata_store_server_config_file=${METADATA_STORE_SERVER_CONFIG_FILE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
FROM registry.access.redhat.com/ubi8/ubi:8.9 as builder | ||
|
||
USER root | ||
|
||
RUN dnf update -y -q && \ | ||
dnf install -y -q \ | ||
which \ | ||
patch \ | ||
gcc \ | ||
clang \ | ||
cmake \ | ||
make \ | ||
openssl \ | ||
ca-certificates \ | ||
unzip \ | ||
git \ | ||
findutils \ | ||
python3 | ||
|
||
# Set up Bazel 5.3.0 | ||
ENV BAZEL_VERSION 5.3.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 | ||
|
||
|
||
COPY . /mlmd-src | ||
WORKDIR /mlmd-src | ||
|
||
# Running in offline mode with --nofetch arg, cache and deps must be cloned | ||
# into the local root bazel cache | ||
# "-std=c++17" is needed in order to build with ZetaSQL. | ||
RUN bazel build -c opt --action_env=PATH \ | ||
--define=grpc_no_ares=true \ | ||
//ml_metadata/metadata_store:metadata_store_server \ | ||
--cxxopt="-std=c++17" --host_cxxopt="-std=c++17" | ||
|
||
# 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 | ||
|
||
FROM registry.redhat.io/ubi8/ubi-minimal:8.9 | ||
|
||
COPY --from=builder /mlmd-src/bazel-bin/ml_metadata/metadata_store/metadata_store_server /bin/metadata_store_server | ||
COPY --from=builder /mlmd-src/third_party /mlmd-src/third_party | ||
|
||
ENV GRPC_PORT "8080" | ||
ENV METADATA_STORE_SERVER_CONFIG_FILE "" | ||
|
||
# Introduces tzdata package here to avoid LoadTimeZone check failed error in the metadata store server. | ||
RUN microdnf update -y && \ | ||
microdnf install -y \ | ||
tzdata | ||
|
||
ENTRYPOINT \ | ||
"/bin/metadata_store_server" \ | ||
"--grpc_port=${GRPC_PORT}" \ | ||
"--metadata_store_server_config_file=${METADATA_STORE_SERVER_CONFIG_FILE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
Files for building the [Docker](http://www.docker.com) image for running the | ||
MLMD gRPC server. | ||
|
||
To build a docker image, run | ||
### Ubuntu | ||
|
||
To build a docker image from Ubuntu, run | ||
`./ml_metadata/tools/docker_server/build_docker_image.sh` under root directory | ||
of github checkout. | ||
|
||
### Fedora 38 and UBI9 | ||
|
||
To build from Fedora image, run | ||
`DOCKER_FILE=Dockerfile.fedora ./ml_metadata/tools/docker_server/build_docker_image.sh` under root directory | ||
|
||
Assure the `ZETASQL_COMMIT` == `f764f4e986ac1516ab5ae95e6d6ce2f4416cc6ff` in WORKSPACE file | ||
|
||
### Fedora 39 and UBI8 | ||
|
||
To build from RedHat UBI image, run | ||
`DOCKER_FILE=Dockerfile.redhat ./ml_metadata/tools/docker_server/build_docker_image.sh` under root directory | ||
|
||
Assure the `ZETASQL_COMMIT` == `ac37cf5c0d80b5605176fc0f29e87b12f00be693` in WORKSPACE file |