Avere/terraform.yml

179 строки
5.2 KiB
YAML

# 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