<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kartar.Net &#187; buildbot</title>
	<atom:link href="http://www.kartar.net/category/buildbot/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kartar.net</link>
	<description>the truth about a man lies in what he hides</description>
	<lastBuildDate>Fri, 30 Jul 2010 00:25:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Puppet&#8217;s BuildBot</title>
		<link>http://www.kartar.net/2008/08/puppets-buildbot/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=puppets-buildbot</link>
		<comments>http://www.kartar.net/2008/08/puppets-buildbot/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 01:23:22 +0000</pubDate>
		<dc:creator>kartar</dc:creator>
				<category><![CDATA[buildbot]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[hudson]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[is]]></category>
		<category><![CDATA[keys]]></category>
		<category><![CDATA[on]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[reductive]]></category>
		<category><![CDATA[reductivelabs]]></category>
		<category><![CDATA[repo]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[Rspec]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[war]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[So rather than doing the work I actually should be I've been playing with <a href="http://buildbot.net">BuildBot</a>. I had intended to get around to setting up BuildBot sometime in the next couple of months but I got hooked.  

The reason I wanted to have a look at BuildBot was that <a href="http://reductivelabs.com/trac/puppet">Puppet</a> has reached a stage where we simply can't test every platform it runs on.  We are also starting to get patches from a wider variety of sources.  Buildbot will allow us to execute our tests on a wider variety of platforms. Hopefully with the cooperation of the community we can gather a really big collection of build platforms to test on.

Here's the blurb for BuildBot

<i>The BuildBot is a system to automate the compile/test cycle required by most software projects to validate code changes. By automatically rebuilding and testing the tree each time something has changed, build problems are pinpointed quickly, before other developers are inconvenienced by the failure. The guilty developer can be identified and harassed without human intervention. By running the builds on a variety of platforms, developers who do not have the facilities to test their changes everywhere before checkin will at least know shortly afterwards whether they have broken the build or not. Warning counts, lint checks, image size, compile time, and other build parameters can be tracked over time, are more visible, and are therefore easier to improve.

The overall goal is to reduce tree breakage and provide a platform to run tests or code-quality checks that are too annoying or pedantic for any human to waste their time with. Developers get immediate (and potentially public) feedback about their changes, encouraging them to be more careful about testing before checkin.</i>

It's a very easy tool to deploy.  The hardest part has been the slightly broken Git source handling and the assumption that any Git repository is local.  I need to have a local Git repository to allow BuildBot to submit the right commits references to the PBChangeSource function.

But I designed a basic process for handling new commits:

1. Commit pushed to GitHub.
2. <a href="http://github.com/jamtur01/github-buildbot-commitbot/tree/master">Commit bot</a> at GitHub picks up commit and sends it to BuildBot Master.
3. BuildBot uses the git_buildbot.py script to calculate the before/after commit and branch references and tell BuildBot about them.
4. BuildBot executes the build and tells each slave to retrieve the commit and runs the tests.  Currently we're running:

a. All the Unit tests
b. All the RSpec tests

5. We then get the results of the tests on the website and in an email to the new Puppet Builds mailing list.

In addition I've also enabled BuildBot's IRC bot and added a new bot, called pinocchio, to the #puppet channel that reports on build status.

At this stage it's all in test mode and when I've ironed out a few issues we should be in a position to do a production installation at ReductiveLabs and start canvassing for build slaves.]]></description>
			<content:encoded><![CDATA[<p>So rather than doing the work I actually should be I&#8217;ve been playing with <a href="http://buildbot.net">BuildBot</a>. I had intended to get around to setting up BuildBot sometime in the next couple of months but I got hooked.</p>
<p>The reason I wanted to have a look at BuildBot was that <a href="http://reductivelabs.com/trac/puppet">Puppet</a> has reached a stage where we simply can&#8217;t test every platform it runs on.  We are also starting to get patches from a wider variety of sources.  Buildbot will allow us to execute our tests on a wider variety of platforms. Hopefully with the cooperation of the community we can gather a really big collection of build platforms to test on.</p>
<p>Here&#8217;s the blurb for BuildBot</p>
<p><em>The BuildBot is a system to automate the compile/test cycle required by most software projects to validate <a href="http://www.kartar.net/tag/code/" class="st_tag internal_tag" rel="tag" title="Posts tagged with code">code</a> changes. By automatically rebuilding and testing the tree each time something has changed, build problems are pinpointed quickly, before other developers are inconvenienced by the failure. The guilty developer can be identified and harassed without human intervention. By running the builds on a variety of platforms, developers who do not have the facilities to test their changes everywhere before checkin will at least know shortly afterwards whether they have broken the build or not. Warning counts, lint checks, image size, compile time, and other build parameters can be tracked over time, are more visible, and are therefore easier to improve.</em></p>
<p><em>The overall goal is to reduce tree breakage and provide a platform to run tests or <a href="http://www.kartar.net/tag/code/" class="st_tag internal_tag" rel="tag" title="Posts tagged with code">code</a>-quality checks that are too annoying or pedantic for any human to waste their time with. Developers get immediate (and potentially public) feedback about their changes, encouraging them to be more careful about testing before checkin.</em></p>
<p>It&#8217;s a very easy tool to deploy.  The hardest part has been the slightly broken <a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">Git</a> source handling and the assumption that any <a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">Git</a> <a href="http://www.kartar.net/tag/repository/" class="st_tag internal_tag" rel="tag" title="Posts tagged with repository">repository</a> is local.  I need to have a local <a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">Git</a> <a href="http://www.kartar.net/tag/repository/" class="st_tag internal_tag" rel="tag" title="Posts tagged with repository">repository</a> to allow BuildBot to submit the right commits references to the PBChangeSource function.</p>
<p>But I designed a basic <a href="http://www.kartar.net/tag/process/" class="st_tag internal_tag" rel="tag" title="Posts tagged with process">process</a> for handling new commits:</p>
<p>1. <a href="http://www.kartar.net/tag/commit/" class="st_tag internal_tag" rel="tag" title="Posts tagged with commit">Commit</a> pushed to GitHub.<br />
2. <a href="http://github.com/jamtur01/github-buildbot-commitbot/tree/master">Commit bot</a> at GitHub picks up <a href="http://www.kartar.net/tag/commit/" class="st_tag internal_tag" rel="tag" title="Posts tagged with commit">commit</a> and sends it to BuildBot Master.<br />
3. BuildBot uses the git_buildbot.py script to calculate the before/after <a href="http://www.kartar.net/tag/commit/" class="st_tag internal_tag" rel="tag" title="Posts tagged with commit">commit</a> and branch references and tell BuildBot about them.<br />
4. BuildBot executes the build and tells each slave to retrieve the <a href="http://www.kartar.net/tag/commit/" class="st_tag internal_tag" rel="tag" title="Posts tagged with commit">commit</a> and runs the tests.  Currently we&#8217;re running:</p>
<p>a. All the Unit tests<br />
b. All the <a href="http://www.kartar.net/tag/rspec/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Rspec">RSpec</a> tests</p>
<p>5. We then get the results of the tests on the website and in an email to the new Puppet Builds mailing list.</p>
<p>In addition I&#8217;ve also enabled BuildBot&#8217;s IRC bot and added a new bot, called pinocchio, to the #puppet channel that reports on build status.</p>
<p>At this stage it&#8217;s all in test mode and when I&#8217;ve ironed out a few issues we should be in a position to do a production installation at ReductiveLabs and start canvassing for build slaves.</p>
<p><strong>UPDATE</strong></p>
<p>After mucking around with Buildbot I just couldn&#8217;t get a whole bunch of issues with <a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">Git</a> resolved so we changed to Hudson as our CI &#8211; which works much better.  The message overall is &#8211; CI and <a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">Git</a>: still a young pair.  I&#8217;ve included our configuration below for edification:</p>
<p><em># -*- python -*-<br />
# ex: set syntax=python:</em></p>
<p><em># This is a sample buildmaster config file. It must be installed as<br />
# &#8216;master.cfg&#8217; in your buildmaster&#8217;s base directory (although the filename<br />
# can be changed with the &#8211;basedir option to &#8216;mktap buildbot master&#8217;).</em></p>
<p><em># It has one job: define a dictionary named BuildmasterConfig. This<br />
# dictionary has a variety of keys to control different aspects of the<br />
# buildmaster. They are documented in docs/config.xhtml .</em></p>
<p><em># This is the dictionary that the buildmaster pays attention to. We also use<br />
# a shorter alias to save typing.<br />
c = BuildmasterConfig = {}</em></p>
<p><em>####### BUILDSLAVES</em></p>
<p><em># the &#8216;slaves&#8217; list defines the set of allowable buildslaves. Each element is<br />
# a tuple of bot-name and bot-password. These correspond to values given to<br />
# the buildslave&#8217;s mktap invocation.<br />
from buildbot.buildslave import BuildSlave</em></p>
<p><em>c['slaves'] = [BuildSlave("debian", "debian"),<br />
BuildSlave("freebsd", "freebsd"),<br />
BuildSlave("redhat", "redhat")<br />
]</em></p>
<p><em># &#8216;slavePortnum&#8217; defines the TCP port to listen on. This must match the value<br />
# configured into the buildslaves (with their &#8211;master option)</em></p>
<p><em>c['slavePortnum'] = 9989</em></p>
<p><em>####### CHANGESOURCES</em></p>
<p><em># the &#8216;change_source&#8217; setting tells the buildmaster how it should find out<br />
# about source <a href="http://www.kartar.net/tag/code/" class="st_tag internal_tag" rel="tag" title="Posts tagged with code">code</a> changes. Any class which implements IChangeSource can be<br />
# put here: there are several in buildbot/changes/*.py to choose from.</em></p>
<p><em>from buildbot.changes.pb import PBChangeSource<br />
c['change_source'] = PBChangeSource()</em></p>
<p><em>####### SCHEDULERS</em></p>
<p><em>## configure the Schedulers</em></p>
<p><em>from buildbot import scheduler</em></p>
<p><em>stable = scheduler.Scheduler(name=&#8221;stable&#8221;, builderNames=["debian_stable", "freebsd_stable", "redhat_stable"], treeStableTimer=60, branch=&#8221;0.24.x&#8221;)<br />
dev = scheduler.Scheduler(name=&#8221;dev&#8221;, builderNames=["debian_dev", "freebsd_dev", "redhat_dev"], treeStableTimer=60, branch=&#8221;master&#8221;)</em></p>
<p><em>c['schedulers'] = [stable, dev]</em></p>
<p><em>####### BUILDERS</em></p>
<p><em># the &#8216;builders&#8217; list defines the Builders. Each one is configured with a<br />
# dictionary, using the following keys:<br />
#  name (required): the name used to describe this bilder<br />
#  slavename (required): which slave to use, must appear in c['bots']<br />
#  builddir (required): which subdirectory to run the builder in<br />
#  factory (required): a BuildFactory to define how the build is run<br />
#  periodicBuildTime (optional): if set, force a build every N seconds</em></p>
<p><em># buildbot/<a href="http://www.kartar.net/tag/process/" class="st_tag internal_tag" rel="tag" title="Posts tagged with process">process</a>/factory.py provides several BuildFactory classes you can<br />
# start with, which implement build processes for common targets (GNU<br />
# autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the<br />
# base class, and is configured with a series of BuildSteps. When the build<br />
# is run, the appropriate buildslave is told to execute each Step in turn.</em></p>
<p><em># the first BuildStep is typically responsible for obtaining a copy of the<br />
# sources. There are source-obtaining Steps in buildbot/steps/source.py for<br />
# CVS, SVN, and others.</em></p>
<p><em>from buildbot.<a href="http://www.kartar.net/tag/process/" class="st_tag internal_tag" rel="tag" title="Posts tagged with process">process</a> import factory<br />
from buildbot.steps import source, shell</em></p>
<p><em>pstable = factory.BuildFactory()<br />
pstable.addStep(source.<a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">Git</a>(repourl=&#8217;<a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">git</a>://github.com/jamtur01/puppet.<a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">git</a>&#8217;, branch=&#8217;0.24.x&#8217;))<br />
pstable.addStep(shell.ShellCommand(command=&#8217;rake spec&#8217;, name=&#8217;Spec Tests&#8217;))<br />
pstable.addStep(shell.ShellCommand(command=&#8217;rake unit&#8217;, name=&#8217;Unit Tests&#8217;))</em></p>
<p><em>pdev = factory.BuildFactory()<br />
pdev.addStep(source.<a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">Git</a>(repourl=&#8217;<a href="http://www.kartar.net/tag/git/" class="st_tag internal_tag" rel="tag" title="Posts tagged with git">git</a>://reductivelabs.com/puppet&#8217;, branch=&#8217;master&#8217;))<br />
pdev.addStep(shell.ShellCommand(command=&#8217;rake spec&#8217;, name=&#8217;Spec Tests&#8217;))<br />
pdev.addStep(shell.ShellCommand(command=&#8217;rake unit&#8217;, name=&#8217;Unit Tests&#8217;))</em></p>
<p><em>debian_stable = {&#8216;name&#8217;: &#8220;debian_stable&#8221;,<br />
&#8216;slavename&#8217;: &#8220;debian&#8221;,<br />
&#8216;builddir&#8217;: &#8220;debian_stable&#8221;,<br />
&#8216;factory&#8217;: pstable,<br />
}</em></p>
<p><em>debian_dev = { &#8216;name&#8217;: &#8220;debian_dev&#8221;,<br />
&#8216;slavename&#8217;: &#8220;debian&#8221;,<br />
&#8216;builddir&#8217;: &#8220;debian_dev&#8221;,<br />
&#8216;factory&#8217;: pdev,<br />
}</em></p>
<p><em>redhat_stable = {&#8216;name&#8217;: &#8220;redhat_stable&#8221;,<br />
&#8216;slavename&#8217;: &#8220;redhat&#8221;,<br />
&#8216;builddir&#8217;: &#8220;redhat_stable&#8221;,<br />
&#8216;factory&#8217;: pstable,<br />
}</em></p>
<p><em>redhat_dev = { &#8216;name&#8217;: &#8220;redhat_dev&#8221;,<br />
&#8216;slavename&#8217;: &#8220;redhat&#8221;,<br />
&#8216;builddir&#8217;: &#8220;redhat_dev&#8221;,<br />
&#8216;factory&#8217;: pdev,<br />
}</em></p>
<p><em>freebsd_stable = {&#8216;name&#8217;: &#8220;freebsd_stable&#8221;,<br />
&#8216;slavename&#8217;: &#8220;freebsd&#8221;,<br />
&#8216;builddir&#8217;: &#8220;freebsd_stable&#8221;,<br />
&#8216;factory&#8217;: pstable,<br />
}</em></p>
<p><em>freebsd_dev = { &#8216;name&#8217;: &#8220;freebsd_dev&#8221;,<br />
&#8216;slavename&#8217;: &#8220;freebsd&#8221;,<br />
&#8216;builddir&#8217;: &#8220;freebsd_dev&#8221;,<br />
&#8216;factory&#8217;: pdev,<br />
}</em></p>
<p><em>c['builders'] = [debian_stable, debian_dev, freebsd_stable, freebsd_dev, redhat_stable, redhat_dev]</em></p>
<p><em>####### STATUS TARGETS</em></p>
<p><em># &#8216;status&#8217; is a list of Status Targets. The results of each build will be<br />
# pushed to these targets. buildbot/status/*.py has a variety to choose from,<br />
# including web pages, email senders, and IRC bots.</em></p>
<p><em>c['status'] = []</em></p>
<p><em>from buildbot.status import html<br />
c['status'].append(html.WebStatus(http_port=8010))</em></p>
<p><em>from buildbot.status import mail<br />
c['status'].append(mail.MailNotifier(fromaddr=&#8221;buildbot@reductivelabs.com&#8221;,<br />
extraRecipients=["puppet-build@googlegroups.com"],<br />
sendToInterestedUsers=False))</em></p>
<p><em>from buildbot.status import words<br />
c['status'].append(words.IRC(host=&#8221;irc.freenode.net&#8221;, nick=&#8221;pinocchio&#8221;,<br />
channels=["#puppet"],<br />
password=&#8221;password&#8221;))</em></p>
<p><em># from buildbot.status import client<br />
# c['status'].append(client.PBListener(9988))</em></p>
<p><em>####### DEBUGGING OPTIONS</em></p>
<p><em># if you set &#8216;debugPassword&#8217;, then you can connect to the buildmaster with<br />
# the diagnostic tool in contrib/debugclient.py . From this tool, you can<br />
# manually force builds and inject changes, which may be useful for testing<br />
# your buildmaster without actually commiting changes to your <a href="http://www.kartar.net/tag/repository/" class="st_tag internal_tag" rel="tag" title="Posts tagged with repository">repository</a> (or<br />
# before you have a functioning &#8216;sources&#8217; set up). The debug tool uses the<br />
# same port number as the slaves do: &#8216;slavePortnum&#8217;.</em></p>
<p><em>#c['debugPassword'] = &#8220;debugpassword&#8221;</em></p>
<p><em># if you set &#8216;manhole&#8217;, you can ssh into the buildmaster and get an<br />
# interactive python shell, which may be useful for debugging buildbot<br />
# internals. It is probably only useful for buildbot developers. You can also<br />
# use an authorized_keys file, or plain telnet.<br />
#from buildbot import manhole<br />
#c['manhole'] = manhole.PasswordManhole(&#8220;tcp:9999:interface=127.0.0.1&#8243;,<br />
#                                       &#8220;admin&#8221;, &#8220;password&#8221;)</em></p>
<p><em>####### PROJECT IDENTITY</em></p>
<p><em># the &#8216;projectName&#8217; string will be used to describe the project that this<br />
# buildbot is working on. For example, it is used as the title of the<br />
# waterfall HTML page. The &#8216;projectURL&#8217; string will be used to provide a link<br />
# from buildbot HTML pages to your project&#8217;s home page.</em></p>
<p><em>c['projectName'] = &#8220;Puppet&#8221;<br />
c['projectURL'] = &#8220;http://reductivelabs.com/trac/puppet/&#8221;</em></p>
<p><em># the &#8216;buildbotURL&#8217; string should point to the location where the buildbot&#8217;s<br />
# internal web server (usually the html.Waterfall page) is visible. This<br />
# typically uses the port number set in the Waterfall &#8216;status&#8217; entry, but<br />
# with an externally-visible host name which the buildbot cannot figure out<br />
# without some help.</em></p>
<p><em>#c['buildbotURL'] = &#8220;http://10.0.0.x:8010/&#8221;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kartar.net/2008/08/puppets-buildbot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
