[zorg] r317540 - Create a bunch of jenkins pipelines.
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 6 19:18:37 PST 2017
Author: matze
Date: Mon Nov 6 19:18:37 2017
New Revision: 317540
URL: http://llvm.org/viewvc/llvm-project?rev=317540&view=rev
Log:
Create a bunch of jenkins pipelines.
Jenkins pipelines allow us to control most aspects of jenkins job
configurations from the zorg repository.
As a start add pipelines for:
- lnt ctmark compiletime performance jobs
- lnt test-suite performance jobs
- verify-machineinstrs jobs
- a relay job for each category
This will be used by greendragon.
Added:
zorg/trunk/tasks/cmake/caches/target-x86_64-macos.cmake
- copied, changed from r317539, zorg/trunk/tasks/cmake/caches/target-x86_64-macosx.cmake
zorg/trunk/tasks/cmake/caches/target-x86_64h-macos.cmake
- copied, changed from r317539, zorg/trunk/tasks/cmake/caches/target-x86_64h-macosx.cmake
zorg/trunk/zorg/jenkins/benchmark.groovy
zorg/trunk/zorg/jenkins/email.template
zorg/trunk/zorg/jenkins/inspect_log.py (with props)
zorg/trunk/zorg/jenkins/job_description.template
zorg/trunk/zorg/jenkins/jobs/
zorg/trunk/zorg/jenkins/jobs/.gitignore
zorg/trunk/zorg/jenkins/jobs/auth.example
zorg/trunk/zorg/jenkins/jobs/config
zorg/trunk/zorg/jenkins/jobs/delete_old_jobs.py (with props)
zorg/trunk/zorg/jenkins/jobs/description.txt
zorg/trunk/zorg/jenkins/jobs/jobs/
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/relay-lnt-ctmark
zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-test-suite
zorg/trunk/zorg/jenkins/jobs/jobs/relay-test-suite-verify-machineinstrs
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
zorg/trunk/zorg/jenkins/jobs/update_jobs.sh (with props)
zorg/trunk/zorg/jenkins/jobs/util/
zorg/trunk/zorg/jenkins/jobs/util/create.sh (with props)
zorg/trunk/zorg/jenkins/jobs/util/delete_job.sh (with props)
zorg/trunk/zorg/jenkins/jobs/util/delete_old_jobs.py (with props)
zorg/trunk/zorg/jenkins/jobs/util/get.sh (with props)
zorg/trunk/zorg/jenkins/jobs/util/make_pipeline.py (with props)
zorg/trunk/zorg/jenkins/jobs/util/query.sh (with props)
zorg/trunk/zorg/jenkins/jobs/util/update.sh (with props)
zorg/trunk/zorg/jenkins/patterns.py
zorg/trunk/zorg/jenkins/relay.groovy
Removed:
zorg/trunk/tasks/cmake/caches/target-x86_64-macosx.cmake
zorg/trunk/tasks/cmake/caches/target-x86_64h-macosx.cmake
Copied: zorg/trunk/tasks/cmake/caches/target-x86_64-macos.cmake (from r317539, zorg/trunk/tasks/cmake/caches/target-x86_64-macosx.cmake)
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/tasks/cmake/caches/target-x86_64-macos.cmake?p2=zorg/trunk/tasks/cmake/caches/target-x86_64-macos.cmake&p1=zorg/trunk/tasks/cmake/caches/target-x86_64-macosx.cmake&r1=317539&r2=317540&rev=317540&view=diff
==============================================================================
(empty)
Removed: zorg/trunk/tasks/cmake/caches/target-x86_64-macosx.cmake
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/tasks/cmake/caches/target-x86_64-macosx.cmake?rev=317539&view=auto
==============================================================================
--- zorg/trunk/tasks/cmake/caches/target-x86_64-macosx.cmake (original)
+++ zorg/trunk/tasks/cmake/caches/target-x86_64-macosx.cmake (removed)
@@ -1,3 +0,0 @@
-set(XCRUN_FLAGS --sdk macosx)
-set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING "")
-include(${CMAKE_CURRENT_LIST_DIR}/util/xcode_sdk.cmake)
Copied: zorg/trunk/tasks/cmake/caches/target-x86_64h-macos.cmake (from r317539, zorg/trunk/tasks/cmake/caches/target-x86_64h-macosx.cmake)
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/tasks/cmake/caches/target-x86_64h-macos.cmake?p2=zorg/trunk/tasks/cmake/caches/target-x86_64h-macos.cmake&p1=zorg/trunk/tasks/cmake/caches/target-x86_64h-macosx.cmake&r1=317539&r2=317540&rev=317540&view=diff
==============================================================================
(empty)
Removed: zorg/trunk/tasks/cmake/caches/target-x86_64h-macosx.cmake
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/tasks/cmake/caches/target-x86_64h-macosx.cmake?rev=317539&view=auto
==============================================================================
--- zorg/trunk/tasks/cmake/caches/target-x86_64h-macosx.cmake (original)
+++ zorg/trunk/tasks/cmake/caches/target-x86_64h-macosx.cmake (removed)
@@ -1,3 +0,0 @@
-set(XCRUN_FLAGS --sdk macosx)
-set(CMAKE_OSX_ARCHITECTURES x86_64h CACHE STRING "")
-include(${CMAKE_CURRENT_LIST_DIR}/util/xcode_sdk.cmake)
Added: zorg/trunk/zorg/jenkins/benchmark.groovy
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/benchmark.groovy?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/benchmark.groovy (added)
+++ zorg/trunk/zorg/jenkins/benchmark.groovy Mon Nov 6 19:18:37 2017
@@ -0,0 +1,92 @@
+#!/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"
+ sh "curl '${log_url}' -s | config/zorg/jenkins/inspect_log.py > log_summary.html"
+ 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.
+ if (currentBuild.getPreviousBuild().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',
+ 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(Exception e) {
+ currentBuild.result = 'FAILURE'
+ } 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'
+ }
+ body()
+ }
+}
+
+return this
Added: zorg/trunk/zorg/jenkins/email.template
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/email.template?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/email.template (added)
+++ zorg/trunk/zorg/jenkins/email.template Mon Nov 6 19:18:37 2017
@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<head>
+ <title>Report</title>
+ <style>
+ body {
+ -webkit-font-smoothing: antialiased;
+ font-family: "Helvetica Neue", sans-serif;
+ font-weight: 300;
+ color: #393939;
+ margin: 0;
+ padding: 20px;
+ }
+ .header {
+ margin-left: 20px;
+ padding: 20px 20px 20px 0;
+ border-bottom: 1px solid #e5e5e5;
+ }
+ .report-title{
+ font-family: "Helvetica Neue", sans-serif;
+ display: inline-block;
+ float: left;
+ margin: 20px 0;
+ font-size: 24px;
+ color: #55a3fd;
+ }
+ .title {
+ font-size: 24px;
+ }
+ .content {
+ padding: 20px;
+ }
+ .display {
+ width: 100%;
+ height: 100%;
+ }
+ .commit-message {
+ font-family: "Menlo", fixed;
+ }
+ .title {
+ text-align: center;
+ }
+ .date {
+ text-align: left;
+ }
+ .display {
+ display: inline-block;
+ width: auto;
+ }
+ .header {
+ overflow: auto;
+ padding: 20px 20px 5px 0;
+ width: 660px;
+ }
+ a {
+ color: #007aff;
+ text-decoration: none;
+ }
+ tr {
+ text-align: left;
+ }
+ .links a {
+ text-decoration: none;
+ color: white;
+ font-weight: 500;
+ padding: 15px;
+ background: #55a3fd;
+ font-size: 14px;
+ }
+
+ @-webkit-keyframes toRed {
+ from {color: black;}
+ to {color: red;}
+ }
+ @-webkit-keyframes toGreen {
+ from {color: black;}
+ to {color: green;}
+ }
+
+ .FAILURE {
+ color: red;
+ -webkit-animation-name: toRed; /* Chrome, Safari, Opera */
+ -webkit-animation-duration: 2s; /* Chrome, Safari, Opera */
+ }
+ .SUCCESS {
+ color: green;
+ -webkit-animation-name: toGreen; /* Chrome, Safari, Opera */
+ -webkit-animation-duration: 2s; /* Chrome, Safari, Opera */
+ }
+
+ </style>
+ <head>
+ <body>
+ <h1>[<font class="${currentBuild.currentResult}">${currentBuild.currentResult}</font>] ${env.JOB_NAME} [#${env.BUILD_NUMBER}]</h1>
+
+<table style="align=left;">
+ <tr><th>Build URL:</th><td><a href="${env.BUILD_URL}">${env.BUILD_URL}</a></td></tr>
+ <tr><th>Project:</th><td>${env.JOB_NAME}</td></tr>
+ <tr><th>Date of build:</th><td>{it.timestampString}</td></tr>
+ <tr><th>Build duration:</th><td>{build.durationString}</td></tr>
+</table>
+
+<% if (log_summary != "") { %>
+<h2>Issues</h2>
+${log_summary}
+<% } %>
+
+<!-- This was using BUILD_FAILURE_ANALYZER(includeTitle: true, includeIndications: true, useHtmlFormat: true), but that doesn't work for pipeline based jobs -->
+
+<!-- JUnit TEMPLATE -->
+
+<!-- CHANGE SET -->
+<h2>Changes</h2>
+<ul>
+<% def changeSets = currentBuild.getChangeSets()
+def hadChanges = false
+changeSets.each { changeSet ->
+%>
+<% changeSet.each { cs ->
+ hadChanges = true
+ aUser = cs.author %>
+ <li>Commit <b>${cs.revision}</b> by <b><%= aUser != null ? aUser.displayName : it.author.displayName %>:</b> <p class="commit-message" style="white-space: pre-wrap;">${cs.msg}</p>
+ <ul>
+<% cs.affectedFiles.each { %>
+ <li class="change-${it.editType.name}"><b>${it.editType.name}</b>: ${it.path}</li>
+<% } %>
+ </ul>
+ </li>
+ <br>
+<% }
+}
+
+if (!hadChanges) { %>
+ <li>No Changes</li>
+<% } %>
+</ul>
+
+ </body>
Added: zorg/trunk/zorg/jenkins/inspect_log.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/inspect_log.py?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/inspect_log.py (added)
+++ zorg/trunk/zorg/jenkins/inspect_log.py Mon Nov 6 19:18:37 2017
@@ -0,0 +1,149 @@
+#!/usr/bin/env python
+#
+# Search a given log file for patterns defined in patterns.py and produce a
+# HTML snippet for the matching lines.
+#
+# Ideas for improvements:
+# - Group together similar issues. A good rule would be by description
+# so if a warning/error happens for several source files in the project
+# we would only list it as a single issue. Should extend the description
+# with the count (i.e. "warning: bla blup [20 times]")
+# Could merge the first 2 or 3 instances to show in the details section.
+# - Write highlighted html log with all matches highlighted/linked?
+from cgi import escape
+from collections import deque
+from patterns import default_search
+import os.path
+import re
+import sys
+
+
+_JENKINS_POOL_PATTERN = r'\[.*]\s'
+_JENKINS_POOL_REGEX = re.compile('^'+_JENKINS_POOL_PATTERN)
+
+
+class _Matcher(object):
+ '''Matching engine. Keeps data structures to match a single line against
+ a fixed list of patterns.'''
+ def __init__(self, patterns):
+ # Create a combined master regex combining all patterns.
+ combined = ''
+ merge = ''
+ for pattern in patterns:
+ # Convert named groups into anonymous ones to avoid name clashes.
+ p = pattern.pattern
+ p = re.sub(r'\(\?P<[^>]+>', '(?:', p)
+ combined += merge
+ combined += '(?:%s)' % p
+ merge = '|'
+ self.combined_regex = re.compile(combined)
+ self.patterns = patterns
+
+ def match_line(self, line):
+ if line[0] == '[':
+ line = _JENKINS_POOL_REGEX.sub("", line, 1)
+ if not self.combined_regex.match(line):
+ return None
+ for pattern in default_search:
+ m = pattern.regex.search(line)
+ if m:
+ return (pattern, m.groupdict())
+ return None
+
+
+class _Match(object):
+ '''Used for the results of a match.'''
+
+
+def _match_with_context(matcher, istream, lines_before, lines_after):
+ prev_lines = deque()
+ needs_lines = deque()
+ for line in istream:
+ if len(needs_lines) > 0:
+ for match in needs_lines:
+ match.after.append(line)
+ match = needs_lines[0]
+ if len(match.after) == lines_after:
+ needs_lines.popleft()
+ yield match
+
+ m = matcher.match_line(line)
+ if m is not None:
+ pattern, matches = m
+ match = _Match()
+ match.line = line
+ match.pattern = pattern
+ match.matches = matches
+ match.before = list(prev_lines)
+ match.after = []
+ needs_lines.append(match)
+
+ prev_lines.append(line)
+ if len(prev_lines) > lines_before:
+ prev_lines.popleft()
+
+ for match in needs_lines:
+ yield match
+
+
+def _match_summary(match):
+ template = match.pattern.html_template
+ sub = {}
+ sub.update(match.pattern.__dict__)
+ sub.update(match.matches)
+ if 'file_name' in sub:
+ sub['file_name'] = os.path.basename(sub['file_name'])
+ return escape(template.format(**sub))
+
+
+def _sort_by_severity(matches):
+ return sorted(matches, key=lambda m: m.pattern.severity)
+
+
+def _make_html_snippets(matches, limit):
+ def _prepare_lines(lines):
+ string = escape(''.join(lines))
+ if len(string) > 0 and string[-1] == '\n':
+ string = string[:-1]
+ return string
+
+ matches = list(matches)
+ if len(matches) == 0:
+ return
+
+ sys.stdout.write('<div style="margin-bottom: 2em;">Found %d issues:</div>\n' % (len(matches), ))
+
+ limited = False
+ if len(matches) > limit:
+ # Sort by severity so we cut the less severe ones.
+ matches = _sort_by_severity(matches)
+ matches = matches[:limit]
+ limited = True
+
+ for match in matches:
+ match.summary = _match_summary(match)
+ match.before = _prepare_lines(match.before)
+ match.after = _prepare_lines(match.after)
+ match.line = _prepare_lines(match.line)
+ sys.stdout.write('''\
+<details class="match">
+ <summary><b>{summary}</b></summary>
+ <pre style="margin-bottom: 1.5em;">
+{before}
+<span style='color: red'>{line}</span>
+{after}</pre>
+</details>'''.format(**match.__dict__))
+
+ if limited:
+ sys.stdout.write('<b>... (limited to first %d issues)</b>\n' % limit)
+
+
+if __name__ == '__main__':
+ lines_before = 5
+ lines_after = 2
+ matcher = _Matcher(default_search)
+ matches = _match_with_context(matcher, sys.stdin,
+ lines_before=lines_before,
+ lines_after=lines_after)
+ limit = 12 # Limit the amount of issues we show.
+ _make_html_snippets(matches, limit)
Propchange: zorg/trunk/zorg/jenkins/inspect_log.py
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/job_description.template
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/job_description.template?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/job_description.template (added)
+++ zorg/trunk/zorg/jenkins/job_description.template Mon Nov 6 19:18:37 2017
@@ -0,0 +1,7 @@
+<h2>Issues</h2>
+<% if (log_summary == "") { %>
+ <p>No known issues detected</p>
+<% } else { %>
+${log_summary}
+<% } %>
+<p><a href="${env.BUILD_URL}console">Build Log</a></p>
Added: zorg/trunk/zorg/jenkins/jobs/.gitignore
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/.gitignore?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/.gitignore (added)
+++ zorg/trunk/zorg/jenkins/jobs/.gitignore Mon Nov 6 19:18:37 2017
@@ -0,0 +1,2 @@
+/auth
+/build
Added: zorg/trunk/zorg/jenkins/jobs/auth.example
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/auth.example?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/auth.example (added)
+++ zorg/trunk/zorg/jenkins/jobs/auth.example Mon Nov 6 19:18:37 2017
@@ -0,0 +1,4 @@
+# You can find this information on the jenkins homepage:
+# Click on Username (top right) -> Configure -> Show API Token...
+JENKINS_USER="XXXX"
+JENKINS_TOKEN="YYYY"
Added: zorg/trunk/zorg/jenkins/jobs/config
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/config?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/config (added)
+++ zorg/trunk/zorg/jenkins/jobs/config Mon Nov 6 19:18:37 2017
@@ -0,0 +1,2 @@
+URL="http://lab.llvm.org:8080/green/"
+PIPELINE_SVN_URL="http://llvm.org/svn/llvm-project/zorg/trunk"
Added: zorg/trunk/zorg/jenkins/jobs/delete_old_jobs.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/delete_old_jobs.py?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/delete_old_jobs.py (added)
+++ zorg/trunk/zorg/jenkins/jobs/delete_old_jobs.py Mon Nov 6 19:18:37 2017
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+import glob
+import os
+import subprocess
+import sys
+import time
+import xml.etree.ElementTree as ET
+
+new_jobs = set()
+for g in glob.glob('build/jenkins/job/*'):
+ new_jobs.add(os.path.basename(g))
+
+if len(new_jobs) == 0:
+ print "No new jobs?!?"
+ sys.exit(1)
+
+query = subprocess.check_output(['util/query.sh', 'api/xml?tree=jobs[name,description]'], )
+
+existing_jobs = set()
+tree = ET.fromstring(query)
+for job in tree.findall('.//job'):
+ name = job.find('name').text
+ description_e = job.find('description')
+ if description_e is None:
+ continue
+ description = description_e.text
+ if description is None:
+ continue
+ if '$$job generated from ' in description:
+ existing_jobs.add(name.strip())
+if len(existing_jobs) == 0:
+ print "No existing jobs?!?"
+ sys.exit(1)
+
+# We should have already uploaded all the new jobs
+missing = new_jobs - existing_jobs
+if len(missing) > 0:
+ print "Missing jobs?!?"
+ sys.exit(1)
+
+to_delete = existing_jobs - new_jobs
+if len(to_delete) > 0:
+ print ""
+ print ""
+ print "Will delete the following jobs:"
+ for jobname in to_delete:
+ print " %s" % jobname
+ print "You have 5 seconds to abort"
+ time.sleep(5)
+ for jobname in to_delete:
+ subprocess.check_call(['util/delete_job.sh', jobname])
Propchange: zorg/trunk/zorg/jenkins/jobs/delete_old_jobs.py
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/jobs/description.txt
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/description.txt?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/description.txt (added)
+++ zorg/trunk/zorg/jenkins/jobs/description.txt Mon Nov 6 19:18:37 2017
@@ -0,0 +1,3 @@
+<p>Job automatically generated by zorg/zorg/jenkins/update_jobs.sh</p>
+
+<small style="color: grey">$$job generated from {pipeline_git_path}</small>
Added: zorg/trunk/zorg/jenkins/jobs/jobs/fail_test
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/fail_test?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/fail_test (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/fail_test Mon Nov 6 19:18:37 2017
@@ -0,0 +1,18 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.pipeline('green-dragon-03') {
+ stage('main') {
+ sh """
+ echo "XPASS: Pick this line"
+ echo " warning: Danger"
+ echo "IOError: BlaBLa"
+ echo " error: error"
+ echo "..."
+ echo "clang (LLVM option parsing): Unknown command line argument '--foobar'. Try: 'clang (LLVM option parsing) -help'"
+ echo "..."
+ if [ -n "${params.ARTIFACT}" ]; then
+ exit 1
+ fi
+ """
+ }
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O0-g (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O0-g Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-04') {
+ sh """
+LNT_FLAGS+=" -C config/zorg/tasks/cmake/caches/target-arm64-iphoneos.cmake"
+LNT_FLAGS+=" -C config/zorg/tasks/cmake/caches/opt-O0-g.cmake"
+config/tasks/task jenkinsrun config/tasks/lnt-ctmark.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O3-flto (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-O3-flto Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-04') {
+ sh """
+LNT_FLAGS+=" -C config/zorg/tasks/cmake/caches/target-arm64-iphoneos.cmake"
+LNT_FLAGS+=" -C config/zorg/tasks/cmake/caches/opt-O3-flto.cmake"
+config/tasks/task jenkinsrun config/tasks/lnt-ctmark.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Os (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Os Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-06') {
+ sh """
+LNT_FLAGS+=" -C config/zorg/tasks/cmake/caches/target-arm64-iphoneos.cmake"
+LNT_FLAGS+=" -C config/zorg/tasks/cmake/caches/opt-Os.cmake"
+config/tasks/task jenkinsrun config/tasks/lnt-ctmark.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Oz (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-ctmark-aarch64-Oz Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-06') {
+ sh """
+LNT_FLAGS+=" -C config/zorg/tasks/cmake/caches/target-arm64-iphoneos.cmake"
+LNT_FLAGS+=" -C config/zorg/tasks/cmake/caches/opt-Oz.cmake"
+config/tasks/task jenkinsrun config/tasks/lnt-ctmark.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-O3-flto (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-O3-flto Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-06') {
+ sh """
+LNT_FLAGS+=" -C \${WORKSPACE}/zorg/tasks/cmake/caches/target-x86_64-macosx.cmake"
+LNT_FLAGS+=" -C \${WORKSPACE}/zorg/tasks/cmake/caches/opt-O3-flto.cmake"
+config/tasks/task jenkinsrun config/tasks/lnt-test-suite.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-Os-flto (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/lnt-test-suite-x86_64-Os-flto Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-07') {
+ sh """
+LNT_FLAGS+=" -C \${WORKSPACE}/zorg/tasks/cmake/caches/target-x86_64-macosx.cmake"
+LNT_FLAGS+=" -C \${WORKSPACE}/zorg/tasks/cmake/caches/opt-Os-flto.cmake"
+config/tasks/task jenkinsrun config/tasks/lnt-test-suite.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-ctmark
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-ctmark?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-ctmark (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-ctmark Mon Nov 6 19:18:37 2017
@@ -0,0 +1,3 @@
+#!/usr/bin/env groovy
+def relay = evaluate readTrusted('zorg/jenkins/relay.groovy')
+relay.pipeline "lnt-ctmark-(.+)"
Added: zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-test-suite
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-test-suite?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-test-suite (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/relay-lnt-test-suite Mon Nov 6 19:18:37 2017
@@ -0,0 +1,3 @@
+#!/usr/bin/env groovy
+def relay = evaluate readTrusted('zorg/jenkins/relay.groovy')
+relay.pipeline "lnt-test-suite-(.+)"
Added: zorg/trunk/zorg/jenkins/jobs/jobs/relay-test-suite-verify-machineinstrs
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/jobs/relay-test-suite-verify-machineinstrs?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/relay-test-suite-verify-machineinstrs (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/relay-test-suite-verify-machineinstrs Mon Nov 6 19:18:37 2017
@@ -0,0 +1,3 @@
+#!/usr/bin/env groovy
+def relay = evaluate readTrusted('zorg/jenkins/relay.groovy')
+relay.pipeline "test-suite-verify-machineinstrs-(.+)"
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O0-g (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O0-g Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+ sh """
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/target-arm64-iphoneos.cmake"
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/opt-O0-g.cmake"
+config/tasks/task jenkinsrun config/tasks/test-suite-verify-machineinstrs.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O3 (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-O3 Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+ sh """
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/target-arm64-iphoneos.cmake"
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/opt-O3-g.cmake"
+config/tasks/task jenkinsrun config/tasks/test-suite-verify-machineinstrs.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-globalisel-O0-g (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-aarch64-globalisel-O0-g Mon Nov 6 19:18:37 2017
@@ -0,0 +1,10 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-21') {
+ sh """
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/target-arm64-iphoneos.cmake"
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/opt-O0-g.cmake"
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/global-isel.cmake.cmake"
+config/tasks/task jenkinsrun config/tasks/test-suite-verify-machineinstrs.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O0-g (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O0-g Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+ sh """
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/target-x86_64-macos.cmake"
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/opt-O0-g.cmake"
+config/tasks/task jenkinsrun config/tasks/test-suite-verify-machineinstrs.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O3 (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64-O3 Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+ sh """
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/target-x86_64-macos.cmake"
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/opt-O3.cmake"
+config/tasks/task jenkinsrun config/tasks/test-suite-verify-machineinstrs.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: 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=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64h-O3 (added)
+++ zorg/trunk/zorg/jenkins/jobs/jobs/test-suite-verify-machineinstrs-x86_64h-O3 Mon Nov 6 19:18:37 2017
@@ -0,0 +1,9 @@
+#!/usr/bin/env groovy
+def benchmark = evaluate readTrusted('zorg/jenkins/benchmark.groovy')
+benchmark.testsuite_pipeline(label: 'green-dragon-12') {
+ sh """
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/target-x86_64h-macos.cmake"
+LNT_FLAGS+=" -C zorg/tasks/cmake/caches/opt-O3.cmake"
+config/tasks/task jenkinsrun config/tasks/test-suite-verify-machineinstrs.sh -a compiler="${params.ARTIFACT}" -D LNT_FLAG="\${LNT_FLAGS}"
+ """
+}
Added: zorg/trunk/zorg/jenkins/jobs/update_jobs.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/update_jobs.sh?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/update_jobs.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/update_jobs.sh Mon Nov 6 19:18:37 2017
@@ -0,0 +1,39 @@
+#!/bin/sh
+set -eu
+
+. config
+
+rm -rf build
+
+# Create pipeline job files
+mkdir -p build/jenkins/job
+for i in jobs/*; do
+ DESTFILE="build/jenkins/job/$(basename "$i")"
+ PIPELINE_GIT_PATH="$(git ls-tree --full-name --name-only HEAD "${i}")"
+ if [ -z "${PIPELINE_GIT_PATH}" ]; then
+ echo 1>&2 "Could not determine git path of ${PIPELINE_FILE}. Is it checked in?"
+ exit 1
+ fi
+
+ echo "GEN ${DESTFILE}"
+ util/make_pipeline.py "${PIPELINE_SVN_URL}" "${PIPELINE_GIT_PATH}" description.txt > "$DESTFILE"
+done
+
+if test "${1-}" = "-d"; then
+ echo "New jobs created in build"
+ echo "Double check and rerun script without -d to apply to server."
+else
+ cd build/jenkins
+ for file in $(find . -type f); do
+ # Try to update, if it fails to create it
+ echo "UPDATE ${file}"
+ if ! ../../util/update.sh $file; then
+ # Try to create it
+ echo "CREATE ${file}"
+ ../../util/create.sh $file || echo "... failed to create job"
+ fi
+ done
+ cd -
+
+ ./delete_old_Jobs.py
+fi
Propchange: zorg/trunk/zorg/jenkins/jobs/update_jobs.sh
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/jobs/util/create.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/util/create.sh?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/util/create.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/util/create.sh Mon Nov 6 19:18:37 2017
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -eu
+
+MYDIR="$(dirname $0)"
+. "${MYDIR}/../config"
+. "${MYDIR}/../auth"
+
+NAME="$1"
+if ! test -r "$NAME"; then
+ echo 1>&2 "Input file $NAME does not exist"
+ exit 1
+fi
+
+# This is a bit ugly as it only works reliably on the toplevel jenkins URL.
+# (i.e. we cannot say job/createItem?name=Bla or view/createItem?name=Blup,
+# so instead just take the filename as name and create it at the toplevel)
+BASENAME="$(basename ${NAME})"
+curl -f -s -u "${JENKINS_USER}:${JENKINS_TOKEN}" -XPOST "${URL}/createItem?name=${BASENAME}" --data-binary "@${NAME}" -H "Content-Type:text/xml"
Propchange: zorg/trunk/zorg/jenkins/jobs/util/create.sh
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/jobs/util/delete_job.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/util/delete_job.sh?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/util/delete_job.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/util/delete_job.sh Mon Nov 6 19:18:37 2017
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -eux
+
+MYDIR="$(dirname $0)"
+. "${MYDIR}/../config"
+. "${MYDIR}/../auth"
+
+NAME="$1"
+
+curl -f -s -u "${JENKINS_USER}:${JENKINS_TOKEN}" -XPOST "${URL}/job/${NAME}/doDelete" --data-binary "" -H "Content-Type:text/xml"
Propchange: zorg/trunk/zorg/jenkins/jobs/util/delete_job.sh
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/jobs/util/delete_old_jobs.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/util/delete_old_jobs.py?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/util/delete_old_jobs.py (added)
+++ zorg/trunk/zorg/jenkins/jobs/util/delete_old_jobs.py Mon Nov 6 19:18:37 2017
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+import glob
+import os
+import subprocess
+import sys
+import time
+import xml.etree.ElementTree as ET
+
+new_jobs = set()
+for g in glob.glob('build/jenkins/job/*'):
+ new_jobs.add(os.path.basename(g))
+
+if len(new_jobs) == 0:
+ print "No new jobs?!?"
+ sys.exit(1)
+
+query = subprocess.check_output(['util/query.sh', 'api/xml?tree=jobs[name,description]'], )
+
+existing_jobs = set()
+tree = ET.fromstring(query)
+for job in tree.findall('.//job'):
+ name = job.find('name').text
+ description_e = job.find('description')
+ if description_e is None:
+ continue
+ description = description_e.text
+ if description is None:
+ continue
+ if '$$GENERATED BY llvm-ci-tasks$$' in description:
+ existing_jobs.add(name.strip())
+if len(existing_jobs) == 0:
+ print "No existing jobs?!?"
+ sys.exit(1)
+
+# We should have already uploaded all the new jobs
+missing = new_jobs - existing_jobs
+if len(missing) > 0:
+ print "Missing jobs?!?"
+ sys.exit(1)
+
+to_delete = existing_jobs - new_jobs
+if len(to_delete) > 0:
+ print ""
+ print ""
+ print "Will delete the following jobs:"
+ for jobname in to_delete:
+ print " %s" % jobname
+ print "You have 5 seconds to abort"
+ time.sleep(5)
+ for jobname in to_delete:
+ subprocess.check_call(['util/delete_job.sh', jobname])
Propchange: zorg/trunk/zorg/jenkins/jobs/util/delete_old_jobs.py
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/jobs/util/get.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/util/get.sh?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/util/get.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/util/get.sh Mon Nov 6 19:18:37 2017
@@ -0,0 +1,11 @@
+#!/bin/bash
+set -eu
+
+MYDIR="$(dirname $0)"
+. "${MYDIR}/../config"
+. "${MYDIR}/../auth"
+
+NAME="$1"
+
+mkdir -p "$(dirname ${NAME})"
+curl -s -XGET -u "${JENKINS_USER}:${JENKINS_TOKEN}" "${URL}/${NAME}/config.xml" -o "${NAME}" -f || echo "Error: Could not get ${NAME}"
Propchange: zorg/trunk/zorg/jenkins/jobs/util/get.sh
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/jobs/util/make_pipeline.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/util/make_pipeline.py?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/util/make_pipeline.py (added)
+++ zorg/trunk/zorg/jenkins/jobs/util/make_pipeline.py Mon Nov 6 19:18:37 2017
@@ -0,0 +1,75 @@
+#!/usr/bin/env python
+import sys
+import re
+from xml.sax.saxutils import escape
+
+pipeline_svn_url = sys.argv[1]
+pipeline_git_path = sys.argv[2]
+description = open(sys.argv[3]).read()
+
+template = '''\
+<?xml version='1.0' encoding='UTF-8'?>
+<flow-definition plugin="workflow-job at 2.15">
+ <description>{description}</description>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty plugin="build-failure-analyzer at 1.19.0">
+ <doNotScan>false</doNotScan>
+ </com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty>
+ <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild at 1.27">
+ <autoRebuild>false</autoRebuild>
+ <rebuildDisabled>false</rebuildDisabled>
+ </com.sonyericsson.rebuild.RebuildSettings>
+ {extra_properties}
+ </properties>
+ <definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps at 2.41">
+ <scm class="hudson.scm.SubversionSCM" plugin="subversion at 2.9">
+ <locations>
+ <hudson.scm.SubversionSCM_-ModuleLocation>
+ <remote>{pipeline_svn_url}</remote>
+ <credentialsId></credentialsId>
+ <local>.</local>
+ <depthOption>infinity</depthOption>
+ <ignoreExternalsOption>true</ignoreExternalsOption>
+ </hudson.scm.SubversionSCM_-ModuleLocation>
+ </locations>
+ <excludedRegions></excludedRegions>
+ <includedRegions></includedRegions>
+ <excludedUsers></excludedUsers>
+ <excludedRevprop></excludedRevprop>
+ <excludedCommitMessages></excludedCommitMessages>
+ <workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/>
+ <ignoreDirPropChanges>false</ignoreDirPropChanges>
+ <filterChangelog>false</filterChangelog>
+ </scm>
+ <scriptPath>{pipeline_git_path}</scriptPath>
+ <lightweight>true</lightweight>
+ </definition>
+ <triggers/>
+ <disabled>false</disabled>
+</flow-definition>
+'''
+
+# Bad hack to set throttle parameter if 'relay' is in the jobname
+extra_properties = ''
+if 'relay' in pipeline_git_path:
+ extra_properties += '''
+ <hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents at 2.0.1">
+ <maxConcurrentPerNode>1</maxConcurrentPerNode>
+ <maxConcurrentTotal>1</maxConcurrentTotal>
+ <categories class="java.util.concurrent.CopyOnWriteArrayList"/>
+ <throttleEnabled>true</throttleEnabled>
+ <throttleOption>project</throttleOption>
+ <limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams>
+ <paramsToUseForLimit></paramsToUseForLimit>
+ </hudson.plugins.throttleconcurrents.ThrottleJobProperty>
+'''
+
+variables = {
+ "pipeline_svn_url": escape(pipeline_svn_url),
+ "pipeline_git_path": escape(pipeline_git_path),
+ "extra_properties": extra_properties,
+}
+variables['description'] = escape(description.format(**variables))
+
+sys.stdout.write(template.format(**variables))
Propchange: zorg/trunk/zorg/jenkins/jobs/util/make_pipeline.py
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/jobs/util/query.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/util/query.sh?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/util/query.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/util/query.sh Mon Nov 6 19:18:37 2017
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -eu
+
+MYDIR="$(dirname $0)"
+. "${MYDIR}/../config"
+. "${MYDIR}/../auth"
+
+QUERY="$1"
+
+curl -g -XGET -u "${JENKINS_USER}:${JENKINS_TOKEN}" "${URL}/${QUERY}" -f
Propchange: zorg/trunk/zorg/jenkins/jobs/util/query.sh
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/jobs/util/update.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/jobs/util/update.sh?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/jobs/util/update.sh (added)
+++ zorg/trunk/zorg/jenkins/jobs/util/update.sh Mon Nov 6 19:18:37 2017
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -eu
+
+MYDIR="$(dirname $0)"
+. "${MYDIR}/../config"
+. "${MYDIR}/../auth"
+
+NAME="$1"
+if ! test -r "$NAME"; then
+ echo 1>&2 "Input file $NAME does not exist"
+ exit 1
+fi
+
+curl -f -u "${JENKINS_USER}:${JENKINS_TOKEN}" -XPOST "${URL}/${NAME}/config.xml" --data-binary "@${NAME}" -H "Content-Type:text/xml"
Propchange: zorg/trunk/zorg/jenkins/jobs/util/update.sh
------------------------------------------------------------------------------
svn:executable = *
Added: zorg/trunk/zorg/jenkins/patterns.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/patterns.py?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/patterns.py (added)
+++ zorg/trunk/zorg/jenkins/patterns.py Mon Nov 6 19:18:37 2017
@@ -0,0 +1,390 @@
+import re
+
+class Severity(object):
+ """Set seriousness of an error."""
+ FATAL = 0
+ UNEXPECTED_ERROR = 1
+ EXPECTED_ERROR = 2
+ WARNING = 3
+ INFO = 4
+
+
+class SearchPattern(object):
+ # noinspection PyPep8Naming
+ """Define the issue's search pattern that was created through a regex match."""
+
+ def __init__(self, name, nlp, pattern, html_template, severity,
+ keep_going=True):
+ # type: (str, str, str, unicode, bool, int) -> None
+ """
+ Pattern to search for.
+
+ :param name: short name to identify this pattern.
+ :param pattern: a regex to match.
+ """
+ self.name = name # type: str
+ """The display name of the pattern."""
+
+ self.html_template = html_template # type: unicode
+ """The HTML template to use to render the pattern."""
+
+ self.pattern_text = pattern # type: str
+ """The regex for this pattern."""
+
+ self.nlp = nlp
+ """The NLP class to use to render this kind of error."""
+
+ self.pattern = pattern
+ """Regular expression for this pattern."""
+
+ self.regex = re.compile(pattern)
+ """The compiled regex for this pattern."""
+
+ self.keep_going = keep_going
+ """True if we should keep going after hitting one of these issues."""
+
+ self.severity = severity
+ """Integer severity level of this kind of pattern."""
+
+ def __repr__(self):
+ """Simplify and standardize printing of a search pattern."""
+ return self.__class__.__name__ + "(" + self.name + ")"
+
+
+default_search = [
+
+ SearchPattern("Wrong LLVM Option",
+ 'GenericNLP',
+ r"clang \(LLVM option parsing\): Unknown command line argument (?P<error>'.*')\. "
+ r"Try: 'clang \(LLVM option parsing\) -help",
+ u"{name}: {error} ",
+ Severity.UNEXPECTED_ERROR),
+ # Untested
+ SearchPattern("CMake Error",
+ 'GenericNLP',
+ r"CMake Error: (?P<error>.*)",
+ u"{name}: {error} ",
+ Severity.UNEXPECTED_ERROR),
+ # Untested
+ SearchPattern("Jenkins Shell Script Error",
+ 'GenericNLP',
+ r"Build step (?P<reason>'(?!Trigger).*').*failure",
+ u"{name}: {reason} ",
+ Severity.INFO),
+ # Untested
+ SearchPattern("rsync error",
+ 'GenericNLP',
+ r"rsync error(?P<error>.*) at (?P<location>.*)\s*",
+ u"{name}: {error} {location} ",
+ Severity.UNEXPECTED_ERROR),
+ # Tested
+ SearchPattern("Clang",
+ 'Clang',
+ r"(?P<file_name>(\w|/|-|@|\.)*):(?P<line_number>\d+)(:\d+)?.*\s+"
+ r"(?P<kind>error):\s+(?P<error_msg>.*)",
+ u"{file_name} {kind}: {error_msg} ",
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Clang file warning",
+ 'Clang',
+ r"(?P<file_name>(\w|/|-|@|\.)*):(?P<line_number>\d+)(:\d+)?.*\s+"
+ r"(?P<kind>warning):\s+(?P<error_msg>.*)",
+ u"{file_name} {kind}: {error_msg} ",
+ Severity.WARNING),
+ # Untested
+ SearchPattern("Too many errors emitted",
+ 'GenericNLP',
+ r"fatal error: too many errors emitted.*",
+ u"{name}: not good",
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("SSH Connection Closed",
+ 'GenericNLP',
+ r'ssh_exchange_identification:(?P<error_message>.*)',
+ u"{name}:{error_message}",
+ Severity.FATAL,
+ ),
+
+ SearchPattern("Clang Warning",
+ 'Clang_Warning',
+ r"clang-(\d+\.)+\d+: warning: *(?P<type>.*): (?P<which_arg>'-.*').*",
+ u"{name}: {type} {which_arg}",
+ Severity.WARNING),
+
+ SearchPattern("link error",
+ 'GenericNLP',
+ r'.*linker command failed with exit code.*',
+ u"{name}",
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("node offline",
+ 'GenericNLP',
+ r'ERROR: (?P<node>.*) is offline; cannot locate JDK',
+ u"{name}: {node}",
+ Severity.FATAL,
+ keep_going = False),
+
+ SearchPattern("assertion",
+ 'GenericNLP',
+ r'Assertion failed: \((?P<assert_text>.*)\), function (?P<function>.*), file '
+ r'(?P<file_name>[\S]*), line (?P<line_number>\d+).',
+ u"{name}: {assert_text}",
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("gtest error",
+ 'GenericNLP',
+ r'.*/googletest\.py:\d+: error: (?P<error_msg>.*) in \'(?P<file_name>.*)\':',
+ u"{name}: {error_msg} in {file_name}",
+ Severity.EXPECTED_ERROR),
+
+ SearchPattern("lit",
+ 'Lit',
+ r'\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* TEST \'(?P<test_name>.*)\' FAILED '
+ r'\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*',
+ u"{name}: {test_name}",
+ Severity.EXPECTED_ERROR),
+ SearchPattern("lint",
+ 'GenericNLP', # 'lint: %(path)s:%(row)d:%(col)d: %(code)s %(text)s'
+ r'lint:\s(?P<file_name>.*):\d+:\d+:\s(?P<error_msg>.*)',
+ u"{name}: {error_msg}",
+ Severity.EXPECTED_ERROR),
+ SearchPattern("lnt",
+ 'GenericNLP',
+ r'FAIL:\s(?P<test_name>.*)\.(?P<test_kind>.*)\s\(',
+ u"{name}: {test_name}",
+ Severity.EXPECTED_ERROR),
+ SearchPattern("Test Case",
+ 'GenericNLP',
+ r'(?P<fail_type>FAIL|ERROR): (?P<test_name>.*)\s\((?P<file_name>.*)\)',
+ u"{name}: {fail_type} - {file_name} {test_name}",
+ Severity.EXPECTED_ERROR),
+ SearchPattern("Cmake Error",
+ 'GenericNLP',
+ r'CMake Error at (?P<file_name>.*) \(message\):',
+ u"{name}: {file_name}",
+ Severity.UNEXPECTED_ERROR),
+ SearchPattern("Segfault",
+ 'GenericNLP',
+ r'clang: error: unable to execute command: Segmentation fault: 11',
+ u"{name}",
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Ninja target",
+ 'GenericNLP',
+ r'FAILED: (?P<file_name>.*)\s*',
+ u"{name}: {file_name}",
+ Severity.INFO),
+
+ SearchPattern("Swift Execute Command Failed",
+ 'GenericNLP',
+ r'FAIL.*command=\"(?P<command>[\w* ]*)-.*, (?P<return_code>returncode=.*)',
+ u'{name}: {command} with {return_code}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Timeout",
+ 'GenericNLP',
+ r'Build timed out \(after \d+ minutes\)\. Marking the build as failed\.',
+ u"{name}",
+ Severity.UNEXPECTED_ERROR,
+ keep_going=False),
+
+ SearchPattern("Aborted",
+ 'GenericNLP',
+ r'Aborted by (\w+)',
+ u"{name}",
+ Severity.FATAL,
+ keep_going=False),
+
+ SearchPattern("Jenkins Aborted",
+ 'GenericNLP',
+ r'Build was aborted',
+ u"{name}",
+ Severity.FATAL,
+ keep_going=False),
+
+ SearchPattern("Triggered build failed",
+ 'GenericNLP',
+ r'(?i)Build step \'Trigger/call builds on other projects\' (marked|changed) build '
+ r'(as|result to) failure$',
+ u"{name}",
+ Severity.EXPECTED_ERROR),
+
+ SearchPattern("Triggered build unstable",
+ 'GenericNLP',
+ r'Build step \'Trigger/call builds on other projects\' changed build result to UNSTABLE$',
+ u"{name}",
+ Severity.EXPECTED_ERROR),
+
+ SearchPattern("Ninja error",
+ 'GenericNLP',
+ r'ninja: error: (?P<error_msg>.*)',
+ u"{name}: {error_msg}",
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Password expired",
+ 'GenericNLP',
+ r'Password has expired$',
+ u"{name}",
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("SVN error",
+ 'GenericNLP',
+ r'org\.tmatesoft\.svn\.core\.SVNException: svn: (?P<error_code>.*): (?P<error_msg>.*)',
+ u'{name}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Java exception",
+ 'GenericNLP',
+ r'(?P<exception>(hudson|java)\.\S*Exception):\s(?P<error_msg>.*)',
+ u'{exception}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Non-specific Java exception",
+ 'GenericNLP',
+ r'(?P<exception>(hudson|java)\.\S*Exception)',
+ u'{exception}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("HTTP Error",
+ 'Error',
+ r'HTTP Error:\s(?P<code>\d+)\s(?P<url>.*)',
+ u'{name}: {code}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Fatal Error",
+ 'Error',
+ r'(?i)fatal( error)?:\s(?P<error_msg>.*)',
+ u'{name}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Warning",
+ 'Error',
+ r'(?i)(warning):\s(?!profile data may be out of date)(?P<warning_msg>.*)',
+ u'{name}: {warning_msg}',
+ Severity.WARNING),
+
+ SearchPattern("Python exception",
+ 'GenericNLP',
+ r'(?P<exception>(socket\.error|'
+ r'SystemExit|'
+ r'KeyboardInterrupt|'
+ r'GeneratorExit|'
+ r'Exception|'
+ r'StopIteration|'
+ r'StandardError|'
+ r'BufferError|'
+ r'ArithmeticError|'
+ r'FloatingPointError|'
+ r'OverflowError|'
+ r'ZeroDivisionError|'
+ r'AssertionError|'
+ r'AttributeError|'
+ r'EnvironmentError|'
+ r'IOError|'
+ r'OSError|'
+ r'EOFError|'
+ r'ImportError|'
+ r'LookupError|'
+ r'IndexError|'
+ r'KeyError|'
+ r'MemoryError|'
+ r'NameError|'
+ r'UnboundLocalError|'
+ r'ReferenceError|'
+ r'RuntimeError'
+ r'|NotImplementedError|'
+ r'SyntaxError|'
+ r'IndentationError|'
+ r'TabError|'
+ r'SystemError|'
+ r'TypeError|'
+ r'ValueError|'
+ r'UnicodeError|'
+ r'UnicodeDecodeError|'
+ r'UnicodeEncodeError|'
+ r'UnicodeTranslateError|'
+ r'DeprecationWarning|'
+ r'PendingDeprecationWarning|'
+ r'RuntimeWarning|'
+ r'SyntaxWarning|'
+ r'UserWarning|'
+ r'FutureWarning|'
+ r'requests\.exceptions\.HTTPError|'
+ r'ImportWarning|'
+ r'UnicodeWarning|'
+ r'BytesWarning|'
+ r'subprocess\.CalledProcessError|'
+ r'common_adopter\.ExecuteCommandFailure|'
+ r'urllib2\.HTTPError)):\s(?P<error_msg>.*)',
+ u'{exception}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Merge Conflict",
+ 'GenericNLP',
+ r'CONFLICT \([\w\/]+\): Merge conflict in (?P<file_name>.*)',
+ u'{name}: {file_name}',
+ Severity.EXPECTED_ERROR),
+ SearchPattern("Xcode Select Error",
+ 'GenericNLP',
+ r'xcode-select: error:\s(?P<error_msg>.*)',
+ u'{name}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+ SearchPattern("ASANError", # Fixes rdar://problem/31719510
+ 'GenericNLP',
+ r'.*SUMMARY:\s(?!\s*\d)AddressSanitizer(?P<error_msg>.*)',
+ u'{name}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+ SearchPattern("Proxy Error Message", # Fixes rdar://problem/31719510
+ 'GenericNLP',
+ r'Reason: <strong>(?P<error_msg>.*)</strong.*>',
+ u'{name}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+ SearchPattern("Env No Such File or Directory", # Fixes rdar://problem/32157409
+ 'GenericNLP',
+ r'env:\s*(?P<file_name>(?:/\w+)*):\s*No such file or directory',
+ u'{name}: {file_name}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Error Low Disk Space", # Fixes rdar://problem/32081011
+ 'GenericNLP',
+ r"Error: (?P<error_msg>low disk space).*scale\(collectd\.(?P<node>.*apple_com).*,\s(?P<free>\d*)",
+ u'{name}: {error_msg} on {node}, {free}GB left.',
+ Severity.EXPECTED_ERROR),
+
+ SearchPattern("Error Device Name", # Fixes rdar://problem/32081011
+ 'GenericNLP',
+ r".*ERROR: (?P<error_msg>.*Cannot find device named '\w.*)",
+ u'{name}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+ # Other errors have stops. If we hit this one, we know we did not match above.
+ SearchPattern("Error",
+ 'Error',
+ r'.*(?i)ERROR:\s+'
+ r'('
+ r'(?!0)' # Do not match "Error: 0", rdar://problem/31564106
+ r'(?!AddressSanitizer)' # Covered by ASANError, rdar://problem/31719510
+ r'(?!Cannot find device named)' # Covered by Error Device Name, rdar://problem/32081011
+ r'(?!: True$)' # Nothing should match on: "Match found for :error: : True"
+ r')'
+ r'(?P<error_msg>.*)',
+ u'{name}: {error_msg}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("GPU Automerger Conflict",
+ 'GenericNLP',
+ r'Failures in Automerger from (?P<from_branch>\S+) to (?P<to_branch>\S+)',
+ u'{name}: {from_branch} to {to_branch}',
+ Severity.EXPECTED_ERROR),
+
+ SearchPattern("Kinit Error",
+ 'GenericNLP',
+ r'kinit:\s(?P<msg>.*)',
+ u'{name}: {msg}',
+ Severity.UNEXPECTED_ERROR),
+
+ SearchPattern("Install-Xcode",
+ 'GenericNLP',
+ r'\((?P<kind>(WARNING|CRITICAL))\)\s(?P<msg>.*)',
+ u'{name} {kind}: {msg}',
+ Severity.UNEXPECTED_ERROR),
+]
Added: zorg/trunk/zorg/jenkins/relay.groovy
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/relay.groovy?rev=317540&view=auto
==============================================================================
--- zorg/trunk/zorg/jenkins/relay.groovy (added)
+++ zorg/trunk/zorg/jenkins/relay.groovy Mon Nov 6 19:18:37 2017
@@ -0,0 +1,57 @@
+#!/usr/bin/env groovy
+ at NonCPS
+private def get_matching_jobs(pattern) {
+ def jobs = []
+ for (job in Jenkins.getInstance().getAllItems(Job)) {
+ def jobname = job.getName()
+ def m = jobname =~ pattern
+ if (m) {
+ def shortname = m[0][1]
+ jobs.push([shortname, jobname])
+ }
+ }
+ return jobs
+}
+
+private def basename(path) {
+ return path.drop(path.lastIndexOf('/') + 1)
+}
+
+private def relay_steps(job_pattern, artifact_url, last_good_properties_url) {
+ propfile = basename(last_good_properties_url)
+ sh """
+rm -f ${propfile}
+curl -fksSO "${last_good_properties_url}"
+"""
+ def props = readProperties file: propfile
+ def artifact = "http://labmaster2.local/artifacts/${props.ARTIFACT}"
+ currentBuild.displayName = "r${props.LLVM_REV}"
+
+ def joblist = get_matching_jobs(job_pattern)
+ def parallel_builds = [:]
+ for (j in joblist) {
+ def shortname = j[0]
+ def jobname = j[1]
+ parallel_builds[shortname] = {
+ def job_params = [
+ [$class: 'StringParameterValue',
+ name:'ARTIFACT',
+ value:artifact],
+ ]
+ build job: jobname, parameters: job_params
+ }
+ }
+ parallel parallel_builds
+}
+
+def pipeline(job_pattern,
+ artifact_url='http://labmaster2.local/artifacts/',
+ last_good_properties_url='http://labmaster2.local/artifacts/clang-stage1-configure-RA_build/last_good_build.properties') {
+ node('master') {
+ stage('main') {
+ relay_steps(job_pattern, artifact_url,
+ last_good_properties_url)
+ }
+ }
+}
+return this
More information about the llvm-commits
mailing list