generated from MicrosoftLearning/mslearn-mlops
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (45 loc) · 1.49 KB
/
04-prod-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Deploy to Azure ML
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Install az ml extension
run: az extension add -n ml -y
- name: Azure login
uses: azure/login@v1
with:
creds: ${{secrets.AZURE_CREDENTIALS}}
- name: Set default environment variables
run: |
az account set --subscription bc61aa17-c60a-46b5-a008-fb2aec96507c
az configure --defaults workspace=diabetes-prod-ws group=RG001
- name: Deploy model to endpoint
run: |
MODEL_NAME="diabetes-prod-model"
ENDPOINT_NAME="diabetes-mlflow-endpoint"
az ml model create \
--name $MODEL_NAME \
--path azureml://jobs/serene_turtle_y0z2nmszp5/outputs/artifacts/src/model/model \ # TODO: Update this path to your model
- name: Create endpoint
run: |
az ml online-endpoint create \ # Change to update
--name "diabetes-mlflow-endpoint" \
--file "src/endpoint.yml" \
- name: Create deployment
run: |
az ml online-deployment create \
--name diabetes-deployment \
--file "src/deploy.yml" \
--all-traffic
- name: Invoke endpoint
run: |
ENDPOINT_NAME="diabetes-mlflow-endpoint"
az ml endpoint invoke \
--name $ENDPOINT_NAME \
--request-file request.json \
--response-file response.json \