Skip to content

Commit

Permalink
Rename and define models for ncd MOE script (#2237)
Browse files Browse the repository at this point in the history
* rename models for ncd scenario

* fix lightgbm model name

---------

Co-authored-by: Aishani Bhalla <aibhalla@microsoft.com>
  • Loading branch information
aishanibhalla and aibhalla committed Apr 28, 2023
1 parent edf201a commit 2368652
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions cli/deploy-managed-online-endpoint-ncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ export ENDPOINT_NAME="<YOUR_ENDPOINT_NAME>"

# endpoint name
export ENDPOINT_NAME=endpt-ncd-`echo $RANDOM`
AML_MODEL_NAME=mir-sample-sklearn-ncd-model
echo $AML_MODEL_NAME

AML_SKLEARN_MODEL_NAME=mir-sample-sklearn-ncd-model
echo $AML_SKLEARN_MODEL_NAME

AML_LIGHTGBM_MODEL_NAME=mir-sample-lightgbm-ncd-model
echo $AML_LIGHTGBM_MODEL_NAME

# <create_endpoint>
az ml online-endpoint create --name $ENDPOINT_NAME -f endpoints/online/ncd/create-endpoint.yaml
Expand All @@ -24,8 +28,10 @@ else
exit 1
fi

# cleanup of existing model
model_archive=$(az ml model archive -n $AML_MODEL_NAME --version 1 || true)
# cleanup of existing models
model_archive=$(az ml model archive -n $AML_SKLEARN_MODEL_NAME --version 1 || true)
model_archive=$(az ml model archive -n $AML_LIGHTGBM_MODEL_NAME --version 1 || true)


# <create_sklearn_deployment>
az ml online-deployment create --name sklearn-deployment --endpoint $ENDPOINT_NAME -f endpoints/online/ncd/sklearn-deployment.yaml --all-traffic
Expand Down Expand Up @@ -63,8 +69,9 @@ fi
az ml online-endpoint invoke --name $ENDPOINT_NAME --deployment lightgbm-deployment --request-file endpoints/online/ncd/sample-request-lightgbm.json
# </test_lightgbm_deployment>

# cleanup of model
model_archive=$(az ml model archive -n $AML_MODEL_NAME --version 1 || true)
# cleanup of models
model_archive=$(az ml model archive -n $AML_SKLEARN_MODEL_NAME --version 1 || true)
model_archive=$(az ml model archive -n $AML_LIGHTGBM_MODEL_NAME --version 1 || true)

# <delete_endpoint>
az ml online-endpoint delete --name $ENDPOINT_NAME --yes
Expand Down
2 changes: 1 addition & 1 deletion cli/endpoints/online/ncd/lightgbm-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $schema: https://azuremlschemas.azureedge.net/latest/managedOnlineDeployment.sch
name: lightgbm-deployment
endpoint_name: my-endpoint
model:
name: mir-sample-lightgbm-mlflow-model
name: mir-sample-lightgbm-ncd-model
version: 1
path: lightgbm-iris/model
type: mlflow_model
Expand Down

0 comments on commit 2368652

Please sign in to comment.