Skip to content

Commit b5e0f8b

Browse files
committed
Add baseline
1 parent d90a245 commit b5e0f8b

File tree

7 files changed

+754
-1
lines changed

7 files changed

+754
-1
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+
/model

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: 140 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,140 @@
1-
# register-azure-machine-learning-model
1+
# register-azure-machine-learning-model-to-workspace
2+
3+
Github Action to register an Azure Machine Learning Model in a workspace.
4+
5+
Features:
6+
7+
* Register a model in an Azure Machine Learning workspace
8+
* Move a model between registries
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+
* [create-azure-machine-learning-online-deployment](https://github.com/coding-kitties/create-azure-machine-learning-online-deployment)
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: Register model in registry
37+
uses: coding-kitties/register-azure-machine-learning-model@v0.1.0
38+
with:
39+
model_name: 'model-name'
40+
model_version: '1'
41+
source_registry_name: 'playground-registry'
42+
source_registry_resource_group: 'playground-registry-resource-group'
43+
destination_registry_name: 'dev-registry'
44+
destination_registry_resource_group: 'dev-resource-group'
45+
```
46+
47+
## Example deployment of an Azure Machine Learning Workflow with blue/green deployments
48+
49+
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.
50+
51+
```yaml
52+
jobs:
53+
deploy:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v2.3.2
57+
58+
- uses: Azure/login@v1
59+
with:
60+
creds: ${{ secrets.AZURE_CREDENTIALS }}
61+
62+
# Move model into dev registry (Will be skipped if it already exists)
63+
- name: Register model in registry
64+
uses: coding-kitties/register-azure-machine-learning-model@v0.1.0
65+
with:
66+
model_name: 'model-name'
67+
model_version: '1'
68+
source_registry_name: 'playground-registry'
69+
source_registry_resource_group: 'my-registry-resource-group'
70+
destination_registry_name: 'playground-registry'
71+
destination_registry_resource_group: 'my-registry-resource-group'
72+
73+
# Create AML Online Endpoint in DEV (Will be skipped if it already exists)
74+
- name: Create AML Online Endpoint DEV
75+
uses: coding-kitties/create-azure-machine-learning-online-endpoint@v0.3.0
76+
with:
77+
endpoint_name: 'dev-endpoint'
78+
resource_group: 'dev-group'
79+
workspace_name: 'dev-workspace'
80+
81+
# Deploy the new green model to DEV
82+
- name: Create AML Online Endpoint Deployment DEV
83+
uses: coding-kitties/create-azure-machine-learning-online-deployment@v0.3.0
84+
with:
85+
endpoint_name: 'dev-endpoint'
86+
resource_group: 'dev-group'
87+
workspace_name: 'dev-workspace'
88+
deployment_yaml_file_path: 'path/to/deployment.yml'
89+
model_name: 'model-name'
90+
model_version: '1'
91+
traffic: '{ "green": 0, "blue": 100, mirror": {"green": 20} }'
92+
93+
# Update green deployment traffic in DEV
94+
- name: Update AML Online Endpoint Deployment traffic
95+
uses: coding-kitties/update-azure-machine-learning-online-deployment@v0.1.0
96+
with:
97+
endpoint_name: 'my-endpoint'
98+
workspace_name: 'my-workspace'
99+
resource_group: 'my-resource-group'
100+
traffic: '{ "green": 100, "blue": 0, mirror": {"green": 0} }'
101+
102+
- name: Delete AML Online Endpoint Deployment DEV
103+
uses: coding-kitties/delete-azure-machine-learning-online-deployment@v0.1.0
104+
with:
105+
endpoint_name: 'dev-endpoint'
106+
resource_group: 'dev-group'
107+
workspace_name: 'dev-workspace'
108+
deployment_name: 'blue'
109+
110+
# Move model to production registy
111+
- name: Move model to production registry
112+
uses: coding-kitties/register-azure-machine-learning-model@v0.1.0
113+
with:
114+
model_name: 'model-name'
115+
model_version: '1'
116+
source_registry_name: 'playground-registry'
117+
source_registry_resource_group: 'my-registry-resource-group'
118+
destination_registry_name: 'production-registry'
119+
destination_registry_resource_group: 'my-registry-resource-group'
120+
121+
# Create AML Online Endpoint in PROD (Will be skipped if it already exists)
122+
- name: Create AML Online Endpoint PROD
123+
uses: coding-kitties/create-azure-machine-learning-online-endpoint@v0.3.0
124+
with:
125+
endpoint_name: 'prod-endpoint'
126+
resource_group: 'prod-group'
127+
workspace_name: 'prod-workspace'
128+
129+
# Deploy the new green model to PROD
130+
- name: Create AML Online Endpoint Deployment PROD
131+
uses: coding-kitties/create-azure-machine-learning-online-deployment@v0.3.0
132+
with:
133+
endpoint_name: 'prod-endpoint'
134+
resource_group: 'prod-group'
135+
workspace_name: 'prod-workspace'
136+
deployment_yaml_file_path: 'path/to/deployment.yml'
137+
model_name: 'model-name'
138+
model_version: '1'
139+
traffic: '{ "green": 0, "blue": 100, mirror": {"green": 20} }'
140+
å```

action.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'Register Azure Machine Learning Model to Workspace'
2+
description: 'Register Azure Machine Learning Model to Workspace'
3+
author: 'Marc van Duyn'
4+
branding:
5+
icon: 'cloud'
6+
color: 'blue'
7+
8+
inputs:
9+
workspace_name:
10+
description: 'Azure ML Workspace Name'
11+
required: true
12+
resource_group:
13+
description: 'Azure Resource Group'
14+
required: true
15+
model_name:
16+
description: 'Model Name'
17+
required: true
18+
model_version:
19+
description: 'Model Version'
20+
required: true
21+
model_path:
22+
description: 'Model Path'
23+
required: true
24+
model_description:
25+
description: 'Model Description'
26+
required: true
27+
model_type:
28+
description: 'Model Type'
29+
required: true
30+
31+
runs:
32+
using: "node20"
33+
main: "dist/index.js"

0 commit comments

Comments
 (0)