Create coreclr perf jobs for Linux.
authorSmile Wei <xiwe@microsoft.com>
Tue, 30 Aug 2016 19:31:25 +0000 (12:31 -0700)
committerSmile Wei <xiwe@microsoft.com>
Wed, 7 Sep 2016 18:42:27 +0000 (11:42 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/bd59a687114248831f6343c40d2b4b80c08b01b5

src/coreclr/perf.groovy
src/coreclr/tests/scripts/perf-prep.sh [new file with mode: 0644]
src/coreclr/tests/scripts/run-xunit-perf.sh

index e7100f8..71a93f4 100644 (file)
@@ -4,7 +4,8 @@ import jobs.generation.*;
 
 def project = GithubProject
 def branch = GithubBranchName
-def projectFolder = Utilities.getFolderName(project) + '/' + Utilities.getFolderName(branch)
+def projectName = Utilities.getFolderName(project)
+def projectFolder = projectName + '/' + Utilities.getFolderName(branch)
 
 def static getOSGroup(def os) {
     def osGroupMap = ['Ubuntu':'Linux',
@@ -67,51 +68,11 @@ def static getOSGroup(def os) {
     ['Ubuntu'].each { os ->
         def osGroup = getOSGroup(os)
         def architecture = 'x64'
-        def configuration = 'Checked'
+        def configuration = 'Release'
         def newJob = job(Utilities.getFullJobName(project, "perf_${osGroup}", isPR)) {
-            parameters {
-                stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
-                stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
-            }
-                    
             steps {
-                // Set up the copies
-                // Coreclr build containing the tests and mscorlib
-                copyArtifacts("dotnet_coreclr/master/x64_checked_windows_nt_pri1_bld") {
-                    excludePatterns('**/testResults.xml', '**/*.ni.dll')
-                    buildSelector {
-                        buildNumber('${CORECLR_WINDOWS_BUILD}')
-                    }
-                }
-
-                // Coreclr build we are trying to test
-                copyArtifacts("dotnet_coreclr/master/checked_ubuntu") {
-                    excludePatterns('**/testResults.xml', '**/*.ni.dll')
-                    buildSelector {
-                        buildNumber('${CORECLR_BUILD}')
-                    }
-                }
-
-                def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' + 'master'
-                        
-                // Corefx components.  We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
-                def osJobName = (os == 'Ubuntu') ? 'ubuntu14.04' : os.toLowerCase()
-                copyArtifacts("${corefxFolder}/${osJobName}_release") {
-                    includePatterns('bin/build.tar.gz')
-                    buildSelector {
-                        latestSuccessful(true)
-                    }
-                }
-                        
-                // Unpack the corefx binaries
-                shell("tar -xf ./bin/build.tar.gz")
-
-                // Unzip the tests first.  Exit with 0
-                shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
-                            
-                // Execute the tests                               
-                shell('./init-tools.sh')
-
+                shell("sudo bash ./tests/scripts/perf-prep.sh --branch=${projectName}")
+                shell("./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\" \\
@@ -122,10 +83,7 @@ def static getOSGroup(def os) {
             }
         }
 
-        // Save machinedata.json to /artifact/bin/ Jenkins dir
-        def archiveSettings = new ArchivalSettings()
-        archiveSettings.addFiles('perf-*.xml')
-        Utilities.addArchival(newJob, archiveSettings)
+        Utilities.setMachineAffinity(newJob, os, 'latest-or-auto') // Just run against Linux VM\92s for now.
 
         Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
         if (isPR) {
diff --git a/src/coreclr/tests/scripts/perf-prep.sh b/src/coreclr/tests/scripts/perf-prep.sh
new file mode 100644 (file)
index 0000000..3c232b0
--- /dev/null
@@ -0,0 +1,70 @@
+#!/usr/bin/env bash
+
+function print_usage {
+    echo ''
+    echo 'CoreCLR perf test environment set up script on Linux.'
+    echo ''
+    echo 'Typical command line:'
+    echo ''
+    echo 'coreclr/tests/scripts/perf-perp.sh'
+    echo '    --branch="dotnet_coreclr"'
+    echo ''
+    echo 'Required arguments:'
+    echo '  --branch=<path>             : branch where coreclr/corefx/test bits are copied from (e.g. dotnet_coreclr).'
+}
+
+# Exit code constants
+readonly EXIT_CODE_SUCCESS=0       # Script ran normally.
+
+# Argument variables
+perfArch="x64"
+perfConfig="Release"
+perfBranch=
+
+for i in "$@"
+do
+    case $i in
+        -h|--help)
+            print_usage
+            exit $EXIT_CODE_SUCCESS
+            ;;
+        --branch=*)
+            perfBranch=${i#*=}
+            ;;
+        *)
+            echo "Unknown switch: $i"
+            print_usage
+            exit $EXIT_CODE_SUCCESS
+            ;;
+    esac
+done
+
+perfBranch="dotnet_coreclr"
+echo "branch = $perfBranch"
+echo "architecture = $perfArch"
+echo "configuration = $perfConfig"
+
+# 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
+
+# Coreclr build we are trying to test
+curl http://dotnet-ci.cloudapp.net/job/$perfBranch/job/master/job/release_ubuntu/lastSuccessfulBuild/artifact/*zip*/archive.zip -o bin.zip
+
+# Corefx components.  We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
+curl http://dotnet-ci.cloudapp.net/job/dotnet_corefx/job/master/job/ubuntu14.04_release/lastSuccessfulBuild/artifact/bin/build.tar.gz -o build.tar.gz
+
+# Unpack the corefx binaries
+tar -xf build.tar.gz
+
+# Unzip the coreclr binaries
+unzip -q -o bin.zip
+
+# Copy coreclr binaries to the right dir
+cp -R ./archive/bin/obj ./bin
+cp -R ./archive/bin/Product ./bin
+
+# Unzip the tests first.  Exit with 0
+mkdir ./bin/tests
+unzip -q -o tests.zip -d ./bin/tests/Windows_NT.$perfArch.$perfConfig || exit 0
+echo "unzip tests to ./bin/tests/Windows_NT.$perfArch.$perfConfig"
index cea29c0..e56194c 100644 (file)
@@ -371,11 +371,6 @@ fi
 export NUGET_PACKAGES=$testNativeBinDir/../../../../packages
 echo "NUGET_PACKAGES = $NUGET_PACKAGES"
 
-echo "dir $testNativeBinDir/../../../../Tools"
-dir $testNativeBinDir/../../../../Tools
-echo "dir $testNativeBinDir/../../../../Tools/dotnetcli"
-dir $testNativeBinDir/../../../../Tools/dotnetcli
-
 pushd $testNativeBinDir/../../../../tests/scripts
 $testNativeBinDir/../../../../Tools/dotnetcli/dotnet restore --fallbacksource https://dotnet.myget.org/F/dotnet-buildtools/ --fallbacksource https://dotnet.myget.org/F/dotnet-core/
 popd
@@ -385,35 +380,24 @@ create_core_overlay
 precompile_overlay_assemblies
 copy_test_native_bin_to_test_root
 
-echo "find $testNativeBinDir/../../../../../../ -name 'Microsoft.DotNet.xunit.performance.runner.cli.dll'"
-find $testNativeBinDir/../../../../../../ -name 'Microsoft.DotNet.xunit.performance.runner.cli.dll'
-echo "find $testNativeBinDir/../../../../../ -name 'Microsoft.DotNet.xunit.performance.runner.cli.dll'"
-find $testNativeBinDir/../../../../../ -name 'Microsoft.DotNet.xunit.performance.runner.cli.dll'
-
 # Deploy xunit performance packages
 cd $CORE_ROOT
+echo "CORE_ROOT dir = $CORE_ROOT"
 
 DO_SETUP=TRUE
 
-if [ ${DO_SETUP} == "TRUE" ]; then
-
-echo "dir $testNativeBinDir/../../../../../"
-dir $testNativeBinDir/../../../../../
-echo "dir $testNativeBinDir/../../../../../packages"
+dir $testNativeBinDir/../../../../..
+echo 'dir $testNativeBinDir/../../../../..'
 dir $testNativeBinDir/../../../../../packages
-echo "dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli"
+echo 'dir $testNativeBinDir/../../../../../packages'
 dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli
-echo "dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035"
+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/lib"
-dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib
-echo "dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib/netstandard1.3"
-dir $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib/netstandard1.3
-
-sudo cp  $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.runner.cli/1.0.0-alpha-build0035/lib/netstandard1.3/Microsoft.DotNet.xunit.performance.runner.cli.dll .
-
-sudo cp  $testNativeBinDir/../../../../../packages/Microsoft.DotNet.xunit.performance.run.core/1.0.0-alpha-build0035/lib/dotnet/*.dll .
+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 .
 fi
 
 # Run coreclr performance tests
@@ -428,6 +412,7 @@ echo "....Running $testname"
 
 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