Skip to content

Commit 1efc45b

Browse files
committed
Add baseline
1 parent ced4249 commit 1efc45b

File tree

9 files changed

+28662
-0
lines changed

9 files changed

+28662
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
deployment.yaml
3+
/src

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Coding Kitties
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,138 @@
11
# update-azure-machine-learning-endpoint
2+
3+
Github Action to update an Azure Machine Learning Online Endpoint
4+
5+
Features:
6+
7+
* Update the traffic distribution of an Azure Machine Learning Online Endpoint
8+
* Supports blue/green deployments
9+
10+
For other Azure Machine Learning actions check out:
11+
12+
* [create-azure-machine-learning-online-endpoint](https://github.com/coding-kitties/create-azure-machine-learning-online-endpoint)
13+
* [register-azure-machine-learning-model](https://github.com/coding-kitties/register-azure-machine-learning-model)
14+
* [update-azure-machine-learning-online-deployment](https://github.com/coding-kitties/update-azure-machine-learning-online-deploymentl)
15+
* [delete-azure-machine-learning-online-deployment](https://github.com/coding-kitties/delete-azure-machine-learning-online-deployment)
16+
17+
## Dependencies on other Github Actions
18+
19+
* Authenticate using [Azure Login](https://github.com/Azure/login)
20+
21+
## 🚀 Usage
22+
23+
### **1. Add to Your Workflow**
24+
25+
```yaml
26+
jobs:
27+
deploy:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2.3.2
31+
32+
- uses: Azure/login@v1
33+
with:
34+
creds: ${{ secrets.AZURE_CREDENTIALS }}
35+
36+
- name: Create AML Online Endpoint
37+
uses: coding-kitties/update-azure-machine-learning-online-endpoint@v0.1.0
38+
with:
39+
resource_group: "my-resource-group"
40+
workspace_name: "my-aml-workspace"
41+
endpoint_name: "my-endpoint"
42+
traffic: '{ "blue": 80, "green": 20, mirror": {"green": 80} }'
43+
```
44+
45+
## Example deployment of an Azure Machine Learning Workflow with blue/green deployments
46+
47+
This example demonstrates an Azure Machine Learning Deployment with blue/green deployments for different environments. We use various Github Actions to create a complete workflow.
48+
49+
```yaml
50+
jobs:
51+
deploy:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2.3.2
55+
56+
- uses: Azure/login@v1
57+
with:
58+
creds: ${{ secrets.AZURE_CREDENTIALS }}
59+
60+
# Move model into dev registry (Will be skipped if it already exists)
61+
- name: Register model in registry
62+
uses: coding-kitties/register-azure-machine-learning-model@v0.1.0
63+
with:
64+
model_name: 'model-name'
65+
model_version: '1'
66+
source_registry_name: 'playground-registry'
67+
source_registry_resource_group: 'my-registry-resource-group'
68+
destination_registry_name: 'playground-registry'
69+
destination_registry_resource_group: 'my-registry-resource-group'
70+
71+
# Create AML Online Endpoint in DEV (Will be skipped if it already exists)
72+
- name: Create AML Online Endpoint DEV
73+
uses: coding-kitties/create-azure-machine-learning-online-endpoint@v0.3.0
74+
with:
75+
endpoint_name: 'dev-endpoint'
76+
resource_group: 'dev-group'
77+
workspace_name: 'dev-workspace'
78+
79+
# Deploy the new green model to DEV
80+
- name: Create AML Online Endpoint Deployment DEV
81+
uses: coding-kitties/create-azure-machine-learning-online-deployment@v0.3.0
82+
with:
83+
endpoint_name: 'dev-endpoint'
84+
resource_group: 'dev-group'
85+
workspace_name: 'dev-workspace'
86+
deployment_yaml_file_path: 'path/to/deployment.yml'
87+
model_name: 'model-name'
88+
model_version: '1'
89+
traffic: '{ "green": 0, "blue": 100, mirror": {"green": 20} }'
90+
91+
# Update green deployment traffic in DEV
92+
- name: Update AML Online Endpoint Deployment traffic
93+
uses: coding-kitties/update-azure-machine-learning-online-deployment@v0.1.0
94+
with:
95+
endpoint_name: 'my-endpoint'
96+
workspace_name: 'my-workspace'
97+
resource_group: 'my-resource-group'
98+
traffic: '{ "green": 100, "blue": 0, mirror": {"green": 0} }'
99+
100+
- name: Delete AML Online Endpoint Deployment DEV
101+
uses: coding-kitties/delete-azure-machine-learning-online-deployment@v0.1.0
102+
with:
103+
endpoint_name: 'dev-endpoint'
104+
resource_group: 'dev-group'
105+
workspace_name: 'dev-workspace'
106+
deployment_name: 'blue'
107+
108+
# Move model to production registy
109+
- name: Move model to production registry
110+
uses: coding-kitties/register-azure-machine-learning-model@v0.1.0
111+
with:
112+
model_name: 'model-name'
113+
model_version: '1'
114+
source_registry_name: 'playground-registry'
115+
source_registry_resource_group: 'my-registry-resource-group'
116+
destination_registry_name: 'production-registry'
117+
destination_registry_resource_group: 'my-registry-resource-group'
118+
119+
# Create AML Online Endpoint in PROD (Will be skipped if it already exists)
120+
- name: Create AML Online Endpoint PROD
121+
uses: coding-kitties/create-azure-machine-learning-online-endpoint@v0.3.0
122+
with:
123+
endpoint_name: 'prod-endpoint'
124+
resource_group: 'prod-group'
125+
workspace_name: 'prod-workspace'
126+
127+
# Deploy the new green model to PROD
128+
- name: Create AML Online Endpoint Deployment PROD
129+
uses: coding-kitties/create-azure-machine-learning-online-deployment@v0.3.0
130+
with:
131+
endpoint_name: 'prod-endpoint'
132+
resource_group: 'prod-group'
133+
workspace_name: 'prod-workspace'
134+
deployment_yaml_file_path: 'path/to/deployment.yml'
135+
model_name: 'model-name'
136+
model_version: '1'
137+
traffic: '{ "green": 0, "blue": 100, mirror": {"green": 20} }'
138+
```

action.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Update Azure Machine Learning Endpoint'
2+
description: 'Update an Azure Machine Learning Endpoint'
3+
author: 'Marc van Duyn'
4+
branding:
5+
icon: 'cloud'
6+
color: 'blue'
7+
8+
inputs:
9+
endpoint_name:
10+
description: 'Name of the endpoint'
11+
required: true
12+
resource_group:
13+
description: 'Azure Resource Group'
14+
required: true
15+
workspace_name:
16+
description: 'Azure ML Workspace Name'
17+
required: true
18+
traffic:
19+
description: 'Traffic'
20+
required: false
21+
22+
runs:
23+
using: "node20"
24+
main: "dist/index.js"

0 commit comments

Comments
 (0)