Skip to content

Commit

Permalink
Move perf.yml to eng/common (#3833)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Harder <[email protected]>
  • Loading branch information
azure-sdk and mikeharder authored Jul 15, 2022
1 parent 7bf6735 commit 73bb61d
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions eng/common/pipelines/templates/jobs/perf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
parameters:
- name: Variables
type: object
default: []
- name: OperatingSystems
type: string
default: 'Linux'
- name: Language
type: string
default: ''
- name: InstallLanguageSteps
type: stepList
default: []
- name: ServiceDirectory
type: string
default: ''
- name: Services
type: string
default: ''
- name: PackageVersions
type: string
default: '.*'
- name: Tests
type: string
default: '.*'
- name: Arguments
type: string
default: '.*'
- name: Iterations
type: number
default: '5'
- name: AdditionalArguments
type: string
default: ''
- name: EnvVars
type: object
default: {}

resources:
repositories:
- repository: azure-sdk-tools
type: github
endpoint: Azure
name: Azure/azure-sdk-tools
ref: main

variables:
- ${{ parameters.Variables }}

jobs:
- job: Perf
timeoutInMinutes: 360
strategy:
matrix:
${{ if contains(parameters.OperatingSystems, 'Linux') }}:
Linux:
Pool: 'azsdk-pool-mms-ubuntu-2004-perf'
OsVmImage: 'MMSUbuntu20.04'
MatrixName: 'Linux'
${{ if contains(parameters.OperatingSystems, 'Windows') }}:
Windows:
Pool: 'azsdk-pool-mms-win-2019-perf'
OsVmImage: 'MMS2019'
MatrixName: 'Windows'
pool:
name: $(Pool)
vmImage: $(OSVmImage)
steps:
- checkout: self
path: s

- checkout: azure-sdk-tools
path: s/azure-sdk-tools

- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
parameters:
AgentImage: $(OSVmImage)

- ${{ parameters.InstallLanguageSteps }}

- template: /eng/common/TestResources/deploy-test-resources.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
Location: westus
ResourceType: perf

- pwsh: |
set-content -path config.yml -value "WorkingDirectories:"
add-content -path config.yml -value " ${{ parameters.Language }}: $(Agent.BuildDirectory)/s"
workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation
displayName: Create config.yml
- script: >-
dotnet run -- run
--no-sync
--languages ${{ parameters.Language }}
--services "${{ parameters.Services }}"
--package-versions "${{ parameters.PackageVersions }}"
--tests "${{ parameters.Tests }}"
--arguments "${{ parameters.Arguments }}"
--iterations ${{ parameters.Iterations }}
${{ parameters.AdditionalArguments }}
workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation
env:
${{ each var in parameters.EnvVars }}:
${{ var.key }}: ${{ var.value }}
displayName: Run perf tests
- pwsh: |
get-content results.csv
workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results
displayName: Print results.csv
condition: always()
- pwsh: |
get-content results.json
workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results
displayName: Print results.json
condition: always()
- task: PublishPipelineArtifact@1
inputs:
targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results
artifactName: results-$(MatrixName)
condition: always()

- template: /eng/common/TestResources/remove-test-resources.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
ResourceType: perf

0 comments on commit 73bb61d

Please sign in to comment.