Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 3657 #3833

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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