4
4
export ENDPOINT_NAME=" <YOUR_ENDPOINT_NAME>"
5
5
# </set_variables>
6
6
7
+ # <name_endpoint>
8
+ ENDPOINT_NAME=" heart-classifier-custom"
9
+ # </name_endpoint>
10
+
7
11
# The following code ensures the created deployment has a unique name
8
12
ENDPOINT_SUFIX=$( cat /dev/urandom | tr -dc ' a-zA-Z0-9' | fold -w ${1:- 5} | head -n 1)
9
- ENDPOINT_NAME=" heart-classifier -$ENDPOINT_SUFIX "
13
+ ENDPOINT_NAME=" $ENDPOINT_NAME -$ENDPOINT_SUFIX "
10
14
11
15
# <register_model>
12
16
MODEL_NAME=' heart-classifier-sklpipe'
@@ -19,30 +23,30 @@ az ml compute create -n batch-cluster --type amlcompute --min-instances 0 --max-
19
23
# </create_compute>
20
24
21
25
echo " Creating batch endpoint $ENDPOINT_NAME "
22
- # <create_batch_endpoint >
26
+ # <create_endpoint >
23
27
az ml batch-endpoint create -n $ENDPOINT_NAME -f endpoint.yml
24
- # </create_batch_endpoint>
28
+ # </create_endpoint>
29
+
30
+ echo " Showing details of the batch endpoint"
31
+ # <query_endpoint>
32
+ az ml batch-endpoint show --name $ENDPOINT_NAME
33
+ # </query_endpoint>
25
34
26
35
echo " Creating batch deployment $DEPLOYMENT_NAME for endpoint $ENDPOINT_NAME "
27
- # <create_batch_deployment_set_default >
36
+ # <create_deployment >
28
37
az ml batch-deployment create --file deployment.yml --endpoint-name $ENDPOINT_NAME --set-default
29
- # </create_batch_deployment_set_default >
38
+ # </create_deployment >
30
39
31
40
echo " Update the batch deployment as default for the endpoint"
32
- # <update_default_deployment >
41
+ # <set_default_deployment >
33
42
DEPLOYMENT_NAME=" classifier-xgboost-custom"
34
43
az ml batch-endpoint update --name $ENDPOINT_NAME --set defaults.deployment_name=$DEPLOYMENT_NAME
35
- # </update_default_deployment>
36
-
37
- echo " Showing details of the batch endpoint"
38
- # <check_batch_endpooint_detail>
39
- az ml batch-endpoint show --name $ENDPOINT_NAME
40
- # </check_batch_endpooint_detail>
44
+ # </set_default_deployment>
41
45
42
46
echo " Showing details of the batch deployment"
43
- # <check_batch_deployment_detail >
47
+ # <query_deployment >
44
48
az ml batch-deployment show --name $DEPLOYMENT_NAME --endpoint-name $ENDPOINT_NAME
45
- # </check_batch_deployment_detail >
49
+ # </query_deployment >
46
50
47
51
echo " Invoking batch endpoint"
48
52
# <start_batch_scoring_job>
@@ -60,9 +64,9 @@ az ml batch-deployment list-jobs --name $DEPLOYMENT_NAME --endpoint-name $ENDPOI
60
64
# </list_all_jobs>
61
65
62
66
echo " Stream job logs to console"
63
- # <stream_job_logs_to_console >
67
+ # <stream_job_logs >
64
68
az ml job stream -n $JOB_NAME
65
- # </stream_job_logs_to_console >
69
+ # </stream_job_logs >
66
70
67
71
# <check_job_status>
68
72
STATUS=$( az ml job show -n $JOB_NAME --query status -o tsv)
81
85
# </check_job_status>
82
86
83
87
echo " Download scores to local path"
84
- # <download_scores >
88
+ # <download_outputs >
85
89
az ml job download --name $JOB_NAME --output-name score --download-path ./
86
- # </download_scores >
90
+ # </download_outputs >
87
91
88
92
echo " Delete resources"
89
93
# <delete_endpoint>
0 commit comments