[zorg] r318251 - zorg/jenkins: Rename benchmark.groovy to common.groovy, refactor
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 17:50:43 PST 2017
Author: matze
Date: Tue Nov 14 17:50:43 2017
New Revision: 318251
URL: http://llvm.org/viewvc/llvm-project?rev=318251&view=rev
Log:
zorg/jenkins: Rename benchmark.groovy to common.groovy, refactor
Added:
zorg/trunk/zorg/jenkins/common.groovy
- copied, changed from r318250, zorg/trunk/zorg/jenkins/benchmark.groovy
Removed:
zorg/trunk/zorg/jenkins/benchmark.groovy
Modified:
zorg/trunk/zorg/jenkins/jobs/jobs/fail_test
zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O0-g
zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O3-flto
zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Os
zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Oz
zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-O3-flto
zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-Os-flto
zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O0-g
zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O3
zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-globalisel-O0-g
zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O0-g
zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O3
zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64h-O3
Removed: zorg/trunk/zorg/jenkins/benchmark.groovy
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/benchmark.groovy?rev=318250&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/benchmark.groovy (original)
+++ zorg/trunk/zorg/jenkins/benchmark.groovy (removed)
@@ -1,105 +0,0 @@
-#!/usr/bin/env groovy
-
- at NonCPS
-private def basename(path) {
- return path.drop(path.lastIndexOf('/') + 1)
-}
-
- at NonCPS
-private def render_template(template_text, log_summary) {
- def binding = [
- 'currentBuild': currentBuild,
- 'env': env,
- 'log_summary': log_summary,
- ]
- def engine = new groovy.text.SimpleTemplateEngine()
- def template_eng = engine.createTemplate(template_text).make(binding)
- return template_eng.toString()
-}
-
-private def post_build() {
- // Analyze build log.
- def base_url = 'http://labmaster2:8080/green'
- def build_url = currentBuild.getRawBuild().getUrl()
- def log_url = "${base_url}/${build_url}consoleText"
- def ret = sh \
- script: "curl '${log_url}' -s | config/zorg/jenkins/inspect_log.py > log_summary.html",
- returnStatus: true
- if (ret != 0 && currentBuild.currentResult == 'SUCCESS')
- currentBuild.result = 'UNSTABLE'
- def log_summary = readFile 'log_summary.html'
-
- // Update job description.
- description_template = readTrusted 'zorg/jenkins/job_description.template'
- def descr_body = render_template(description_template, log_summary)
- if (currentBuild.description == null)
- currentBuild.description = ""
- currentBuild.description += descr_body
-
- // Send notification email.
- def prev_build = currentBuild.getPreviousBuild()
- if ((prev_build == null ||
- prev_build.result != currentBuild.currentResult) &&
- currentBuild.currentResult == 'FAILURE') {
- def email_template = readTrusted 'zorg/jenkins/email.template'
- def body = render_template(email_template, log_summary)
- emailext subject: '$DEFAULT_SUBJECT',
- presendScript: '$DEFAULT_PRESEND_SCRIPT',
- postsendScript: '$DEFAULT_POSTSEND_SCRIPT',
- recipientProviders: [
- [$class: 'CulpritsRecipientProvider'],
- [$class: 'DevelopersRecipientProvider'],
- [$class: 'RequesterRecipientProvider'],
- ],
- replyTo: '$DEFAULT_REPLYTO',
- to: '$DEFAULT_RECIPIENTS',
- body: body
- }
- // TODO: Notify IRC.
-}
-
-def pipeline(label, body) {
- properties([
- parameters([
- string(name: 'ARTIFACT',
- defaultValue: 'http://labmaster2.local/artifacts/clang-stage1-configure-RA_build/latest')
- ])
- ])
-
- currentBuild.displayName = basename(params.ARTIFACT)
- node(label) {
- try {
- stage('main') {
- dir('config') {
- svn url: 'http://llvm.org/svn/llvm-project/zorg/trunk', poll: false
- }
- body()
- }
- } catch(hudson.AbortException e) {
- // No need to print the exception if something fails inside a 'sh'
- // step.
- currentBuild.result = 'FAILURE'
- } catch (Exception e) {
- currentBuild.result = 'FAILURE'
- throw e
- } finally {
- stage('post') {
- post_build()
- }
- }
- }
-}
-
-def testsuite_pipeline(label, body) {
- pipeline(label) {
- dir('lnt') {
- svn url: 'http://llvm.org/svn/llvm-project/lnt/trunk', poll: false
- }
- dir('test-suite') {
- svn url: 'http://llvm.org/svn/llvm-project/test-suite/trunk', poll: false
- }
- body()
- }
-}
-
-return this
Copied: zorg/trunk/zorg/jenkins/common.groovy (from r318250, zorg/trunk/zorg/jenkins/benchmark.groovy)
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/common.groovy?p2=zorg/trunk/zorg/jenkins/common.groovy&p1=zorg/trunk/zorg/jenkins/benchmark.groovy&r1=318250&r2=318251&rev=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/benchmark.groovy (original)
+++ zorg/trunk/zorg/jenkins/common.groovy Tue Nov 14 17:50:43 2017
@@ -58,15 +58,7 @@ private def post_build() {
// TODO: Notify IRC.
}
-def pipeline(label, body) {
- properties([
- parameters([
- string(name: 'ARTIFACT',
- defaultValue: 'http://labmaster2.local/artifacts/clang-stage1-configure-RA_build/latest')
- ])
- ])
-
- currentBuild.displayName = basename(params.ARTIFACT)
+def task_pipeline(label, body) {
node(label) {
try {
stage('main') {
@@ -90,8 +82,20 @@ def pipeline(label, body) {
}
}
+def benchmark_pipeline(label, body) {
+ properties([
+ parameters([
+ string(name: 'ARTIFACT',
+ defaultValue: 'http://labmaster2.local/artifacts/clang-stage1-configure-RA_build/latest')
+ ])
+ ])
+
+ currentBuild.displayName = basename(params.ARTIFACT)
+ task_pipeline(label, body)
+}
+
def testsuite_pipeline(label, body) {
- pipeline(label) {
+ benchmark_pipeline(label) {
dir('lnt') {
svn url: 'http://llvm.org/svn/llvm-project/lnt/trunk', poll: false
}
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/fail_test
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/fail_test?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/fail_test (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/fail_test Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.pipeline('green-dragon-03') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.task_pipeline('green-dragon-03') {
stage('main') {
sh """
echo "XPASS: Pick this line"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O0-g
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O0-g?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O0-g (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O0-g Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-04') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-04') {
sh """
LNT_FLAGS+=" -C config/tasks/cmake/caches/target-arm64-iphoneos.cmake"
LNT_FLAGS+=" -C config/tasks/cmake/caches/opt-O0-g.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O3-flto
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O3-flto?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O3-flto (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O3-flto Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-04') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-04') {
sh """
LNT_FLAGS+=" -C config/tasks/cmake/caches/target-arm64-iphoneos.cmake"
LNT_FLAGS+=" -C config/tasks/cmake/caches/opt-O3-flto.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Os
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Os?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Os (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Os Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-06') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-06') {
sh """
LNT_FLAGS+=" -C config/tasks/cmake/caches/target-arm64-iphoneos.cmake"
LNT_FLAGS+=" -C config/tasks/cmake/caches/opt-Os.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Oz
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Oz?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Oz (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Oz Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-06') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-06') {
sh """
LNT_FLAGS+=" -C config/tasks/cmake/caches/target-arm64-iphoneos.cmake"
LNT_FLAGS+=" -C config/tasks/cmake/caches/opt-Oz.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-O3-flto
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-O3-flto?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-O3-flto (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-O3-flto Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-06') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-06') {
sh """
LNT_FLAGS+=" -C config/tasks/cmake/caches/target-x86_64-macos.cmake"
LNT_FLAGS+=" -C config/tasks/cmake/caches/opt-O3-flto.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-Os-flto
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-Os-flto?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-Os-flto (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-Os-flto Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-07') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-07') {
sh """
LNT_FLAGS+=" -C config/tasks/cmake/caches/target-x86_64-macos.cmake"
LNT_FLAGS+=" -C config/tasks/cmake/caches/opt-Os-flto.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O0-g
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O0-g?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O0-g (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O0-g Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-12') {
sh """
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/target-arm64-iphoneos.cmake"
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/opt-O0-g.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O3
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O3?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O3 (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O3 Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-12') {
sh """
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/target-arm64-iphoneos.cmake"
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/opt-O3.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-globalisel-O0-g
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-globalisel-O0-g?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-globalisel-O0-g (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-globalisel-O0-g Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-03') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-03') {
sh """
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/target-arm64-iphoneos.cmake"
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/opt-O0-g.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O0-g
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O0-g?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O0-g (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O0-g Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-12') {
sh """
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/target-x86_64-macos.cmake"
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/opt-O0-g.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O3
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O3?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O3 (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O3 Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-12') {
sh """
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/target-x86_64-macos.cmake"
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/opt-O3.cmake"
Modified: zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64h-O3
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64h-O3?rev=318251&r1=318250&r2=318251&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64h-O3 (original)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64h-O3 Tue Nov 14 17:50:43 2017
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy
-def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
-benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+def common = evaluate readTrusted('zorg/jenkins/common.groovy')
+common.testsuite_pipeline(label: 'green-dragon-12') {
sh """
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/target-x86_64h-macos.cmake"
CMAKE_FLAGS+=" -C ../config/tasks/cmake/caches/opt-O3.cmake"
More information about the llvm-commits
mailing list