-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Expand file tree
/
Copy pathbenchmark-job.yml
More file actions
79 lines (70 loc) · 2.38 KB
/
benchmark-job.yml
File metadata and controls
79 lines (70 loc) · 2.38 KB
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
parameters:
- name: BenchmarkProject
type: string
default: 'tools/azsdk-cli/Azure.Sdk.Tools.Cli.Benchmarks'
- name: ScenarioName
type: string
default: ' '
- name: Tags
type: string
default: ' '
- name: Model
type: string
default: ' '
- name: Parallelism
type: number
default: 5
jobs:
- job: Run_Benchmark
variables:
- template: /eng/pipelines/templates/variables/globals.yml
- template: /eng/pipelines/templates/variables/image.yml
- group: 'AzSDK_Eval_Variable_group'
displayName: 'Run Benchmark'
pool:
name: $(LINUXPOOL)
image: $(LINUXVMIMAGE)
os: linux
steps:
- checkout: none
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
SkipCheckoutNone: true
Repositories:
- Name: $(Build.Repository.Name)
Commitish: $(Build.SourceVersion)
WorkingDirectory: $(System.DefaultWorkingDirectory)/$(Build.Repository.Name)
Paths:
- '${{ parameters.BenchmarkProject }}/**'
- 'eng/common/**'
- template: /eng/pipelines/templates/steps/install-dotnet.yml
- task: PowerShell@2
displayName: 'Run benchmarks'
condition: succeeded()
inputs:
targetType: 'inline'
workingDirectory: '$(System.DefaultWorkingDirectory)/$(Build.Repository.Name)/${{ parameters.BenchmarkProject }}'
pwsh: true
script: |
$cliArgs = @("run")
# Determine scenario selection: name, tags, or all
if ("${{ parameters.ScenarioName }}".Trim()) {
$cliArgs += "${{ parameters.ScenarioName }}".Trim()
} elseif ("${{ parameters.Tags }}".Trim()) {
$cliArgs += "--tags", "${{ parameters.Tags }}".Trim()
} else {
$cliArgs += "--all"
}
# Optional model override
if ("${{ parameters.Model }}".Trim()) {
$cliArgs += "--model", "${{ parameters.Model }}".Trim()
}
$cliArgs += "--parallel", "${{ parameters.Parallelism }}"
$cliArgs += "--cleanup", "always"
Write-Host "Running: dotnet run -- $($cliArgs -join ' ')"
dotnet run -- @cliArgs
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
COPILOT_GITHUB_TOKEN: $(azuresdk-copilot-github-pat)