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

[Perf] Add pipeline to validate changes to perf-automation #3874

Merged
61 commits merged into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9602413
Add tests.yml
mikeharder Aug 4, 2022
fb050ac
Add sparse checkout
mikeharder Aug 4, 2022
0db0ba4
Update sparse checkout
mikeharder Aug 4, 2022
420346f
print working directory
mikeharder Aug 4, 2022
092f5dc
Add matrix
mikeharder Aug 4, 2022
0130a5e
Add steps to run perf pipeline
mikeharder Aug 5, 2022
85d5c8a
Fix indentation
mikeharder Aug 5, 2022
678c2a6
Remove conditions
mikeharder Aug 5, 2022
ae6bcb0
Ref template from other repo
mikeharder Aug 5, 2022
8bc3894
Remove EnvVars
mikeharder Aug 5, 2022
d3cbe47
Uncomment conditions on install steps
mikeharder Aug 5, 2022
5b8b03b
Disable sourcelink when building .NET
mikeharder Aug 5, 2022
b40b7ce
Merge branch 'main' into mikeharder/perf-tools-pipeline
mikeharder Aug 5, 2022
56e59cf
Debug missing .net version
mikeharder Aug 5, 2022
4ee8b8e
Create new template for tools perf tests
mikeharder Aug 5, 2022
cc2ae05
Add variables parameter
mikeharder Aug 5, 2022
193b3a3
Remove variables section
mikeharder Aug 5, 2022
a510023
Mov variables under job
mikeharder Aug 5, 2022
0f9d0df
Move to perf pool
mikeharder Aug 5, 2022
478750c
Directly use language service template
mikeharder Aug 5, 2022
55a13b2
Use shared template from language repo
mikeharder Aug 5, 2022
2cd6c55
Use eng/common template
mikeharder Aug 5, 2022
3c3e6ec
Fix indentation
mikeharder Aug 5, 2022
509de2e
Add sparse checkout to perf template
mikeharder Aug 5, 2022
74ec2f7
Remove duplicate template
mikeharder Aug 6, 2022
b57802b
Rename base template, add parameters
mikeharder Aug 6, 2022
4c4a840
Add comment
mikeharder Aug 6, 2022
5743394
Fix jobname
mikeharder Aug 6, 2022
a11d6e0
Job name
mikeharder Aug 6, 2022
928b22d
Remove comment
mikeharder Aug 6, 2022
2d0e9d0
Add TODO
mikeharder Aug 6, 2022
9255b25
Add variables
mikeharder Aug 6, 2022
129267f
Fix copy/pase bug, add language to artifacts path
mikeharder Aug 6, 2022
efd3fe7
Add python
mikeharder Aug 6, 2022
5cb5682
Convert iterations to string
mikeharder Aug 6, 2022
cbf6f9c
Use template syntax for iterations
mikeharder Aug 6, 2022
8d4ea62
Fix language ref
mikeharder Aug 6, 2022
b424354
Fix python language
mikeharder Aug 6, 2022
e18825c
perf.yml extends perf-base.yml
mikeharder Aug 6, 2022
8ee76bd
Remove unnecessary base yml
mikeharder Aug 8, 2022
0ac64ab
Continuation of perf-base.yml deletion
mikeharder Aug 8, 2022
756df9d
Fetch pull request refs
mikeharder Aug 8, 2022
6c51087
Fix refs path
mikeharder Aug 23, 2022
1148dd4
Fetch commitish if matches PR syntax
mikeharder Aug 24, 2022
8e36cee
Print command before running
mikeharder Aug 24, 2022
52fa0d0
Merge branch 'main' into mikeharder/perf-tools-pipeline
mikeharder Aug 24, 2022
ed52d9f
Add PR commitish to remote.origin.fetch
mikeharder Aug 24, 2022
4c231fd
Add Java and JS, simplify iterations syntax
mikeharder Aug 24, 2022
28964a7
Revert iterations syntax
mikeharder Aug 24, 2022
f104e8a
Add comment
mikeharder Aug 24, 2022
61fc9ab
Add TODO
mikeharder Aug 24, 2022
ac6940b
Add pool and vmimage parameters
mikeharder Aug 24, 2022
766c0e9
Add stage to print all results
mikeharder Aug 24, 2022
e07c739
Add jobs tag
mikeharder Aug 24, 2022
e5d2c74
Add displayNames and conditions
mikeharder Aug 24, 2022
5e27d9b
Add newline after content
mikeharder Aug 24, 2022
d6b4da2
checkout none
mikeharder Aug 24, 2022
7c5c59d
Add global variables
mikeharder Aug 24, 2022
f4f541f
Map ref under "refs/remotes/origin"
mikeharder Aug 25, 2022
82d0144
set workingdirectory when printing results
mikeharder Aug 25, 2022
6252012
Add ref to refs/remotes/origin
mikeharder Aug 25, 2022
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
74 changes: 50 additions & 24 deletions eng/common/pipelines/templates/jobs/perf.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
parameters:
- name: JobName
type: string
default: 'Perf'
- name: LinuxPool
type: string
default: 'azsdk-pool-mms-ubuntu-2004-perf'
- name: LinuxVmImage
type: string
default: 'MMSUbuntu20.04'
- name: WindowsPool
type: string
default: 'azsdk-pool-mms-win-2019-perf'
- name: WindowsVmImage
type: string
default: 'MMS2019'
- name: Language
type: string
default: ''
- name: LanguageRepoName
type: string
default: $(Build.Repository.Name)
- name: LanguageRepoCommitish
type: string
default: $(Build.SourceVersion)
- name: ToolsRepoCommitish
type: string
default: 'main'
- name: Variables
type: object
default: []
- name: OperatingSystems
type: string
default: 'Linux'
- name: Language
type: string
default: ''
- name: InstallLanguageSteps
type: stepList
default: []
Expand Down Expand Up @@ -36,41 +60,43 @@ parameters:
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
- job: ${{ parameters.JobName }}
timeoutInMinutes: 360
strategy:
matrix:
${{ if contains(parameters.OperatingSystems, 'Linux') }}:
Linux:
Pool: 'azsdk-pool-mms-ubuntu-2004-perf'
OsVmImage: 'MMSUbuntu20.04'
Pool: ${{ parameters.LinuxPool }}
OsVmImage: ${{ parameters.LinuxVmImage }}
MatrixName: 'Linux'
${{ if contains(parameters.OperatingSystems, 'Windows') }}:
Windows:
Pool: 'azsdk-pool-mms-win-2019-perf'
OsVmImage: 'MMS2019'
Pool: ${{ parameters.WindowsPool }}
OsVmImage: ${{ parameters.WindowsVmImage }}
MatrixName: 'Windows'
variables:
- ${{ parameters.Variables }}
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/sparse-checkout.yml
parameters:
Paths:
- '/*'
- '!sdk/**/test-recordings/*'
- '!sdk/**/recordings/*'
- '!sdk/**/SessionRecords/*'
- '!sdk/**/session-records/*'
Repositories:
- Name: ${{ parameters.LanguageRepoName }}
Commitish: ${{ parameters.LanguageRepoCommitish }}
WorkingDirectory: $(System.DefaultWorkingDirectory)
- Name: Azure/azure-sdk-tools
Commitish: ${{ parameters.ToolsRepoCommitish }}
WorkingDirectory: $(System.DefaultWorkingDirectory)/azure-sdk-tools

- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml
parameters:
Expand Down Expand Up @@ -133,7 +159,7 @@ jobs:
- task: PublishPipelineArtifact@1
inputs:
targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results
artifactName: results-$(MatrixName)
artifactName: results-${{ parameters.Language }}-$(MatrixName)
condition: always()

- template: /eng/common/TestResources/remove-test-resources.yml
Expand Down
9 changes: 7 additions & 2 deletions eng/common/pipelines/templates/steps/sparse-checkout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ steps:
} else {
Write-Host "Repository $($repository.Name) is being initialized."

Write-Host "git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) ."
git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) .
if ($repository.Commitish -match '^refs/pull/\d+/merge$') {
Write-Host "git clone --no-checkout --filter=tree:0 -c remote.origin.fetch='+$($repository.Commitish):refs/remotes/origin/$($repository.Commitish)' https://github.com/$($repository.Name) ."
git clone --no-checkout --filter=tree:0 -c remote.origin.fetch=''+$($repository.Commitish):refs/remotes/origin/$($repository.Commitish)'' https://github.com/$($repository.Name) .
} else {
Write-Host "git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) ."
git clone --no-checkout --filter=tree:0 https://github.com/$($repository.Name) .
}

Write-Host "git sparse-checkout init"
git sparse-checkout init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public class Net : LanguageBase

