Fix building CI image for TF serving and Openvino
This commit is contained in:
		
							parent
							
								
									edaf2374b0
								
							
						
					
					
						commit
						17e86e87d0
					
				| @ -209,6 +209,10 @@ jobs: | |||||||
|         tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu18.04-python |         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: |   Build_tf_serving_image: | ||||||
|     runs-on: ubuntu-18.04 |     runs-on: ubuntu-18.04 | ||||||
|     if: github.event.inputs.image_name == 'tf_serving' |     if: github.event.inputs.image_name == 'tf_serving' | ||||||
| @ -249,7 +253,7 @@ jobs: | |||||||
|       uses: docker/build-push-action@v2 |       uses: docker/build-push-action@v2 | ||||||
|       with: |       with: | ||||||
|         context: . |         context: . | ||||||
|         file: ./tools/docker/ci/Dockerfile.tf_serving |         file: ./tools/docker/ci/Dockerfile.tf_serving_occlum | ||||||
|         platforms: linux/amd64 |         platforms: linux/amd64 | ||||||
|         build-args: | |         build-args: | | ||||||
|           "OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}" |           "OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}" | ||||||
|  | |||||||
| @ -28,7 +28,7 @@ build_opencv() { | |||||||
|       -DBUILD_opencv_python=OFF -DBUILD_PYTHON_SUPPORT=OFF \ |       -DBUILD_opencv_python=OFF -DBUILD_PYTHON_SUPPORT=OFF \ | ||||||
|       -DBUILD_EXAMPLES=OFF -DWITH_FFMPEG=OFF \ |       -DBUILD_EXAMPLES=OFF -DWITH_FFMPEG=OFF \ | ||||||
|       -DWITH_QT=OFF -DWITH_CUDA=OFF |       -DWITH_QT=OFF -DWITH_CUDA=OFF | ||||||
|     make -j |     make -j4 | ||||||
|     sudo make install |     sudo make install | ||||||
|     popd |     popd | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| ARG OCCLUM_VERSION |  | ||||||
| 
 |  | ||||||
| FROM tensorflow/serving:latest-devel as binary_build | FROM tensorflow/serving:latest-devel as binary_build | ||||||
|  | LABEL maintainer="Zehuan Li <lizehuan.lzh@antgroup.com>" | ||||||
| WORKDIR /tensorflow-serving | WORKDIR /tensorflow-serving | ||||||
| # Build, and install TensorFlow Serving | # Build, and install TensorFlow Serving | ||||||
| ARG TF_SERVING_BUILD_OPTIONS="--config=nativeopt" | 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 && \ |     /tmp/pip/tensorflow_serving_api-*.whl && \ | ||||||
|     rm -rf /tmp/pip |     rm -rf /tmp/pip | ||||||
| 
 | 
 | ||||||
| FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base | RUN cp -r /usr/local/bin/tensorflow_model_server /root/tensorflow_model_server | ||||||
| LABEL maintainer="Zehuan Li <lizehuan.lzh@antgroup.com>" |  | ||||||
| 
 | 
 | ||||||
| WORKDIR /root | 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 |  | ||||||
| 
 |  | ||||||
							
								
								
									
										22
									
								
								tools/docker/ci/Dockerfile.tf_serving_occlum
									
									
									
									
									
										Normal file
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										22
									
								
								tools/docker/ci/Dockerfile.tf_serving_occlum
									
									
									
									
									
										Normal file
									
								
							| @ -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 | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user