forked from Azure/mlops-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (63 loc) · 2.19 KB
/
create-compute.yml
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
name: create-compute
on:
workflow_call:
inputs:
cluster_name:
required: true
type: string
size:
required: true
type: string
min_instances:
required: true
type: number
max_instances:
required: true
type: number
resource_group:
required: true
type: string
workspace_name:
required: true
type: string
cluster_tier:
required: false
type: string
secrets:
creds:
required: true
jobs:
create-compute:
runs-on: ubuntu-latest
steps:
- name: 'Az CLI login'
uses: azure/login@v1
with:
creds: ${{secrets.creds}}
enable-AzPSSession: true
- name: install-extension
run: az extension add -n ml -y
- name: update-extension
run: az extension update -n ml
- name: create-compute-default-tier
if: ${{ inputs.cluster_tier == ''}}
run: |
az ml compute create --name ${{ inputs.cluster_name }} \
--type AmlCompute \
--tier "dedicated" \
--size ${{ inputs.size }} \
--min-instances ${{ inputs.min_instances }} \
--max-instances ${{ inputs.max_instances }} \
--resource-group ${{ inputs.resource_group }} \
--workspace-name ${{ inputs.workspace_name }}
- name: create-compute-using-tier
if: ${{ inputs.cluster_tier != ''}}
run: |
az ml compute create --name ${{ inputs.cluster_name }} \
--type AmlCompute \
--tier ${{ inputs.cluster_tier }} \
--size ${{ inputs.size }} \
--min-instances ${{ inputs.min_instances }} \
--max-instances ${{ inputs.max_instances }} \
--resource-group ${{ inputs.resource_group }} \
--workspace-name ${{ inputs.workspace_name }}