From c73649c2b6db26bf9307bedab6ed01bae14db26d Mon Sep 17 00:00:00 2001 From: Mohammadi Iram <89964724+MohammadiIram@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:20:07 +0530 Subject: [PATCH] Create Dockerfile.konflux --- Dockerfile.konflux | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Dockerfile.konflux diff --git a/Dockerfile.konflux b/Dockerfile.konflux new file mode 100644 index 000000000..cb3c73a63 --- /dev/null +++ b/Dockerfile.konflux @@ -0,0 +1,72 @@ +FROM quay.io/bcook/bazel:ubi8-bazel-5 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 + +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:latest + +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 reinstall -y \ + tzdata + +EXPOSE ${GRPC_PORT} + +CMD \ + "/bin/metadata_store_server" \ + "--grpc_port=${GRPC_PORT}" \ + "--metadata_store_server_config_file=${METADATA_STORE_SERVER_CONFIG_FILE}" + + +ENTRYPOINT \ + "/bin/metadata_store_server" \ + "--grpc_port=${GRPC_PORT}" \ + "--metadata_store_server_config_file=${METADATA_STORE_SERVER_CONFIG_FILE}" + +LABEL com.redhat.component="odh-mlmd-grpc-server-container" \ + name="managed-open-data-hub/odh-mlmd-grpc-server-container-rhel8" \ + version="${CI_CONTAINER_VERSION}" \ + git.url="${CI_ML_METADATA_UPSTREAM_URL}" \ + git.commit="${CI_ML_METADATA_UPSTREAM_COMMIT}" \ + summary="odh-mlmd-grpc-server" \ + io.openshift.expose-services="" \ + io.k8s.display-name="odh-mlmd-grpc-server" \ + io.openshift.tags="odh-mlmd-grpc-server" \ + maintainer="['managed-open-data-hub@redhat.com']" \ + description="Sidecar container for recording and retrieving metadata associated with ML developer and data scientist workflows" \ + com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"