Util.DeleteIfExists(PublishDirectory);

var processArguments = $"publish -c release -f {languageVersion} -o {PublishDirectory} {additionalBuildArguments} {project}";
// Disable source link, since it's not needed for perf runs, and also fails in sparse checkout repos
var processArguments = $"publish -c release -f {languageVersion} -o {PublishDirectory} -p:EnableSourceLink=false {additionalBuildArguments} {project}";

var result = await Util.RunAsync("dotnet", processArguments, workingDirectory: WorkingDirectory);

Expand Down
176 changes: 176 additions & 0 deletions tools/perf-automation/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
resources:
repositories:
- repository: azure-sdk-for-net
type: github
endpoint: Azure
name: Azure/azure-sdk-for-net
ref: main
- repository: azure-sdk-for-java
type: github
endpoint: Azure
name: Azure/azure-sdk-for-java
ref: main
- repository: azure-sdk-for-js
type: github
endpoint: Azure
name: Azure/azure-sdk-for-js
ref: main
- repository: azure-sdk-for-python
type: github
endpoint: Azure
name: Azure/azure-sdk-for-python
ref: main

variables:
# Use general pools instead of perf pools for faster startup due to more warm agents
LinuxPool: 'azsdk-pool-mms-ubuntu-2004-general'
LinuxVmImage: 'MMSUbuntu20.04'
WindowsPool: 'azsdk-pool-mms-win-2019-general'
WindowsVmImage: 'MMS2019'
LanguageRepoCommitish: 'main'
ToolsRepoCommitish: $(Build.SourceVersion)
Services: '^storage-blob$'
PackageVersions: '12|source'
Tests: '^(download)$'
Arguments: '(10240)'
Iterations: '1'

stages:
- stage: Test
displayName: Test
jobs:
- template: /eng/common/pipelines/templates/jobs/perf.yml
parameters:
JobName: 'Perf_Net'
LinuxPool: $(LinuxPool)
LinuxVmImage: $(LinuxVmImage)
WindowsPool: $(WindowsPool)
WindowsVmImage: $(WindowsVmImage)
Language: 'Net'
LanguageRepoName: 'Azure/azure-sdk-for-net'
LanguageRepoCommitish: $(LanguageRepoCommitish)
ToolsRepoCommitish: $(ToolsRepoCommitish)
Variables:
- template: /eng/pipelines/templates/variables/globals.yml@azure-sdk-for-net
InstallLanguageSteps:
- template: /eng/pipelines/templates/steps/install-dotnet.yml@azure-sdk-for-net
parameters:
EnableNuGetCache: false
ServiceDirectory: 'storage/Azure.Storage.Blobs'
Services: $(Services)
PackageVersions: $(PackageVersions)
Tests: $(Tests)
Arguments: $(Arguments)
# Iterations parameter has type 'number' so must use this variable syntax
Iterations: ${{ variables.Iterations }}

