From 114fd3c1313526d5a67cc10532abc0e33f85df10 Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Mon, 19 Feb 2024 17:57:19 +0100 Subject: [PATCH] ci: add UBI mlmd server build workflow (#3) --- .github/workflows/build.yaml | 31 +++++++++++++++++++ .../tools/docker_server/Dockerfile.redhat | 3 +- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..90b09f3f0 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,31 @@ +name: Container Image Build +on: + pull_request: + paths-ignore: + - 'LICENSE*' + - '**.gitignore' + - '**.md' + - '**.txt' + - '.github/ISSUE_TEMPLATE/**' + - '.github/dependabot.yml' + - 'docs/**' + +jobs: + build-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Generate Tag + shell: bash + id: tags + run: | + commit_sha=${{ github.event.after }} + tag=main-${commit_sha:0:7} + echo "tag=${tag}" >> $GITHUB_OUTPUT + - name: Build Image + shell: bash + env: + DOCKER_IMAGE_REPO: quay.io/opendatahub/mlmd-grpc-server + DOCKER_IMAGE_TAG: ${{ steps.tags.outputs.tag }} + DOCKER_FILE: Dockerfile.redhat + run: ./ml_metadata/tools/docker_server/build_docker_image.sh \ No newline at end of file diff --git a/ml_metadata/tools/docker_server/Dockerfile.redhat b/ml_metadata/tools/docker_server/Dockerfile.redhat index 3b2298c4c..6edc57af5 100644 --- a/ml_metadata/tools/docker_server/Dockerfile.redhat +++ b/ml_metadata/tools/docker_server/Dockerfile.redhat @@ -29,7 +29,6 @@ RUN mkdir /bazel && \ cd / && \ rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh - COPY . /mlmd-src WORKDIR /mlmd-src @@ -45,7 +44,7 @@ RUN bazel build -c opt --action_env=PATH \ 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 +FROM registry.access.redhat.com/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