Skip to content

Commit

Permalink
update data store path (Azure#2079)
Browse files Browse the repository at this point in the history
* update data store path

* output file

* sleep

* using folder
  • Loading branch information
santiagxf committed Feb 17, 2023
1 parent 008dc62 commit 85f22a1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
26 changes: 12 additions & 14 deletions cli/batch-score-rest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ response=$(curl --location --request POST $SCORING_URI \
\"properties\": {
\"dataset\": {
\"dataInputType\": \"DataUrl\",
\"Path\": \"https://pipelinedata.blob.core.windows.net/sampledata/mnist\"
\"Path\": \"https://azuremlexampledata.blob.core.windows.net/data/mnist/sample\"
}
}
}")
Expand All @@ -251,33 +251,31 @@ response=$(curl --location --request PUT "https://management.azure.com/subscript
\"properties\": {
\"paths\": [
{
\"folder\": \"https://pipelinedata.blob.core.windows.net/sampledata/mnist\"
\"folder\": \"https://azuremlexampledata.blob.core.windows.net/data/mnist/sample\"
}
]
}
}")
#</create_dataset>

#<unique_output>
export OUTPUT_FILE_NAME=predictions_`echo $RANDOM`.csv
#</unique_output>

# <score_endpoint_with_dataset>
response=$(curl --location --request POST $SCORING_URI \
--header "Authorization: Bearer $SCORING_TOKEN" \
--header "Content-Type: application/json" \
--data-raw "{
\"properties\": {
\"dataset\": {
\"dataInputType\": \"DatasetVersion\",
\"datasetName\": \"$DATASET_NAME\",
\"datasetVersion\": \"$DATASET_VERSION\"
\"InputData\": {
\"mnistinput\": {
\"JobInputType\": \"UriFolder\",
\"Uri\": \"azureml://locations/$LOCATION/workspaces/$WORKSPACE/data/$DATASET_NAME/versions/labels/latest\"
}
},
\"outputDataset\": {
\"datastoreId\": \"/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.MachineLearningServices/workspaces/$WORKSPACE/datastores/workspaceblobstore\",
\"path\": \"$ENDPOINT_NAME\"
\"OutputData\": {
\"customOutput\": {
\"JobOutputType\": \"UriFolder\",
\"Uri\": \"azureml://datastores/workspaceblobstore/paths/batch/$ENDPOINT_NAME/$RANDOM/\"
}
},
\"outputFileName\": \"$OUTPUT_FILE_NAME\"
}
}")
# </score_endpoint_with_dataset>
Expand Down
14 changes: 8 additions & 6 deletions cli/batch-score.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ echo "Showing details of the batch deployment"
az ml batch-deployment show --name $DEPLOYMENT_NAME --endpoint-name $ENDPOINT_NAME
# </check_batch_deployment_detail>

sleep 60

echo "Invoking batch endpoint with public URI (MNIST)"
# <start_batch_scoring_job>
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://pipelinedata.blob.core.windows.net/sampledata/mnist --input-type uri_folder --query name -o tsv)
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/mnist/sample --input-type uri_folder --query name -o tsv)
# </start_batch_scoring_job>

echo "Showing job detail"
Expand Down Expand Up @@ -69,13 +71,13 @@ fi
echo "Invoke batch endpoint with specific output file name"
# <start_batch_scoring_job_configure_output_settings>
export OUTPUT_FILE_NAME=predictions_`echo $RANDOM`.csv
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://pipelinedata.blob.core.windows.net/sampledata/mnist --input-type uri_folder --output-path azureml://datastores/workspaceblobstore/paths/$ENDPOINT_NAME --set output_file_name=$OUTPUT_FILE_NAME --query name -o tsv)
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/mnist/sample --input-type uri_folder --output-path azureml://datastores/workspaceblobstore/paths/$ENDPOINT_NAME --set output_file_name=$OUTPUT_FILE_NAME --query name -o tsv)
# </start_batch_scoring_job_configure_output_settings>

echo "Invoke batch endpoint with specific overwrites"
# <start_batch_scoring_job_overwrite>
export OUTPUT_FILE_NAME=predictions_`echo $RANDOM`.csv
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://pipelinedata.blob.core.windows.net/sampledata/mnist --input-type uri_folder --mini-batch-size 20 --instance-count 5 --query name -o tsv)
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/mnist/sample --input-type uri_folder --mini-batch-size 20 --instance-count 5 --query name -o tsv)
# </start_batch_scoring_job_overwrite>

echo "Stream job detail"
Expand Down Expand Up @@ -112,7 +114,7 @@ az ml batch-deployment create --file endpoints/batch/mnist-keras-deployment.yml
echo "Invoke batch endpoint with public data"
# <test_new_deployment>
DEPLOYMENT_NAME="mnist-keras-dpl"
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --deployment-name $DEPLOYMENT_NAME --input https://pipelinedata.blob.core.windows.net/sampledata/mnist --input-type uri_folder --query name -o tsv)
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --deployment-name $DEPLOYMENT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/mnist/sample --input-type uri_folder --query name -o tsv)
# </test_new_deployment>

echo "Show job detail"
Expand Down Expand Up @@ -153,7 +155,7 @@ az ml batch-endpoint show --name $ENDPOINT_NAME --query "{Name:name, Defaults:de

echo "Invoke batch endpoint with the new default deployment with public URI"
# <test_new_default_deployment>
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://pipelinedata.blob.core.windows.net/sampledata/mnist --input-type uri_folder --query name -o tsv)
JOB_NAME=$(az ml batch-endpoint invoke --name $ENDPOINT_NAME --input https://azuremlexampledata.blob.core.windows.net/data/mnist/sample --input-type uri_folder --query name -o tsv)
# </test_new_default_deployment>

echo "Stream job logs to console"
Expand Down Expand Up @@ -196,7 +198,7 @@ RESPONSE=$(curl --location --request POST "$SCORING_URI" \
\"properties\": {
\"dataset\": {
\"dataInputType\": \"DataUrl\",
\"Path\": \"https://pipelinedata.blob.core.windows.net/sampledata/mnist\"
\"Path\": \"https://azuremlexampledata.blob.core.windows.net/data/mnist/sample\"
}
}
}")
Expand Down

0 comments on commit 85f22a1

Please sign in to comment.