Commit 759e3b6f authored by ddkilzer's avatar ddkilzer

WebKitTools:

        Reviewed by Darin.

        Bug 9615: Buildbot configuration should be in SVN repository
        http://bugzilla.opendarwin.org/show_bug.cgi?id=9615

        Import BuildBot configuration files as used by build.webkit.org.
        auth.py has been stubbed out so that slave passwords are not disclosed.

        * BuildSlaveSupport/build.webkit.org-config/Makefile: Added.
        * BuildSlaveSupport/build.webkit.org-config/buildbot.css: Added.
        * BuildSlaveSupport/build.webkit.org-config/buildbot.tac: Added.
        * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added.
        * BuildSlaveSupport/build.webkit.org-config/webkit/__init__.py: Added.
        * BuildSlaveSupport/build.webkit.org-config/webkit/auth.py: Added.
        * BuildSlaveSupport/build.webkit.org-config/webkit/basesteps.py: Added.
        * BuildSlaveSupport/build.webkit.org-config/webkit/builders.py: Added.
        * BuildSlaveSupport/build.webkit.org-config/webkit/factories.py: Added.
        * BuildSlaveSupport/build.webkit.org-config/webkit/schedulers.py: Added.
        * BuildSlaveSupport/build.webkit.org-config/webkit/status.py: Added.
        * BuildSlaveSupport/build.webkit.org-config/webkit/steps.py: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3f45cfc2
