Documentation for adding builders and slaves to zorg?

Hi all,

I’m working on adding a new buildbot. I’m don’t understand what is required when patching zorg’s and

Is there any documentation on this?
Would anybody be willing to help?


Eric Fiselier

Something like the following?


I don't think there is other documentation. I would just look at the last commits that added builders. They should show exactly the changes needed.


P.S: Re-adding llvmdev@ mailing list. This keeps our answers and discussions available to everyone.

Hi Eric,

There is documentation here [1].

I actually started (but have not finished) looking at doing something
with the buildbot recently. I was going to actually email llvmdev
after I finished because so far the experience has been a little
painful in terms of lack of documentation and zorg's organisation but
seeing as you've brought this issue up now might be a good time for me
to start the discussion.

What I wanted to do was

- create a new Factory which defines how to build the LLVM Sphinx documentation
- create a builder that uses this factory
- Run the a buildbot master and my own slave locally on my own machine
to test this works
- Once I created a configuration that works correctly, create patches
to zorg and submit.

I basically followed a guide I found at [2] to help me with this and
so far what I've managed to do is use some of the exisiting zorg code
to run a completely local buildbot master and slave which has a single
builder to build LLVM. The pain points I found were

- I had to install a really old version of buildbot and then had to
manually patch it so it would actually work (not such a big deal)
- I had to setup quite a few symlinks to setup a working master
configuration that would actually start locally on my machine. For
this use case the way zorg code is organised seems a bit broken.
- I had to rip out most of and (I don't want my
machine contacting the public slaves while I'm testing, also it can't
anyway without passwords) and modify master.cfg.

My current looks like this.

from import LLVMBuilder
from import LLVMBuilder

def _get_llvm_builders():
    return [
            { 'name': 'llvm_buildtest',
              'slavenames': ['dan-sputnik'],
              'builddir': 'llvm_x86_buildtest',
LLVMBuilder.getLLVMBuildFactory("x86_64-linux-gnu", jobs=1)


def get_builders():
    for b in _get_llvm_builders():
        b['category'] = 'llvm'
        yield b

and currently looks like this

import buildbot
import buildbot.buildslave
import os

import config

def create_slave(name, *args, **kwargs):
    password = config.options.get('Slave Passwords', name)
    return buildbot.buildslave.BuildSlave(name, password=password,
*args, **kwargs)

def get_build_slaves():
    return [
        # My slave

My buildbot master was basically created by doing this...

# Get buildbot
$ virtualenv2 --no-site-packages venv2
$ . venv2/bin/activate
$ pip install sqlalchemy==0.7.10
$ pip install buildbot==0.8.5

# patch broken buildbot code just downloaded into virtual environment (see [2])

# Create initial master code and get zorg code
$ buildbot create-master -r master
$ git clone

# Now for some hacky symlinks
$ cd master
$ ln -s zorg ../zorg/zorg
$ ln -s config ../zorg/buildbot/osuosl/master/config/
$ ln -s master.cfg ../zorg/buildbot/osuosl/master/master.cfg

# Hack master.cfg and so it only does things locally and
present a web interface (see [2])

# Hack config/ so it only contains my local slave.

# Finally start the buildbot master
$ cd ../
$ buildbot start master

I could then easily create and start my local slave by doing

$ pip install buildbot-slave==0.8.5
$ buildslave create-slave slave localhost:9990 dan-sputnik password
$ buildslave start slave/

The last two points are the really annoying things because I really
want to test any modifications I make the zorg code before I send a
patch. However I'm not going to fully succeed with this because when
I've finished the changes I've made to zorg code will contain the
useful changes (i.e. a new build configuration and a new builder) and
not useful changes (the hacks I had to make to run a buildbot master
locally on my machine). So I'll then have to clean up the code so it
only contains the relevant stuff (and not my hacks) but then I won't
be able to test any of this locally so then I will have to hope that I
didn't break anything and just submit that patch.

I'd quite happily write some documentation for this because LLVM's
buildbot stuff doesn't seem well documented. It would be good to know
if what I've done above is the right way to test adding a new Factory
(it doesn't feel like it... so many hacks :frowning: ).

I hope this is some what useful to you Eric, even if we're not trying
to do exactly the same thing with the build bot.