Skip to content

Commit

Permalink
[RHOAIENG-11349] - Missing requirements.txt for modelmesh-runtime-ada…
Browse files Browse the repository at this point in the history
…pter component

chore:	Adapt Dockerfile to work on Konflux.

Signed-off-by: Spolti <[email protected]>
  • Loading branch information
spolti committed Sep 2, 2024
1 parent d89a13d commit ffd4900
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ RUN set -eux; \

WORKDIR /opt/app

COPY go.mod go.sum ./

# Install go protoc plugins
# no required module provides package google.golang.org/grpc/cmd/protoc-gen-go-grpc
# to add it run `go get google.golang.org/grpc/cmd/protoc-gen-go-grpc`
Expand All @@ -98,8 +96,6 @@ RUN git init && \
git config --global --add safe.directory "*" && \
rm -rf .git

# Download dependencies before copying the source so they will be cached
RUN go mod download

# the ubi/go-toolset image doesn't define ENTRYPOINT or CMD, but we need it to run 'make develop'
CMD /bin/bash
Expand All @@ -112,6 +108,12 @@ FROM --platform=$BUILDPLATFORM develop AS build

LABEL image="build"

WORKDIR /opt/app

COPY go.mod go.sum ./
# Download dependencies before copying the source so they will be cached
RUN go mod download

# Copy the source
COPY . ./

Expand All @@ -123,9 +125,7 @@ ARG TARGETARCH

# Build the binaries using native go compiler from BUILDPLATFORM but compiled output for TARGETPLATFORM
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
export GOOS=${TARGETOS:-linux} && \
RUN export GOOS=${TARGETOS:-linux} && \
export GOARCH=${TARGETARCH:-amd64} && \
go build -o puller model-serving-puller/main.go && \
go build -o triton-adapter model-mesh-triton-adapter/main.go && \
Expand All @@ -151,21 +151,21 @@ RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
gcc-c++ \
python38-devel \
python38 \
# validates if it still needed in the builder iamge.
nodejs \
&& ln -sf /usr/bin/python3 /usr/bin/python \
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
&& true

# need to upgrade pip and install wheel before installing grpcio, before installing tensorflow on aarch64
# use caching to speed up multi-platform builds
ENV PIP_CACHE_DIR=/root/.cache/pip
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --upgrade pip && \
pip install wheel && \
pip install grpcio && \
RUN pip install grpcio && \
# pin to 3.10.0 to avoid error: libhdf5.so: cannot open shared object file: No such file or directory \
# if not version is set, it will install the 3.11.0 version which, seems that does not have the h5py dependencies \
# for arm yet.
pip install h5py==3.10.0 && \
pip install tensorflow-io-gcs-filesystem==0.34.0 && \
pip install tensorflow

USER ${USER}
Expand Down

0 comments on commit ffd4900

Please sign in to comment.