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