- template: /eng/common/pipelines/templates/jobs/perf.yml
parameters:
JobName: 'Perf_Java'
LinuxPool: $(LinuxPool)
LinuxVmImage: $(LinuxVmImage)
WindowsPool: $(WindowsPool)
WindowsVmImage: $(WindowsVmImage)
Language: 'Java'
LanguageRepoName: 'Azure/azure-sdk-for-java'
LanguageRepoCommitish: $(LanguageRepoCommitish)
ToolsRepoCommitish: $(ToolsRepoCommitish)
Variables:
- template: /eng/pipelines/templates/variables/globals.yml@azure-sdk-for-java
InstallLanguageSteps:
- task: JavaToolInstaller@0
inputs:
versionSpec: '8'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
displayName: Install Java 8
- script: |
java -version
mvn --version
displayName: Print Java Versions
ServiceDirectory: 'storage/azure-storage-blob'
Services: $(Services)
PackageVersions: $(PackageVersions)
Tests: $(Tests)
Arguments: $(Arguments)
# Iterations parameter has type 'number' so must use this variable syntax
Iterations: ${{ variables.Iterations }}

- template: /eng/common/pipelines/templates/jobs/perf.yml
parameters:
JobName: 'Perf_JS'
LinuxPool: $(LinuxPool)
LinuxVmImage: $(LinuxVmImage)
WindowsPool: $(WindowsPool)
WindowsVmImage: $(WindowsVmImage)
Language: 'JS'
LanguageRepoName: 'Azure/azure-sdk-for-js'
LanguageRepoCommitish: $(LanguageRepoCommitish)
ToolsRepoCommitish: $(ToolsRepoCommitish)
Variables:
- template: /eng/pipelines/templates/variables/globals.yml@azure-sdk-for-js
InstallLanguageSteps:
- template: /eng/pipelines/templates/steps/use-node-version.yml@azure-sdk-for-js
parameters:
NodeVersion: 14.x
ServiceDirectory: 'storage/storage-blob'
Services: $(Services)
PackageVersions: $(PackageVersions)
Tests: $(Tests)
Arguments: $(Arguments)
# Iterations parameter has type 'number' so must use this variable syntax
Iterations: ${{ variables.Iterations }}

- template: /eng/common/pipelines/templates/jobs/perf.yml
parameters:
JobName: 'Perf_Python'
LinuxPool: $(LinuxPool)
LinuxVmImage: $(LinuxVmImage)
WindowsPool: $(WindowsPool)
WindowsVmImage: $(WindowsVmImage)
Language: 'Python'
LanguageRepoName: 'Azure/azure-sdk-for-python'
LanguageRepoCommitish: $(LanguageRepoCommitish)
ToolsRepoCommitish: $(ToolsRepoCommitish)
Variables:
- template: /eng/pipelines/templates/variables/globals.yml@azure-sdk-for-python
- name: PythonVersion
value: '3.7'
InstallLanguageSteps:
- task: UsePythonVersion@0
displayName: "Use Python $(PythonVersion)"
inputs:
versionSpec: $(PythonVersion)
ServiceDirectory: 'storage/azure-storage-blob'
Services: $(Services)
PackageVersions: $(PackageVersions)
Tests: $(Tests)
Arguments: $(Arguments)
# Iterations parameter has type 'number' so must use this variable syntax
Iterations: ${{ variables.Iterations }}

- stage: Print_Results
displayName: Print Results
pool:
name: 'azsdk-pool-mms-ubuntu-2004-general'
vmImage: 'MMSUbuntu20.04'
condition: succeededOrFailed()
variables:
- template: /eng/pipelines/templates/variables/globals.yml
jobs:
- job: Print_Results
displayName: Print Results
steps:
- checkout: none

- download: current
patterns: '**/results.txt'

- pwsh: |
get-childitem . -recurse -filter results.txt | foreach-object {
write-host $_
get-content $_
write-host
}
workingDirectory: $(Pipeline.Workspace)
displayName: Print Results