-
Notifications
You must be signed in to change notification settings - Fork 32
/
terraform.yml
178 lines (171 loc) · 5.24 KB
/
terraform.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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Copyright (C) Microsoft Corporation. All rights reserved.
# https://aka.ms/yaml
trigger: none
parameters:
- name: original_node_count
displayName: "Original Node Count"
type: number
default: 3
values:
- 3
- 6
- name: scale_up_node_count
displayName: "Scale Up Node Count +"
type: number
default: 1
values:
- 1
- 3
- name: region
displayName: "Region to run pipeline"
type: string
default: "eastus"
values:
- "australiaeast"
- "australiasoutheast"
- "brazilsouth"
- "canadacentral"
- "canadaeast"
- "centralus"
- "eastasia"
- "eastus"
- "eastus2"
- "francecentral"
- "japaneast"
- "japanwest"
- "koreacentral"
- "koreasouth"
- "northeurope"
- "northcentralus"
- "southcentralus"
- "southeastasia"
- "southeastindia"
- "uksouth"
- "ukwest"
- "westus"
- "westus2"
- "westus3"
- "westeurope"
- "westindia"
- name: tf_config
displayName: "Select terraform config to setup"
type: string
default: "azureblobfiler"
values:
- "1-filer"
- "proxy"
- "azureblobfiler"
- name: image
displayName: "Select vfxt image to run. Defaults to latest"
type: string
default: "microsoft-avere:vfxt:avere-vfxt-node:latest"
values:
- "microsoft-avere:vfxt:avere-vfxt-node:latest"
- "microsoft-avere:vfxt:avere-vfxt-node:9.1.0"
- "microsoft-avere:vfxt:avere-vfxt-node:8.0.1"
- "microsoft-avere:vfxt:avere-vfxt-node:6.3.0"
- "microsoft-avere:vfxt-preview:avere-vfxt-node:latest"
- name: controller_image
displayName: "Controller Image Offering (default: latest public)"
type: string
default: "microsoft-avere:vfxt:avere-vfxt-controller:latest"
values:
- "microsoft-avere:vfxt:avere-vfxt-controller:latest"
- "microsoft-avere:vfxt-preview:avere-vfxt-controller:latest"
- name: run_vdbench
displayName: "Run vdbench - only runs with azureblobfiler"
type: boolean
default: true
- name: vdbench_config
displayName: "vdbench config - only runs with azureblobfiler"
type: string
default: "inmem"
values:
- "ondisk"
- "inmem"
- name: vm_count
displayName: "Number of VMSS instances to create as vdbench clients"
type: number
default: 12
values:
- 12
- 6
- name: run_scale_up
displayName: "Run scale-up"
type: boolean
default: true
- name: run_scale_down
displayName: "Run scale-down (only runs if scale-up is selected)"
type: boolean
default: true
- name: run_destroy_and_cleanup
displayName: "Run terraform destroy and rg cleanup."
type: boolean
default: true
- name: ssh_pub_key
displayName: "Optional: Pass in public ssh key, it would be placed on controller."
type: string
default: "."
variables:
SSH_PUBLIC_KEY: '${{ parameters.ssh_pub_key}}'
jobs:
- job: Terraform_vFXT
timeoutInMinutes: 180
cancelTimeoutInMinutes: 40
pool:
vmImage: ubuntu-latest
steps:
- template: templates/setup_ssh.yml
- template: templates/setup_envars.yml
parameters:
tf_config: ${{ parameters.tf_config }}
region: ${{ parameters.region }}
- template: templates/terraform_setup.yml
parameters:
original_node_count: ${{ parameters.original_node_count }}
tf_config: ${{ parameters.tf_config }}
image: ${{ parameters.image }}
controller_image: ${{ parameters.controller_image }}
scale_up_node_count: ${{ parameters.scale_up_node_count }}
vdbench_config: ${{ parameters.vdbench_config }}
vm_count: ${{ parameters.vm_count }}
- ${{ if ne(parameters.ssh_pub_key, '.') }}:
- template: templates/add_sshkey.yml
- ${{ if eq(parameters.run_vdbench, true) }}:
- ${{ if eq(parameters.tf_config, 'azureblobfiler') }}:
- template: templates/terraform_run.yml
parameters:
run: vdbench_run
- ${{ if eq(parameters.run_scale_up, true) }}:
- bash: echo "##vso[build.updatebuildnumber]${BUILD_BUILDNUMBER} (Scale-Up)"
displayName: "Tag Build with RG Name "
condition: always()
- template: templates/terraform_run.yml
parameters:
run: scaleup
- ${{ if eq(parameters.run_scale_up, true) }}:
- ${{ if eq(parameters.run_scale_down, true) }}:
- bash: echo "##vso[build.updatebuildnumber]${BUILD_BUILDNUMBER} (Scale-Down)"
displayName: "Tag Build with RG Name "
condition: always()
- template: templates/terraform_run.yml
parameters:
run: scaledown
- ${{ if eq(parameters.run_vdbench, true) }}:
- template: templates/vdbench_save.yml
parameters:
vdbench_config: ${{ parameters.vdbench_config }}
- template: templates/upload_gsi.yml
- ${{ if eq(parameters.run_destroy_and_cleanup, true) }}:
- ${{ if eq(parameters.run_vdbench, true) }}:
- ${{ if eq(parameters.tf_config, 'azureblobfiler') }}:
- template: templates/terraform_run.yml
parameters:
run: vdbench_destroy
condition: always()
- template: templates/terraform_run.yml
parameters:
run: destroy
condition: always()
- template: templates/rg_delete.yml
- template: templates/public_ip_delete.yml