Installing buildbot

26 05 2006

I must admin setting up a buildbot was very entertaining. Of course this is because I read Grig tutorial. With well-written HOWTO nothing is hard. I’ll just write down few things that wasn’t already mentioned by Grig.

Oh, and if you can’t wait, Cheesecake buildbot is available here.

installation

Before we can install buildbot, few prerequisites have to be met. First, Zope Interface. I’ve chosen stable 3.0.1 version. After downloading and unpacking, I’ve tried:

# python setup.py install

This unfortunately failed with error:

error: static declaration of ‘SpecType’ follows non-static declaration

With minimal googling around I’ve managed to find a fix. Bug has been described on Zope issue tracker. Trivial fix is also available for download.

$ cd Dependencies/zope.interface-ZopeInterface-3.0.1/\
zope.interface/
$ patch -p4 < fix-zope-compilation.patch
patching file _zope_interface_coptimizations.c

After that I could try my luck again with setup.py install. Installation was successfull this time. Next prerequisite is Twisted and TwistedWeb packages. I’ve downloaded a TwistedSumo tarball and installed Twisted-2.2.0 and TwistedWeb-0.5.0 with the help of almighty setup.py install command.

Installing last package is pretty easy. You just have to execute one command:

# easy_install http://twistedmatrix.com/users/acapnotic/wares/code/CVSToys/CVSToys-1.0.9.tar.bz2

If you have any problems with easy_install (it may throw error Not a recognized archive type at you on some systems) you may also download, unpack and install the package manually. easy_install just automates this process.

Builbot 0.7.3 was realeased this Tuesday. You can grab any version at sourceforge. Install with standard python setup.py install. You should get buildbot in /usr/bin/ installed.

buildmaster

To set up a buildmaster few steps have to be followed. First create a separate user:

# adduser buildmaster

Now su to this newly created account and execute these commands:

$ mkdir conf
$ buildbot master conf/
$ cd conf/
$ mv master.cfg.sample master.cfg

In conf/master.cfg you will get a configuration template you should modify to get appropriate results. My complete master.cfg file follow (without comments).

import os.path
from buildbot.changes.freshcvs import FreshCVSSource
from buildbot.scheduler import Scheduler, Periodic
from buildbot.process import step, factory
from buildbot.status import html
s = factory.s

c = BuildmasterConfig = {}

c['bots'] = [("x86_rh9", "*PASSWORD*")]

c['sources'] = []

c['schedulers'] = [
    Periodic("every_6_hours", ["x86_rh9_trunk"], 6*60*60),
    Periodic("every_6_hours2", ["x86_rh9_mk"], 6*60*60)
]

make_source = lambda branch: s(step.SVN, mode='update',
                baseURL='http://svn.pycheesecake.org/',
                defaultBranch=branch)

source_mk = make_source('branches/mk/')
source_trunk = make_source('trunk')

class StepTest(step.ShellCommand):
    name = "nose tests"
    description = ["running nose tests"]
    descriptionDone = [name]

nose_tests = s(StepTest, command="/usr/bin/python setup.py test")

make_factory = lambda source: factory.BuildFactory()

f_mk = make_factory(source_mk)
f_trunk = make_factory(source_trunk)

c['builders'] = [
    {'name':'x86_rh9_mk',
    'slavename':'x86_rh9',
    'builddir':'test-mk',
    'factory':f_mk
    },
    {'name': 'x86_rh9_trunk',
    'slavename': 'x86_rh9',
    'builddir': 'test-trunk',
    'factory': f_trunk
    },
]

c['slavePortnum'] = 9999

c['status'] = []
c['status'].append(html.Waterfall(http_port=8888))

c['projectName'] = "Cheesecake"
c['projectURL'] = "http://pycheesecake.org/"

c['buildbotURL'] = "http://agilistas.org:8888"

Note that you should set up password yourself.

buildslave

After buildmaster setup is complete, we can configure build slaves, which is far easier as no configuration files come into play. Simply add a slave user:

# adduser buildslave

and make a directory:

$ mkdir conf
$ buildbot slave /home/buildslave/conf localhost:9999 x86_rh9 *PASSWORD*

Note that the port given here and c['slavePortnum'] in master configuration must match.

running

To start a build slave, run following command as user buildslave:

buildbot start /home/buildslave/conf

Then start a build master with simillar command (run as user buildmaster):

buildbot start /home/buildmaster/conf

That’s it! You can now access your buildbot through web interface at an address you’ve specified in c['buildbotURL'] configuration option. If this doesn’t work check out logs (twistd.log) in your slave and master directories.

References

About these ads

Actions

Information

7 responses

28 06 2006
Cowmix

Can you go into detail about your Python setup under RH9? Did you have to build it from source or did you use a RPM with a more recent version?

9 02 2007
Sakthivel

PLEASE INCLUDE SETTING UP FRESHCVS PBSERVICE

All the things are working fine except getting the changes from FreshCvs daemon.
I have tried a lot. googled installing different versions in FC3 n FC4, nothing helped.
There is no documents available for FreshCvs. if i add PBService(userpass=(‘foo’, ‘bar’), port=9989) im getting the error
exceptions.AttributeError: _ServiceNetwork instance has no attribute ‘authorizer’

Many of my friends also tried and got the same error.

4 04 2008
A Drop In The Stream › links for 2008-04-04

[...] Installing buildbot « Mousebender (tags: buildbot python howto setup) This was written by doug. Posted on Thursday, April 3, 2008, at 9:37 pm. Filed under del.icio.us Links. Bookmark the permalink. Follow comments here with the RSS feed. Post a comment or leave a trackback. [...]

11 07 2009
Rutger

I want to setup buildbot to use with SVN any good tutorials on this ….

22 09 2010
Fatman

My buildmaster complains:

exceptions.ImportError: cannot import name step

at the line:

from buildbot.process import factory,step

:( Any ideas?

22 09 2010
Fatman

Sorted it. The answer was to find an up-to-date manual. A DARCS-type patch seems appropriate here :P

-from buildbot.process import factory,step
+from buildbot.process import factory
+from buildbot.steps import source

-source = s(step.Darcs, …
+src = s(source.Darcs, …

-f = factory.BuildFactory([source, …
+f = factory.BuildFactory([src, …

22 09 2010
Michał Kwiatkowski

Thanks for leaving the patch here!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: