From 9992bd075210d43465b6ed686bbe38c86b3690e8 Mon Sep 17 00:00:00 2001 From: Jin Chi He Date: Wed, 13 Feb 2019 19:30:25 +0800 Subject: [PATCH] Enhance hard code for export dir in deploy component --- components/kubeflow/deployer/src/deploy.sh | 10 +++++----- samples/tfx/taxi-cab-classification-pipeline.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/kubeflow/deployer/src/deploy.sh b/components/kubeflow/deployer/src/deploy.sh index 2d469c176440..0d87f5deb923 100755 --- a/components/kubeflow/deployer/src/deploy.sh +++ b/components/kubeflow/deployer/src/deploy.sh @@ -21,9 +21,9 @@ SERVER_NAME="${SERVER_NAME:-model-server}" while (($#)); do case $1 in - "--model-path") + "--model-export-path") shift - MODEL_PATH="$1" + MODEL_EXPORT_PATH="$1" shift ;; "--cluster-name") @@ -53,12 +53,12 @@ while (($#)); do esac done -if [ -z "${MODEL_PATH}" ]; then +if [ -z "${MODEL_EXPORT_PATH}" ]; then echo "You must specify a path to the saved model" exit 1 fi -echo "Deploying the model '${MODEL_PATH}'" +echo "Deploying the model '${MODEL_EXPORT_PATH}'" if [ -z "${CLUSTER_NAME}" ]; then CLUSTER_NAME=$(wget -q -O- --header="Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/attributes/cluster-name) @@ -98,7 +98,7 @@ ks pkg install kubeflow/tf-serving@${KUBEFLOW_VERSION} echo "Generating the TF Serving config..." ks generate tf-serving server --name="${SERVER_NAME}" -ks param set server modelPath "${MODEL_PATH}/export/export" +ks param set server modelPath "${MODEL_EXPORT_PATH}" # support local storage to deploy tf-serving. if [ -n "${PVC_NAME}" ];then diff --git a/samples/tfx/taxi-cab-classification-pipeline.py b/samples/tfx/taxi-cab-classification-pipeline.py index 754f7841617f..b7d1a7fbfb1c 100755 --- a/samples/tfx/taxi-cab-classification-pipeline.py +++ b/samples/tfx/taxi-cab-classification-pipeline.py @@ -132,7 +132,7 @@ def kubeflow_deploy_op(model: 'TensorFlow model', tf_server_name, step_name='dep name = step_name, image = 'gcr.io/ml-pipeline/ml-pipeline-kubeflow-deployer:5df2cdc1ed145320204e8bc73b59cdbd7b3da28f', arguments = [ - '--model-path', model, + '--model-export-path', '%s/export/export' % model, '--server-name', tf_server_name ] )