# -*- makefile -*-
# This is a simple makefile which lives in a buildmaster/buildslave
# directory (next to the buildbot.tac file). It allows you to start/stop the
# master or slave by doing 'make start' or 'make stop'.
# The 'reconfig' target will tell a buildmaster to reload its config file.
start:
twistd --no_save -y buildbot.tac
stop:
kill `cat twistd.pid`
reconfig:
kill -HUP `cat twistd.pid`
log:
tail -f twistd.log
* {
font-family: Verdana, Cursor;
font-size: 10px;
font-weight: bold;
}
a:link,a:visited,a:active {
color: #444;
}
a:hover {
color: #FFFFFF;
}
table {
border-spacing: 1px 1px;
}
table td {
padding: 3px 0px 3px 0px;
text-align: center;
}
.Project {
width: 100px;
}
.LastBuild, .Activity {
width: 230px;
padding: 0 0 0 4px;
}
td.Time {
color: #000;
border-bottom: 1px solid #aaa;
background-color: #eee;
}
td.Activity, td.Change, td.Builder {
color: #333333;
background-color: #CCCCCC;
}
td.Change {
border-radius: 5px;
-webkit-border-radius: 5px;
}
td.Event {
color: #777;
background-color: #ddd;
border-radius: 5px;
-webkit-border-radius: 5px;
}
td.Activity {
border-top-left-radius: 10px;
-webkit-border-top-left-radius: 10px;
min-height: 20px;
padding: 8px 0 8px 0;
}
td.idle, td.waiting, td.offline, td.building {
border-top-left-radius: 0px;
-webkit-border-top-left-radius: 0px;
}
.LastBuild {
border-top-left-radius: 5px;
-webkit-border-top-left-radius: 5px;
border-top-right-radius: 5px;
-webkit-border-top-right-radius: 5px;
}
/* LastBuild, BuildStep states */
.success {
color: #FFFFFF;
background-color: #8fdf5f;
}
.failure {
color: #FFFFFF;
background-color: #e98080;
}
.warnings {
color: #FFFFFF;
background-color: #ffc343;
}
.exception, td.offline {
color: #FFFFFF;
background-color: #e0b0ff;
}
.start,.running, td.building {
color: #666666;
background-color: #fffc6c;
}
.start {
border-bottom-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
}
td.Project a:hover, td.start a:hover {
color: #000;
}
\ No newline at end of file
from twisted.application import service
from buildbot.master import BuildMaster
basedir = r'/home/mrowe/sites/build.webkit.org/buildbot'
configfile = r'master.cfg'
application = service.Application('buildmaster')
BuildMaster(basedir, configfile).setServiceParent(application)
# -*- python -*-
from buildbot.changes.pb import PBChangeSource
import webkit
reload(webkit)
c = BuildmasterConfig = {}
c['bots'] = webkit.auth.getSlaveAuthenticationDetails()
c['sources'] = [PBChangeSource(prefix="trunk")]
c['builders'] = webkit.builders.getBuilders()
c['schedulers'] = webkit.schedulers.getSchedulers(c['builders'])
c['status'] = webkit.status.getStatusListeners()
c['slavePortnum'] = 9989
c['projectName'] = "WebKit"
c['projectURL'] = "http://www.webkit.org/"
c['buildbotURL'] = "http://build.webkit.org/"
from webkit import auth, status, builders, schedulers
reload(auth)
reload(status)
reload(builders)
reload(schedulers)
def getSlaveAuthenticationDetails():
return [("slave-name", "password")]
from buildbot.process import step
import os
def buildStepWithDefaultTimeout(klass, default_timeout=45*60):
class Step(klass):
timeout = default_timeout
def __init__(self, *args, **kwargs):
kwargs['timeout'] = self.timeout
klass.__init__(self, *args, **kwargs)
return Step
Test = buildStepWithDefaultTimeout(step.Test)
Compile = buildStepWithDefaultTimeout(step.Compile)
ShellCommand = buildStepWithDefaultTimeout(step.ShellCommand)
SVN = buildStepWithDefaultTimeout(step.SVN)
class UploadCommand:
def __init__(self, *args, **kwargs):
self.__build = kwargs['build'].getStatus()
try:
try:
umask = os.umask(0)
os.makedirs(self.getDestinationPath(), 042770)
except OSError, e:
if e.errno != 17:
raise
finally:
os.umask(umask)
def getDestinationPath(self):
return "/home/buildresults/results/%s/%s/" % (self.getBuild().getBuilder().getName(), self.getBuild().getNumber())
def getRemotePath(self):
return "buildresults@build.webkit.org:%s" % (self.getDestinationPath(), )
def getURLPath(self):
return '/results/%s/%s/' % (self.getBuild().getBuilder().getName(), self.getBuild().getNumber(), )
def getBuild(self):
return self.__build
def getText(self, cmd, results):
return self.getText2(cmd, results)
def getText2(self, cmd, results):
return ['<a href="%s">%s</a>' % (self.getURLPath(), self.name)]
from webkit.factories import *
_builders = [('post-commit-powerpc-mac-os-x', StandardBuildFactory, ['apple-slave-6', 'apple-slave-5', 'apple-slave-3']),
('post-commit-leaks-powerpc-mac-os-x', LeakBuildFactory, ['apple-slave-5', 'apple-slave-3', 'apple-slave-6']),
('post-commit-pixel-powerpc-mac-os-x', PixelTestBuildFactory, ['apple-slave-3', 'apple-slave-5', 'apple-slave-6']),
('page-layout-test-mac-os-x', PageLoadTestBuildFactory, ['apple-slave-1']),
('post-commit-win32', Win32BuildFactory, ['apple-slave-2']),
('periodic-powerpc-mac-os-x-no-svg', NoSVGBuildFactory, ['apple-slave-3', 'apple-slave-5', 'apple-slave-6']),
]
def getBuilders():
result = []
for name, factory, slaves in _builders:
result.append({'name': name,
'slavenames': slaves,
'builddir': name,
'factory': factory()})
return result
from webkit.steps import *
from buildbot.process import factory
s = factory.s
class BuildFactory(factory.BuildFactory):
useProgress = False
def __init__(self):
factory.BuildFactory.__init__(self, [s(CheckOutSource)])
class StandardBuildFactory(BuildFactory):
def __init__(self):
BuildFactory.__init__(self)
self.steps.append(s(SetConfiguration, configuration="release"))
self.steps.append(s(self.getCompileStep(), configuration="release"))
self.steps.append(s(JavaScriptCoreTest))
self.steps.append(s(LayoutTest))
self.steps.append(s(UploadLayoutResults))
# self.steps.append(s(UploadDiskImage))
def getCompileStep(self):
return CompileWebKit
class NoSVGBuildFactory(StandardBuildFactory):
def getCompileStep(self):
return CompileWebKitNoSVG
class PixelTestBuildFactory(BuildFactory):
def __init__(self):
BuildFactory.__init__(self)
self.steps.append(s(SetConfiguration, configuration="release"))
self.steps.append(s(CompileWebKit, configuration="release"))
self.steps.append(s(PixelLayoutTest))
self.steps.append(s(UploadLayoutResults))
class LeakBuildFactory(BuildFactory):
def __init__(self):
BuildFactory.__init__(self)
self.steps.append(s(SetConfiguration, configuration="debug"))
self.steps.append(s(CompileWebKit, configuration="debug"))
self.steps.append(s(JavaScriptCoreTest))
self.steps.append(s(LeakTest))
self.steps.append(s(UploadLayoutResults))
# self.steps.append(s(UploadDiskImage))
class PageLoadTestBuildFactory(BuildFactory):
def __init__(self):
BuildFactory.__init__(self)
self.steps.append(s(CompileWebKit, configuration="release"))
self.steps.append(s(PageLoadTest))
class Win32BuildFactory(BuildFactory):
def __init__(self):
BuildFactory.__init__(self)
self.steps.append(s(InstallWin32Dependencies))
self.steps.append(s(CompileWebKit, configuration="release"))
self.steps.append(s(JavaScriptCoreTest))
self.steps.append(s(LayoutTest))
from buildbot.scheduler import Scheduler, Periodic
def getSchedulers(builders):
post_commit_builders = [b['name'] for b in builders if b['name'].startswith('post-commit-')] + ['page-layout-test-mac-os-x']
post_commit_builders.sort()
periodic_builders = [b['name'] for b in builders if b['name'].startswith('periodic-')]
periodic_builders.sort()
post_commit = Scheduler(name="post-commit", branch=None, treeStableTimer=90, builderNames=post_commit_builders)
periodic = Periodic("periodic", periodic_builders, 6 * 60 * 60)
return [post_commit, periodic]
from buildbot.status import html, mail, words, client
from twisted.web.rewrite import RewriterResource
class MyWaterfall(html.Waterfall):
def setup(self):
html.Waterfall.setup(self)
rootResource = self.site.resource
def rewriteXSL(request):
if request.postpath and (request.postpath[-1].endswith('.xsl') or
(request.postpath[0] == 'results' and (request.postpath[-1].endswith('.css') or
request.postpath[-1].endswith('.js'))
)):
request.postpath = ['results', request.postpath[-1]]
request.path = '/' + '/'.join(request.prepath + request.postpath)
self.site.resource = RewriterResource(rootResource, rewriteXSL)
waterfall = MyWaterfall(http_port=8010, css="buildbot.css", results_directory="/home/buildresults/results/")
allBuildsEmail = mail.MailNotifier(fromaddr="buildbot@webkit.org",
extraRecipients=["mark+webkit-builds@bdash.net.nz"],
sendToInterestedUsers=False)
breakageEmail = mail.MailNotifier(fromaddr="buildbot@webkit.org",
extraRecipients=["mark+webkit-builds@bdash.net.nz"],
sendToInterestedUsers=False,
mode="breakage")
IRC = words.IRC(host="irc.freenode.net",
nick="webkit-build",
channels=["#webkit-build"],
announceAllBuilds=True)
PBClient = client.PBListener("tcp:9988", "statusClient", "clientpw")
def getStatusListeners():
return [waterfall, allBuildsEmail, breakageEmail, IRC, PBClient]
from webkit.basesteps import ShellCommand, SVN, Test, Compile, UploadCommand
from buildbot.status.builder import SUCCESS, FAILURE, WARNINGS
class CheckOutSource(SVN):
svnurl = "svn://anoncvs.opensource.apple.com/svn/webkit/trunk"
mode = "update"
def __init__(self, *args, **kwargs):
SVN.__init__(self, svnurl=self.svnurl, mode=self.mode, *args, **kwargs)
class SetConfiguration(ShellCommand):
command = ["./WebKitTools/Scripts/set-webkit-configuration"]
def __init__(self, *args, **kwargs):
configuration = kwargs.pop('configuration')
self.command = self.command + ['--' + configuration]
self.name = "set-configuration-%s" % (configuration, )
self.description = ["set configuration %s" % (configuration, )]
self.descriptionDone = ["set configuration %s" % (configuration, )]
ShellCommand.__init__(self, *args, **kwargs)
class LayoutTest(Test):
name = "layout-test"
description = ["layout-tests running"]
descriptionDone = ["layout-tests"]
command = ["./WebKitTools/Scripts/run-webkit-tests", "--no-launch-safari", "--results-directory", "layout-test-results"]
def commandComplete(self, cmd):
Test.commandComplete(self, cmd)
logText = cmd.log.getText()
incorrectLayoutLines = [line for line in logText.splitlines() if line.find('had incorrect layout') >= 0]
if incorrectLayoutLines:
self.incorrectLayoutLine = incorrectLayoutLines[0]
else:
self.incorrectLayoutLine = None
def getText(self, cmd, results):
return self.getText2(cmd, results)
def getText2(self, cmd, results):
if results != SUCCESS and self.incorrectLayoutLine:
return [self.incorrectLayoutLine]
return [self.name]
class JavaScriptCoreTest(Test):
name = "jscore-test"
description = ["jscore-tests running"]
descriptionDone = ["jscore-tests"]
command = ["./WebKitTools/Scripts/run-javascriptcore-tests"]
class PixelLayoutTest(LayoutTest):
name = "pixel-layout-test"
description = ["pixel-layout-tests running"]
descriptionDone = ["pixel-layout-tests"]
command = LayoutTest.command + ["--pixel"]
class LeakTest(Test):
name = "leak-test"
description = ["leak-tests running"]
descriptionDone = ["leak-tests"]
command = ["./WebKitTools/Scripts/run-webkit-tests", "--no-launch-safari", "--quiet", "--leaks", "--results-directory", "layout-test-results"]
def commandComplete(self, cmd):
Test.commandComplete(self, cmd)
logText = cmd.log.getText()
self.totalLeakLines = [line for line in logText.splitlines() if line.find('total leaks found!') >= 0]
self.totalLeakLines += [line for line in logText.splitlines() if line.find('LEAK: ') >= 0]
self.totalLeakLines = [' '.join(x.split()[1:]) for x in self.totalLeakLines]
def evaluateCommand(self, cmd):
if cmd.rc != 0:
return FAILURE
if self.totalLeakLines:
return FAILURE
return SUCCESS
def getText(self, cmd, results):
return self.getText2(cmd, results)
def getText2(self, cmd, results):
if results != SUCCESS and self.totalLeakLines:
return self.totalLeakLines
return [self.name]
class PageLoadTest(UploadCommand, Test):
name = "page-load-test"
description = ["page-load-tests running"]
descriptionDone = ["page-load-tests"]
command = ["./WebKitTools/BuildSlaveSupport/run-performance-tests"]
def __init__(self, *args, **kwargs):
UploadCommand.__init__(self, *args, **kwargs)
self.command = self.command + ['--upload-results', self.getRemotePath()]
Test.__init__(self, *args, **kwargs)
def getURLPath(self):
return UploadCommand.getURLPath(self) + 'PerformanceReportSummary.xml'
class UploadLayoutResults(UploadCommand, ShellCommand):
name = "upload-results"
description = ["uploading results"]
descriptionDone = ["uploaded-results"]
def __init__(self, *args, **kwargs):
UploadCommand.__init__(self, *args, **kwargs)
self.command = 'if [[ -d layout-test-results ]]; then find layout-test-results -type d -print0 | xargs -0 chmod ug+rx; find layout-test-results -type f -print0 | xargs -0 chmod ug+r; rsync -rlvzP --rsync-path="/home/buildresults/bin/rsync" layout-test-results/ %s && rm -rf layout-test-results; fi' % (self.getRemotePath(), )
ShellCommand.__init__(self, *args, **kwargs)
class CompileWebKit(Compile):
command = ["./WebKitTools/Scripts/build-webkit"]
def __init__(self, *args, **kwargs):
configuration = kwargs.pop('configuration')
self.name = "compile-" + configuration
self.description = ["compiling " + configuration]
self.descriptionDone = ["compiled " + configuration]
Compile.__init__(self, *args, **kwargs)
class CompileWebKitNoSVG(CompileWebKit):
command = CompileWebKit.command + ['--no-svg']
class InstallWin32Dependencies(ShellCommand):
description = ["installing Windows dependencies"]
descriptionDone = ["installed Windows dependencies"]
command = ["WebKitTools/Scripts/install-win-extras"]
class UploadDiskImage(UploadCommand, ShellCommand):
description = ["uploading disk image"]
descriptionDone = ["uploaded disk image"]
name = "upload-disk-image"
def __init__(self, *args, **kwargs):
UploadCommand.__init__(self, *args, **kwargs)
self.command = 'umask 002 && ./WebKitTools/BuildSlaveSupport/build-launcher-app && ./WebKitTools/BuildSlaveSupport/build-launcher-dmg --upload-to-host %s' % (self.getRemotePath(), )
ShellCommand.__init__(self, *args, **kwargs)
2006-06-29 Mark Rowe <opendarwin.org@bdash.net.nz>
Reviewed by Darin.
Bug 9615: Buildbot configuration should be in SVN repository
http://bugzilla.opendarwin.org/show_bug.cgi?id=9615
Import BuildBot configuration files as used by build.webkit.org.
auth.py has been stubbed out so that slave passwords are not disclosed.
* BuildSlaveSupport/build.webkit.org-config/Makefile: Added.
* BuildSlaveSupport/build.webkit.org-config/buildbot.css: Added.
* BuildSlaveSupport/build.webkit.org-config/buildbot.tac: Added.
* BuildSlaveSupport/build.webkit.org-config/master.cfg: Added.
* BuildSlaveSupport/build.webkit.org-config/webkit/__init__.py: Added.
* BuildSlaveSupport/build.webkit.org-config/webkit/auth.py: Added.
* BuildSlaveSupport/build.webkit.org-config/webkit/basesteps.py: Added.
* BuildSlaveSupport/build.webkit.org-config/webkit/builders.py: Added.
* BuildSlaveSupport/build.webkit.org-config/webkit/factories.py: Added.
* BuildSlaveSupport/build.webkit.org-config/webkit/schedulers.py: Added.
* BuildSlaveSupport/build.webkit.org-config/webkit/status.py: Added.
* BuildSlaveSupport/build.webkit.org-config/webkit/steps.py: Added.
2006-06-29 Mark Rowe <opendarwin.org@bdash.net.nz>
Reviewed by Darin.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment