-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathdeploy-model-training-pipeline-classical.yml
More file actions
94 lines (93 loc) · 3.52 KB
/
Copy pathdeploy-model-training-pipeline-classical.yml
File metadata and controls
94 lines (93 loc) · 3.52 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: deploy-model-training-pipeline
on:
workflow_dispatch:
jobs:
set-env-branch:
runs-on: ubuntu-latest
outputs:
config-file: ${{ steps.set-output-defaults.outputs.config-file }}
steps:
- id: set-prod-branch
name: set-prod-branch
if: ${{ github.ref == 'refs/heads/main'}}
run: echo "config_env=config-infra-prod.yml" >> $GITHUB_ENV;
- id: set-dev-branch
name: setdevbranch
if: ${{ github.ref != 'refs/heads/main'}}
run: echo "config_env=config-infra-dev.yml" >> $GITHUB_ENV;
- id: set-output-defaults
name: set-output-defaults
run: |
echo "config-file=$config_env" >> $GITHUB_OUTPUT;
get-config:
needs: set-env-branch
permissions:
contents: read
uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main
with:
file_name: ${{ needs.set-env-branch.outputs.config-file}}
register-environment:
needs: get-config
permissions:
id-token: write
contents: read
uses: Azure/mlops-templates/.github/workflows/register-environment.yml@main
with:
resource_group: ${{ needs.get-config.outputs.resource_group }}
workspace_name: ${{ needs.get-config.outputs.aml_workspace }}
environment_file: classical/aml-cli-v2/mlops/azureml/train/train-env.yml
conda_file: classical/aml-cli-v2/data-science/environment/train-conda.yml
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
register-dataset:
needs: get-config
permissions:
id-token: write
contents: read
uses: Azure/mlops-templates/.github/workflows/register-dataset.yml@main
with:
resource_group: ${{ needs.get-config.outputs.resource_group }}
workspace_name: ${{ needs.get-config.outputs.aml_workspace }}
name: taxi-data
data_file: classical/aml-cli-v2/mlops/azureml/train/data.yml
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
create-compute:
needs: get-config
permissions:
id-token: write
contents: read
uses: Azure/mlops-templates/.github/workflows/create-compute.yml@main
with:
cluster_name: cpu-cluster
size: STANDARD_D4S_V3
min_instances: 0
max_instances: 4
cluster_tier: Dedicated
resource_group: ${{ needs.get-config.outputs.resource_group }}
workspace_name: ${{ needs.get-config.outputs.aml_workspace }}
vnet_name: ${{ needs.get-config.outputs.vnet_name }}
subnet_name: snet-training
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
run-model-training-pipeline:
needs: [get-config,register-environment,register-dataset,create-compute]
permissions:
id-token: write
contents: read
uses: Azure/mlops-templates/.github/workflows/run-pipeline.yml@main
with:
resource_group: ${{ needs.get-config.outputs.resource_group }}
workspace_name: ${{ needs.get-config.outputs.aml_workspace }}
parameters-file: classical/aml-cli-v2/mlops/azureml/train/pipeline.yml
job-name: test
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}