List all generated perf .xml files.
authorSmile Wei <xiwe@microsoft.com>
Thu, 8 Sep 2016 19:25:54 +0000 (12:25 -0700)
committerSmile Wei <xiwe@microsoft.com>
Tue, 13 Sep 2016 21:11:09 +0000 (14:11 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/626c27756429923fa96ca49e05ca2a1862acef37

src/coreclr/perf.groovy
src/coreclr/tests/scripts/perf-prep.sh
src/coreclr/tests/scripts/run-xunit-perf.sh

index 71a93f4..b348221 100644 (file)
@@ -27,15 +27,17 @@ def static getOSGroup(def os) {
 
 [true, false].each { isPR ->
     ['Windows_NT'].each { os ->
+        def architecture = 'x64'
+        def configuration = 'Release'
         def newJob = job(Utilities.getFullJobName(project, "perf_${os}", isPR)) {
             // Set the label.
             label('performance')
             steps {
                     // Batch
                     batchFile("C:\\tools\\nuget install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory C:\\tools -Prerelease")
-                    batchFile("python C:\\tools\\Microsoft.BenchView.JSONFormat.0.1.0-pre008\\tools\\machinedata.py")
-                    batchFile("set __TestIntermediateDir=int&&build.cmd release x64")
-                    batchFile("tests\\runtest.cmd release x64")
+                    batchFile("python C:\\tools\\Microsoft.BenchView.JSONFormat.0.1.0-pre010\\tools\\machinedata.py")
+                    batchFile("set __TestIntermediateDir=int&&build.cmd release ${architecture}")
+                    batchFile("tests\\runtest.cmd release ${architecture}")
                     batchFile("tests\\scripts\\run-xunit-perf.cmd")
             }
         }
@@ -69,23 +71,40 @@ def static getOSGroup(def os) {
         def osGroup = getOSGroup(os)
         def architecture = 'x64'
         def configuration = 'Release'
-        def newJob = job(Utilities.getFullJobName(project, "perf_${osGroup}", isPR)) {
+        def newJob = job(Utilities.getFullJobName(project, "perf_${os}", isPR)) {
             steps {
                 shell("sudo bash ./tests/scripts/perf-prep.sh --branch=${projectName}")
-                shell("./init-tools.sh")
+                shell("sudo ./init-tools.sh")
                 shell("""sudo bash ./tests/scripts/run-xunit-perf.sh \\
                 --testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
                 --testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
                 --coreClrBinDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
                 --mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
-                --coreFxBinDir=\"\${WORKSPACE}/bin/${osGroup}.AnyCPU.Release;\${WORKSPACE}/bin/Unix.AnyCPU.Release;\${WORKSPACE}/bin/AnyOS.AnyCPU.Release\" \\
-                --coreFxNativeBinDir=\"\${WORKSPACE}/bin/${osGroup}.${architecture}.Release\"""")
+                --coreFxBinDir=\"\${WORKSPACE}/bin/${osGroup}.AnyCPU.${configuration};\${WORKSPACE}/bin/Unix.AnyCPU.${configuration};\${WORKSPACE}/bin/AnyOS.AnyCPU.${configuration}\" \\
+                --coreFxNativeBinDir=\"\${WORKSPACE}/bin/${osGroup}.${architecture}.${configuration}\"""")
             }
         }
 
         Utilities.setMachineAffinity(newJob, os, 'latest-or-auto') // Just run against Linux VM\92s for now.
 
+        // Save machinedata.json to /artifact/bin/ Jenkins dir
+        def archiveSettings = new ArchivalSettings()
+        archiveSettings.addFiles('sandbox/perf-*.xml')
+        archiveSettings.addFiles('machinedata.json')
+        Utilities.addArchival(newJob, archiveSettings)
+
         Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
+
+        // For perf, we need to keep the run results longer
+        newJob.with {
+            // Enable the log rotator
+            logRotator {
+                artifactDaysToKeep(7)
+                daysToKeep(300)
+                artifactNumToKeep(25)
+                numToKeep(1000)
+            }
+        }
         if (isPR) {
             TriggerBuilder builder = TriggerBuilder.triggerOnPullRequest()
             builder.setGithubContext("${os} Perf Tests")
index 3c232b0..800b5cb 100644 (file)
@@ -44,6 +44,18 @@ echo "branch = $perfBranch"
 echo "architecture = $perfArch"
 echo "configuration = $perfConfig"
 
+# Install nuget to download benchview package, which includes the script machinedata.py for machine data collection
+wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
+chmod u+x ./nuget.exe
+./nuget.exe install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory ./tests/scripts -Prerelease
+
+# Install python 3.5.2 to run machinedata.py for machine data collection
+sudo add-apt-repository ppa:fkrull/deadsnakes
+sudo apt-get update
+sudo apt-get --assume-yes install python3.5
+python3.5 --version
+python3.5 ./tests/scripts/Microsoft.BenchView.JSONFormat.0.1.0-pre010/tools/machinedata.py
+
 # Set up the copies
 # Coreclr build containing the tests and mscorlib
 curl http://dotnet-ci.cloudapp.net/job/$perfBranch/job/master/job/release_windows_nt/lastSuccessfulBuild/artifact/bin/tests/tests.zip -o tests.zip
index e56194c..39202ec 100644 (file)
@@ -386,18 +386,9 @@ echo "CORE_ROOT dir = $CORE_ROOT"
 
 DO_SETUP=TRUE
 
-dir $testNativeBinDir/../../../../..
-echo 'dir $testNativeBinDir/../../../../..'
-dir $testNativeBinDir/../../../../../packages
-echo 'dir $testNativeBinDir/../../../../../packages'
-dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli
-echo 'dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli'
-dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035
-echo 'dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035'
-
 if [ ${DO_SETUP} == "TRUE" ]; then
-cp  $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib/netstandard1.3/Microsoft.DotNet.xunit.performance.runner.cli.dll .
-cp  $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.run.core/1.0.0-alpha-build0035/lib/dotnet/*.dll .
+cp  $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0040/lib/netstandard1.3/Microsoft.DotNet.xunit.performance.runner.cli.dll .
+cp  $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.run.core/1.0.0-alpha-build0040/lib/dotnet/*.dll .
 fi
 
 # Run coreclr performance tests
@@ -414,5 +405,7 @@ cp $testcase .
 
 chmod u+x ./corerun
 ./corerun Microsoft.DotNet.xunit.performance.runner.cli.dll $test -runner xunit.console.netcore.exe -runnerhost ./corerun -verbose -runid perf-$testname
-
 done
+
+mkdir ../../../../../sandbox
+cp *.xml ../../../../../sandbox