Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 94e0c1a

Browse files
authored
Merge pull request #21262 from adiaaida/useSpecificPython21
Specify path to python3.5 for perf jobs (#20443)
2 parents ed37921 + 53bb175 commit 94e0c1a

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

perf.groovy

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ def static getOSGroup(def os) {
3636
def architecture = arch
3737
def jobName = isSmoketest ? "perf_perflab_${os}_${arch}_${opt_level}_${jit}_smoketest" : "perf_perflab_${os}_${arch}_${opt_level}_${jit}"
3838
def testEnv = ""
39+
def python = "C:\\Python35\\python.exe"
3940

4041
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
4142
// Set the label.
4243
if (isSmoketest) {
4344
label('Windows.Amd64.ClientRS4.DevEx.15.8.Perf')
45+
python = "C:\\python3.7.0\\python.exe"
4446
}
4547
else {
4648
label('windows_server_2016_clr_perf')
@@ -86,23 +88,23 @@ def static getOSGroup(def os) {
8688
batchFile("if \"%GIT_BRANCH:~0,7%\" == \"origin/\" (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%\") else (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%\")\n" +
8789
"set \"BENCHVIEWNAME=${benchViewName}\"\n" +
8890
"set \"BENCHVIEWNAME=%BENCHVIEWNAME:\"=\"\"%\"\n" +
89-
"py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user-email \"[email protected]\"\n" +
90-
"py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
91-
batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
91+
"${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user-email \"[email protected]\"\n" +
92+
"${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
93+
batchFile("${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
9294
batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}")
9395

9496
batchFile("tests\\runtest.cmd ${configuration} ${architecture} GenerateLayoutOnly")
9597

9698
def runXUnitPerfCommonArgs = "-arch ${arch} -configuration ${configuration} -os ${os} -generateBenchviewData \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" ${uploadString} -runtype ${runType} ${testEnv} -optLevel ${opt_level} -jitName ${jit} -outputdir \"%WORKSPACE%\\bin\\sandbox_logs\" -stabilityPrefix \"START \\\"CORECLR_PERF_RUN\\\" /B /WAIT /HIGH /AFFINITY 0x2\""
9799

98100
// Run with just stopwatch: Profile=Off
99-
batchFile("py tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\perflab\\Perflab -library")
100-
batchFile("py tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality")
101+
batchFile("${python} tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\perflab\\Perflab -library")
102+
batchFile("${python} tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality")
101103

102104
// Run with the full set of counters enabled: Profile=On
103105
if (opt_level != 'min_opt') {
104-
batchFile("py tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\perflab\\Perflab -library -collectionFlags default+BranchMispredictions+CacheMisses+InstructionRetired+gcapi")
105-
batchFile("py tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality -collectionFlags default+BranchMispredictions+CacheMisses+InstructionRetired+gcapi")
106+
batchFile("${python} tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\perflab\\Perflab -library -collectionFlags default+BranchMispredictions+CacheMisses+InstructionRetired+gcapi")
107+
batchFile("${python} tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality -collectionFlags default+BranchMispredictions+CacheMisses+InstructionRetired+gcapi")
106108
}
107109
}
108110
}
@@ -178,6 +180,8 @@ def static getOSGroup(def os) {
178180
['full_opt'].each { opt_level ->
179181
def architecture = arch
180182

183+
def python = "C:\\Python35\\python.exe"
184+
181185
pgo_build = ""
182186
pgo_test = ""
183187
pgo_string = "pgo"
@@ -217,11 +221,11 @@ def static getOSGroup(def os) {
217221
batchFile("if \"%GIT_BRANCH:~0,7%\" == \"origin/\" (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%\") else (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%\")\n" +
218222
"set \"BENCHVIEWNAME=${benchViewName}\"\n" +
219223
"set \"BENCHVIEWNAME=%BENCHVIEWNAME:\"=\"\"%\"\n" +
220-
"py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"${benchViewName}\" --user-email \"[email protected]\"\n" +
221-
"py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
222-
batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
224+
"${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"${benchViewName}\" --user-email \"[email protected]\"\n" +
225+
"${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
226+
batchFile("${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
223227
batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}${pgo_build} skiptests")
224-
batchFile("py -u tests\\scripts\\run-throughput-perf.py -arch ${arch} -os ${os} -configuration ${configuration} -opt_level ${opt_level} -jit_name ${jit}${pgo_test} -clr_root \"%WORKSPACE%\" -assembly_root \"%WORKSPACE%\\Microsoft.BenchView.ThroughputBenchmarks.${architecture}.${os}\\lib\" -benchview_path \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -run_type ${runType}")
228+
batchFile("${python} -u tests\\scripts\\run-throughput-perf.py -arch ${arch} -os ${os} -configuration ${configuration} -opt_level ${opt_level} -jit_name ${jit}${pgo_test} -clr_root \"%WORKSPACE%\" -assembly_root \"%WORKSPACE%\\Microsoft.BenchView.ThroughputBenchmarks.${architecture}.${os}\\lib\" -benchview_path \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -run_type ${runType}")
225229
}
226230
}
227231

@@ -563,6 +567,7 @@ parallel(
563567
def newJob = job(Utilities.getFullJobName(project, "perf_scenarios_${os}_${arch}_${opt_level}_${jit}", isPR)) {
564568

565569
def testEnv = ""
570+
def python = "C:\\Python35\\python.exe"
566571

567572
// Set the label.
568573
label('windows_server_2016_clr_perf')
@@ -599,21 +604,21 @@ parallel(
599604
batchFile("if \"%GIT_BRANCH:~0,7%\" == \"origin/\" (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%\") else (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%\")\n" +
600605
"set \"BENCHVIEWNAME=${benchViewName}\"\n" +
601606
"set \"BENCHVIEWNAME=%BENCHVIEWNAME:\"=\"\"%\"\n" +
602-
"py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user-email \"[email protected]\"\n" +
603-
"py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
604-
batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
607+
"${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user-email \"[email protected]\"\n" +
608+
"${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
609+
batchFile("${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
605610
batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}")
606611

607612
batchFile("tests\\runtest.cmd ${configuration} ${architecture} GenerateLayoutOnly")
608613

609614
def runXUnitPerfCommonArgs = "-arch ${arch} -configuration ${configuration} -os ${os} -generateBenchviewData \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" ${uploadString} -runtype ${runType} ${testEnv} -optLevel ${opt_level} -jitName ${jit} -outputdir \"%WORKSPACE%\\bin\\sandbox_logs\" -stabilityPrefix \"START \\\"CORECLR_PERF_RUN\\\" /B /WAIT /HIGH\" -scenarioTest"
610615

611616
// Profile=Off
612-
batchFile("py tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\Scenario\\JitBench -group CoreCLR-Scenarios")
617+
batchFile("${python} tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\Scenario\\JitBench -group CoreCLR-Scenarios")
613618

614619
// Profile=On
615620
if (opt_level != 'min_opt') {
616-
batchFile("py tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\Scenario\\JitBench -group CoreCLR-Scenarios -collectionFlags BranchMispredictions+CacheMisses+InstructionRetired")
621+
batchFile("${python} tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\Scenario\\JitBench -group CoreCLR-Scenarios -collectionFlags BranchMispredictions+CacheMisses+InstructionRetired")
617622
}
618623
}
619624
}
@@ -692,6 +697,7 @@ parallel(
692697
def testBin = "%WORKSPACE%\\bin\\tests\\${os}.${architecture}.${configuration}"
693698
def coreRoot = "${testBin}\\Tests\\Core_Root"
694699
def benchViewTools = "%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools"
700+
def python = "C:\\Python35\\python.exe"
695701

696702
steps {
697703
// Install nuget and get BenchView tools
@@ -705,11 +711,11 @@ parallel(
705711
batchFile("if \"%GIT_BRANCH:~0,7%\" == \"origin/\" (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%\") else (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%\")\n" +
706712
"set \"BENCHVIEWNAME=${benchViewName}\"\n" +
707713
"set \"BENCHVIEWNAME=%BENCHVIEWNAME:\"=\"\"%\"\n" +
708-
"py \"${benchViewTools}\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user-email \"[email protected]\"\n" +
709-
"py \"${benchViewTools}\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
714+
"${python} \"${benchViewTools}\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user-email \"[email protected]\"\n" +
715+
"${python} \"${benchViewTools}\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
710716

711717
// Generate machine data from BenchView
712-
batchFile("py \"${benchViewTools}\\machinedata.py\"")
718+
batchFile("${python} \"${benchViewTools}\\machinedata.py\"")
713719

714720
// Build CoreCLR and gnerate test layout
715721
batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}")
@@ -719,11 +725,11 @@ parallel(
719725
batchFile("\"${coreRoot}\\CoreRun.exe\" \"${testBin}\\sizeondisk\\sodbench\\SoDBench\\SoDBench.exe\" -o \"%WORKSPACE%\\sodbench.csv\" --architecture ${arch} --channel ${channel}")
720726

721727
// From sodbench.csv, create measurment.json, then submission.json
722-
batchFile("py \"${benchViewTools}\\measurement.py\" csv \"%WORKSPACE%\\sodbench.csv\" --metric \"Size on Disk\" --unit \"bytes\" --better \"desc\"")
723-
batchFile("py \"${benchViewTools}\\submission.py\" measurement.json --build build.json --machine-data machinedata.json --metadata submission-metadata.json --group \"Dotnet Size on Disk\" --type ${runType} --config-name ${configuration} --architecture ${arch} --machinepool VM --config Channel ${channel}")
728+
batchFile("${python} \"${benchViewTools}\\measurement.py\" csv \"%WORKSPACE%\\sodbench.csv\" --metric \"Size on Disk\" --unit \"bytes\" --better \"desc\"")
729+
batchFile("${python} \"${benchViewTools}\\submission.py\" measurement.json --build build.json --machine-data machinedata.json --metadata submission-metadata.json --group \"Dotnet Size on Disk\" --type ${runType} --config-name ${configuration} --architecture ${arch} --machinepool VM --config Channel ${channel}")
724730

725731
// If this is a PR, upload submission.json
726-
batchFile("py \"${benchViewTools}\\upload.py\" submission.json --container coreclr")
732+
batchFile("${python} \"${benchViewTools}\\upload.py\" submission.json --container coreclr")
727733
}
728734
}
729735

@@ -765,6 +771,7 @@ parallel(
765771
label('Windows.Amd64.ClientRS4.DevEx.15.8.Perf')
766772

767773
def testEnv = ""
774+
def python = "C:\\Python35\\python.exe"
768775
wrappers {
769776
credentialsBinding {
770777
string('BV_UPLOAD_SAS_TOKEN', 'CoreCLR Perf BenchView Sas')
@@ -798,9 +805,9 @@ parallel(
798805
batchFile("if \"%GIT_BRANCH:~0,7%\" == \"origin/\" (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%\") else (set \"GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%\")\n" +
799806
"set \"BENCHVIEWNAME=${benchViewName}\"\n" +
800807
"set \"BENCHVIEWNAME=%BENCHVIEWNAME:\"=\"\"%\"\n" +
801-
"py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user-email \"[email protected]\"\n" +
802-
"py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
803-
batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
808+
"${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name \"%BENCHVIEWNAME%\" --user-email \"[email protected]\"\n" +
809+
"${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type ${runType}")
810+
batchFile("${python} \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
804811
batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}")
805812

806813
batchFile("tests\\runtest.cmd ${configuration} ${architecture} GenerateLayoutOnly")
@@ -809,7 +816,7 @@ parallel(
809816

810817
// Scenario: ILLink
811818
batchFile("\"%VS140COMNTOOLS%\\..\\..\\VC\\vcvarsall.bat\" x86_amd64 && " +
812-
"py tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\linkbench\\linkbench -group ILLink -nowarmup")
819+
"${python} tests\\scripts\\run-xunit-perf.py ${runXUnitPerfCommonArgs} -testBinLoc bin\\tests\\${os}.${architecture}.${configuration}\\performance\\linkbench\\linkbench -group ILLink -nowarmup")
813820
}
814821
}
815822

tests/scripts/run-throughput-perf.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@
9797
'Ubuntu16.04': 'Linux'
9898
}
9999

100-
python_exe_list = {
101-
'Windows_NT': 'py',
102-
'Linux': 'python3.5'
103-
}
104-
105100
##########################################################################
106101
# Argument Parser
107102
##########################################################################
@@ -334,7 +329,6 @@ def main(args):
334329
global dll_exclude_list
335330
global jit_list
336331
global os_group_list
337-
global python_exe_list
338332

339333
architecture, operating_system, os_group, build_type, run_type, clr_root, assembly_root, benchview_path, iterations, opt_level, jit_name, no_pgo = validate_args(args)
340334
arch = architecture
@@ -371,7 +365,7 @@ def main(args):
371365
# Replace assembly_root's System.Private.CoreLib with built System.Private.CoreLib.
372366
shutil.copyfile(os.path.join(bin_path, 'System.Private.CoreLib.dll'), os.path.join(assembly_root, 'System.Private.CoreLib.dll'))
373367

374-
python_exe = python_exe_list[os_group]
368+
python_exe = sys.executable
375369

376370
# Run throughput testing
377371
for dll_file_name in os.listdir(assembly_root):

tests/scripts/run-xunit-perf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,13 +418,11 @@ def main(args):
418418
coreclrPerf, assemblyName, arch, operatingSystem, configuration, jitName, optLevel, runType, outputDir, stabilityPrefix, isScenarioTest, benchviewPath, isPgoOptimized, benchviewGroup, hasWarmupRun, collectionFlags, isLibrary, uploadToBenchview, better, sliceNumber, sliceConfigFile = validate_args(args)
419419

420420
platform = sys.platform
421-
python = 'py'
421+
python = sys.executable
422422
if platform == 'linux' or platform == 'linux2':
423423
platform = 'Linux'
424-
python = 'python3'
425424
elif platform == 'darwin':
426425
platform = 'OSX'
427-
python = 'python3'
428426
elif platform == 'win32':
429427
platform = "Windows_NT"
430428
else:

0 commit comments

Comments
 (0)