diff --git a/vision/automl/edge_container_predict/Dockerfile b/vision/automl/edge_container_predict/Dockerfile new file mode 100644 index 00000000000..b8c66c909c0 --- /dev/null +++ b/vision/automl/edge_container_predict/Dockerfile @@ -0,0 +1,28 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM tensorflow/serving:1.14.0 + +ENV GCS_READ_CACHE_MAX_STALENESS 300 +ENV GCS_STAT_CACHE_MAX_AGE 300 +ENV GCS_MATCHING_PATHS_CACHE_MAX_AGE 300 + +EXPOSE 8500 +EXPOSE 8501 +ENTRYPOINT /usr/bin/tensorflow_model_server \ + --port=8500 \ + --rest_api_port=8501 \ + --model_base_path=/tmp/mounted_model/ \ + --tensorflow_session_parallelism=0 \ + --file_system_poll_wait_seconds=31540000 diff --git a/vision/automl/edge_container_predict/README.md b/vision/automl/edge_container_predict/README.md index d60ad949bee..84116f41394 100644 --- a/vision/automl/edge_container_predict/README.md +++ b/vision/automl/edge_container_predict/README.md @@ -18,10 +18,10 @@ $ PORT=8505 + Step 1. Pull the Docker image. ```bash -# This is a CPU TFServing 1.12.0 with some default settings compiled from +# This is a CPU TFServing 1.14.0 with some default settings compiled from # https://hub.docker.com/r/tensorflow/serving. -$ DOCKER_GCS_DIR=gcr.io/automl-vision-ondevice -$ CPU_DOCKER_GCS_PATH=${DOCKER_GCS_DIR}/gcloud-container-1.12.0:latest +$ DOCKER_GCS_DIR=gcr.io/cloud-devrel-public-resources +$ CPU_DOCKER_GCS_PATH=${DOCKER_GCS_DIR}/gcloud-container-1.14.0:latest $ sudo docker pull ${CPU_DOCKER_GCS_PATH} ``` diff --git a/vision/automl/edge_container_predict/automl_vision_edge_container_predict_test.py b/vision/automl/edge_container_predict/automl_vision_edge_container_predict_test.py index 55414f631a2..f673ada422c 100644 --- a/vision/automl/edge_container_predict/automl_vision_edge_container_predict_test.py +++ b/vision/automl/edge_container_predict/automl_vision_edge_container_predict_test.py @@ -46,7 +46,7 @@ IMAGE_FILE_PATH = os.path.join(os.path.dirname(__file__), 'test.jpg') # The cpu docker gcs path is from 'Edge container tutorial'. CPU_DOCKER_GCS_PATH = '{}'.format( - 'gcr.io/automl-vision-ondevice/gcloud-container-1.12.0:latest') + 'gcr.io/cloud-devrel-public-resources/gcloud-container-1.14.0:latest') # The path of a sample saved model. SAMPLE_SAVED_MODEL = '{}'.format( 'gs://cloud-samples-data/vision/edge_container_predict/saved_model.pb')