Fix building CI image for TF serving and Openvino

This commit is contained in:
Hui, Chunyang 2021-09-27 06:58:38 +00:00 committed by Zongmin.Gu
parent edaf2374b0
commit 17e86e87d0
4 changed files with 31 additions and 22 deletions

@ -209,6 +209,10 @@ jobs:
tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu18.04-python
# TODO: Add actions to build tf_serving_base image.
# Building TF serving demo image needs a lot of time which exceeds the maximum time limit for a jong of GitHub Actions.
# Thus dividing into two jobs.
Build_tf_serving_image:
runs-on: ubuntu-18.04
if: github.event.inputs.image_name == 'tf_serving'
@ -249,7 +253,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./tools/docker/ci/Dockerfile.tf_serving
file: ./tools/docker/ci/Dockerfile.tf_serving_occlum
platforms: linux/amd64
build-args: |
"OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}"

@ -28,7 +28,7 @@ build_opencv() {
-DBUILD_opencv_python=OFF -DBUILD_PYTHON_SUPPORT=OFF \
-DBUILD_EXAMPLES=OFF -DWITH_FFMPEG=OFF \
-DWITH_QT=OFF -DWITH_CUDA=OFF
make -j
make -j4
sudo make install
popd
}

@ -1,6 +1,5 @@
ARG OCCLUM_VERSION
FROM tensorflow/serving:latest-devel as binary_build
LABEL maintainer="Zehuan Li <lizehuan.lzh@antgroup.com>"
WORKDIR /tensorflow-serving
# Build, and install TensorFlow Serving
ARG TF_SERVING_BUILD_OPTIONS="--config=nativeopt"
@ -32,22 +31,6 @@ RUN bazel build -j 8 --color=yes --curses=yes \
/tmp/pip/tensorflow_serving_api-*.whl && \
rm -rf /tmp/pip
FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base
LABEL maintainer="Zehuan Li <lizehuan.lzh@antgroup.com>"
RUN cp -r /usr/local/bin/tensorflow_model_server /root/tensorflow_model_server
WORKDIR /root
COPY --from=binary_build /usr/local/bin/tensorflow_model_server /root/tensorflow_model_server
ARG OCCLUM_BRANCH
RUN apt-get update && apt-get install git && \
git clone -b $OCCLUM_BRANCH git://github.com/occlum/occlum.git && \
cd occlum && \
cd demos/tensorflow/tensorflow_serving && \
./prepare_model_and_env.sh && \
cd client && \
./prepare_client_env.sh && \
mv ../resnet50-v15-fp32/ /root && \
rm -rf /root/occlum
WORKDIR /root

@ -0,0 +1,22 @@
ARG OCCLUM_VERSION
FROM occlumbackup/occlum:latest-ubuntu18.04-tf_serving_base as binary_build
WORKDIR /root
FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base
LABEL maintainer="Chunyang Hui <sanqian.hcy@antgroup.com>"
WORKDIR /root
COPY --from=binary_build /root/tensorflow_model_server /root/tensorflow_model_server
ARG OCCLUM_BRANCH
RUN apt-get update && apt-get install git && \
git clone -b $OCCLUM_BRANCH git://github.com/occlum/occlum.git && \
cd occlum && \
cd demos/tensorflow/tensorflow_serving && \
./prepare_model_and_env.sh && \
cd client && \
./prepare_client_env.sh && \
mv ../resnet50-v15-fp32/ /root && \
rm -rf /root/occlum
WORKDIR /root