summaryrefslogtreecommitdiff
path: root/perf.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'perf.groovy')
-rw-r--r--perf.groovy141
1 files changed, 73 insertions, 68 deletions
diff --git a/perf.groovy b/perf.groovy
index a95b68142c..d7eb783cb9 100644
--- a/perf.groovy
+++ b/perf.groovy
@@ -4,10 +4,11 @@ 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',
+ def osGroupMap = ['Ubuntu14.04':'Linux',
'RHEL7.2': 'Linux',
'Ubuntu16.04': 'Linux',
'Debian8.4':'Linux',
@@ -19,7 +20,7 @@ def static getOSGroup(def os) {
'OpenSUSE13.2': 'Linux',
'OpenSUSE42.1': 'Linux',
'LinuxARMEmulator': 'Linux']
- def osGroup = osGroupMap.get(os, null)
+ def osGroup = osGroupMap.get(os, null)
assert osGroup != null : "Could not find os group for ${os}"
return osGroupMap[os]
}
@@ -27,9 +28,6 @@ def static getOSGroup(def os) {
[true, false].each { isPR ->
['Windows_NT'].each { os ->
['x64'].each { architecture ->
- def configuration = 'Release'
- def runType = isPR ? 'private' : 'rolling'
- def benchViewName = isPR ? 'coreclr private %ghprbPullTitle%' : 'coreclr rolling %GIT_BRANCH_WITHOUT_ORIGIN% %GIT_COMMIT%'
def newJob = job(Utilities.getFullJobName(project, "perf_perflab_${os}", isPR)) {
// Set the label.
label('windows_clr_perf')
@@ -39,20 +37,32 @@ def static getOSGroup(def os) {
}
}
+ if (isPR)
+ {
+ parameters
+ {
+ stringParam('BenchviewCommitName', '%ghprbPullTitle%', 'The name that you will be used to build the full title of a run in Benchview. The final name will be of the form <branch> private BenchviewCommitName')
+ }
+ }
+ def configuration = 'Release'
+ def runType = isPR ? 'private' : 'rolling'
+ def benchViewName = isPR ? 'coreclr private %BenchviewCommitName%' : 'coreclr rolling %GIT_BRANCH_WITHOUT_ORIGIN% %GIT_COMMIT%'
+
steps {
// Batch
-
- batchFile("C:\\Tools\\nuget.exe install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory C:\\tools -Prerelease -ExcludeVersion")
+
+ batchFile("if exist \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\" rmdir /s /q \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\"")
+ batchFile("C:\\Tools\\nuget.exe install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory \"%WORKSPACE%\" -Prerelease -ExcludeVersion")
//Do this here to remove the origin but at the front of the branch name as this is a problem for BenchView
//we have to do it all as one statement because cmd is called each time and we lose the set environment variable
batchFile("if [%GIT_BRANCH:~0,7%] == [origin/] (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%) else (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%)\n" +
- "py C:\\tools\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py --name " + "\"" + benchViewName + "\"" + " --user " + "\"dotnet-bot@microsoft.com\"\n" +
- "py C:\\tools\\Microsoft.BenchView.JSONFormat\\tools\\build.py git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type " + runType)
- batchFile("py C:\\tools\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py")
+ "py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name " + "\"" + benchViewName + "\"" + " --user " + "\"dotnet-bot@microsoft.com\"\n" +
+ "py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type " + runType)
+ batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
batchFile("set __TestIntermediateDir=int&&build.cmd release ${architecture}")
batchFile("tests\\runtest.cmd release ${architecture} GenerateLayoutOnly")
- batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} -testBinLoc bin\\tests\\Windows_NT.${architecture}.Release\\performance\\perflab\\Perflab -library -uploadToBenchview C:\\Tools\\Microsoft.Benchview.JSONFormat\\tools -runtype " + runType)
- batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} -testBinLoc bin\\tests\\Windows_NT.${architecture}.Release\\Jit\\Performance\\CodeQuality -uploadToBenchview C:\\Tools\\Microsoft.Benchview.JSONFormat\\tools -runtype " + runType)
+ batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} -testBinLoc bin\\tests\\Windows_NT.${architecture}.Release\\performance\\perflab\\Perflab -library -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype " + runType)
+ batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} -testBinLoc bin\\tests\\Windows_NT.${architecture}.Release\\Jit\\Performance\\CodeQuality -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype " + runType)
}
}
@@ -63,7 +73,7 @@ def static getOSGroup(def os) {
Utilities.addArchival(newJob, archiveSettings)
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
-
+
if (isPR) {
TriggerBuilder builder = TriggerBuilder.triggerOnPullRequest()
builder.setGithubContext("${os} CoreCLR Perf Tests")
@@ -83,72 +93,67 @@ def static getOSGroup(def os) {
// Create the Linux/OSX/CentOS coreclr test leg for debug and release and each scenario
[true, false].each { isPR ->
- ['Ubuntu'].each { os ->
- def osGroup = getOSGroup(os)
- def architecture = 'x64'
- def configuration = 'Checked'
- 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")
- }
-
+ ['Ubuntu14.04'].each { os ->
+ def newJob = job(Utilities.getFullJobName(project, "perf_${os}", isPR)) {
+
+ label('linux_clr_perf')
+ wrappers {
+ credentialsBinding {
+ string('BV_UPLOAD_SAS_TOKEN', 'CoreCLR Perf BenchView Sas')
+ }
+ }
+
+ if (isPR)
+ {
+ parameters
+ {
+ stringParam('BenchviewCommitName', '\$ghprbPullTitle', 'The name that you will be used to build the full title of a run in Benchview. The final name will be of the form <branch> private BenchviewCommitName')
+ }
+ }
+ def osGroup = getOSGroup(os)
+ def architecture = 'x64'
+ def configuration = 'Release'
+ def runType = isPR ? 'private' : 'rolling'
+ def benchViewName = isPR ? 'coreclr private \$BenchviewCommitName' : 'coreclr rolling \$GIT_BRANCH_WITHOUT_ORIGIN \$GIT_COMMIT'
+
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/run-xunit-perf.sh \\
+ shell("bash ./tests/scripts/perf-prep.sh")
+ shell("./init-tools.sh")
+ shell("./build.sh ${architecture} ${configuration}")
+ shell("GIT_BRANCH_WITHOUT_ORIGIN=\$(echo \$GIT_BRANCH | sed \"s/[^/]*\\/\\(.*\\)/\\1 /\")\n" +
+ "python3.5 \"\${WORKSPACE}/tests/scripts/Microsoft.BenchView.JSONFormat/tools/submission-metadata.py\" --name " + "\"" + benchViewName + "\"" + " --user " + "\"dotnet-bot@microsoft.com\"\n" +
+ "python3.5 \"\${WORKSPACE}/tests/scripts/Microsoft.BenchView.JSONFormat/tools/build.py\" git --branch \$GIT_BRANCH_WITHOUT_ORIGIN --type " + runType)
+ shell("""sudo -E 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}/corefx/bin/${osGroup}.AnyCPU.${configuration};\${WORKSPACE}/corefx/bin/Unix.AnyCPU.${configuration};\${WORKSPACE}/corefx/bin/AnyOS.AnyCPU.${configuration}\" \\
+ --coreFxNativeBinDir=\"\${WORKSPACE}/corefx/bin/${osGroup}.${architecture}.${configuration}\" \\
+ --runType=\"${runType}\" \\
+ --benchViewOS=\"${os}\" \\
+ --uploadToBenchview""")
}
}
- Utilities.setMachineAffinity(newJob, os, 'latest-or-auto') // Just run against Linux VM's for now.
-
// Save machinedata.json to /artifact/bin/ Jenkins dir
def archiveSettings = new ArchivalSettings()
- archiveSettings.addFiles('perf-*.xml')
+ 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")
@@ -163,4 +168,4 @@ def static getOSGroup(def os) {
builder.emitTrigger(newJob)
}
} // os
-} // isPR \ No newline at end of file
+} // isPR