Skip to content

Commit

Permalink
Enhance hard code for export dir in deploy component
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchihe committed Feb 13, 2019
1 parent 7c633a9 commit 9992bd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions components/kubeflow/deployer/src/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/tfx/taxi-cab-classification-pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
)
Expand Down

0 comments on commit 9992bd0

Please sign in to comment.