File tree Expand file tree Collapse file tree 7 files changed +66
-91
lines changed Expand file tree Collapse file tree 7 files changed +66
-91
lines changed Original file line number Diff line number Diff line change 11FROM mcr.microsoft.com/azure-cli
22
3+ LABEL "com.github.actions.name" ="Create Azure Machine Learning Workspace Endpoint"
4+ LABEL "com.github.actions.description" ="Create an Azure Machine Learning Workspace Endpoint"
5+ LABEL "com.github.actions.icon" ="box"
6+ LABEL "com.github.actions.color" ="green"
7+ LABEL "repository" ="https://github.com/coding-kitties/create-aml-online-endpoint"
8+ LABEL "homepage" ="https://github.com/coding-kitties/create-aml-online-endpoint"
9+ LABEL "maintainer" ="Marc van Duyn <marcvanduyn@microsoft.com>"
10+
311# Install jq (for parsing JSON)
412RUN apt-get update && apt-get install -y jq
513
Original file line number Diff line number Diff line change 22
33This GitHub Action creates an ** Azure Machine Learning Online Endpoint** .
44
5+ ## Dependencies on other Github Actions
6+
7+ * Authenticate using [ Azure Login] ( https://github.com/Azure/login )
8+
59## 🚀 Usage
610
711### ** 1. Add to Your Workflow**
@@ -11,13 +15,14 @@ jobs:
1115 deploy :
1216 runs-on : ubuntu-latest
1317 steps :
14- - name : Checkout repository
15- uses : actions/checkout@v4
18+ - uses : actions/checkout@v2.3.2
19+ - uses : Azure/login@v1
20+ with :
21+ creds : ${{secrets.AZURE_CREDENTIALS}}
1622
1723 - name : Create AML Online Endpoint
18- uses : coding-kitties/create-aml-online-endpoint@v1
24+ uses : coding-kitties/create-aml-online-endpoint@v0.2.0
1925 with :
20- azure_credentials : ${{ secrets.AZURE_CREDENTIALS }}
2126 endpoint_name : ' my-endpoint'
2227 resource_group : ' my-resource-group'
2328 workspace_name : ' my-workspace'
Original file line number Diff line number Diff line change @@ -2,13 +2,10 @@ name: 'Create Azure ML Online Endpoint'
22description : ' Create an Azure ML Online Endpoint'
33author : ' Marc van Duyn'
44branding :
5- icon : ' cloud '
6- color : ' blue'
5+ icon : ' azure-logo.svg '
6+ color : ' blue'
77
88inputs :
9- azure_credentials :
10- description : ' Azure credentials in JSON format (Service Principal)'
11- required : true
129 endpointName :
1310 description : ' Name of the endpoint'
1411 required : true
@@ -20,20 +17,5 @@ inputs:
2017 required : true
2118
2219runs :
23- using : ' composite'
24- steps :
25- # Step 1: Log into Azure using Azure Login action
26- - name : Log into Azure
27- uses : azure/login@v1
28- with :
29- creds : ${{ secrets.AZURE_CREDENTIALS }}
30-
31- # Step 2: Checkout repository
32- - name : Checkout repository
33- uses : actions/checkout@v4
34-
35- # Step 3: Set up Docker (if needed) and run the entrypoint script
36- - name : Run Docker container with entrypoint.sh
37- run : |
38- docker build -t aml-deploy .
39- docker run -v $PWD:/workspace -e AZURE_CREDENTIALS="${{ secrets.AZURE_CREDENTIALS }}" aml-deploy /workspace/entrypoint.sh "${{ inputs.azure_credentials }}" "${{ inputs.endpointName }}" "${{ inputs.workspace_name }}" "${{ inputs.resource_group }}"
20+ using : " node16"
21+ main : " dist/index.js"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ const core = require ( "@actions/core" ) ;
2+ const exec = require ( "@actions/exec" ) ;
3+
4+ async function run ( ) {
5+ try {
6+ const endpointName = core . getInput ( "endpoint_name" ) ;
7+ const resourceGroup = core . getInput ( "resource_group" ) ;
8+ const workspaceName = core . getInput ( "workspace_name" ) ;
9+
10+ // Check if the required inputs are provided
11+ if ( ! endpointName ) {
12+ throw new Error ( "Endpoint name is required." ) ;
13+ }
14+
15+ if ( ! resourceGroup ) {
16+ throw new Error ( "Resource group is required" ) ;
17+ }
18+
19+ if ( ! workspaceName ) {
20+ throw new Error ( "Workspace name is required" ) ;
21+ }
22+
23+ console . log ( `🔹 Deploying AML Endpoint: ${ endpointName } ` ) ;
24+
25+ // Run Azure CLI command
26+ await exec . exec ( `az ml online-endpoint create --name ${ endpointName } --resource-group ${ resourceGroup } --workspace-name ${ workspaceName } ` ) ;
27+
28+ console . log ( `✅ Successfully deployed: ${ endpointName } ` ) ;
29+ } catch ( error ) {
30+ core . setFailed ( `❌ Action failed: ${ error . message } ` ) ;
31+ }
32+ }
33+
34+ run ( ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " create-aml-online-endpoint" ,
3+ "version" : " 1.0.0" ,
4+ "description" : " GitHub Action to create an Azure ML Online Endpoint" ,
5+ "main" : " index.js" ,
6+ "dependencies" : {
7+ "@actions/core" : " ^1.10.0" ,
8+ "@actions/exec" : " ^1.1.1"
9+ }
10+ }
You can’t perform that action at this time.
0 commit comments