Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Difference between revisions of "OLA Buildbot"

From wiki.openlighting.org

Jump to: navigation, search
m (Correct channel name)
Line 9: Line 9:
 
The buildbot master configuration is stored in git at https://code.google.com/p/open-lighting/source/browse?repo=buildbot-config . It needs checking out, and symlinking to replace master.cfg in the buildbot master's config directory.
 
The buildbot master configuration is stored in git at https://code.google.com/p/open-lighting/source/browse?repo=buildbot-config . It needs checking out, and symlinking to replace master.cfg in the buildbot master's config directory.
  
Slave passwords aren't stored in the git repo for security, you'll need to get Simon to add new ones.
+
N.B. If the git repository is ever moved or changed, ensure the master's gitpoller-workdir folder is emptied out, or the poller won't work properly.
 +
 
 +
= Adding a Slave =
 +
 
 +
Buildbot documentation is at http://docs.buildbot.net/current/manual/installation.html#creating-a-buildslave .  The steps below should cover everything you need though.
  
N.B. If the git repository is ever moved or changed, ensure the master's gitpoller-workdir folder is emptied out, or the poller won't work properly.
+
== Prerequisites & Warning ==
 +
 
 +
Slaves execute code directly from the git repo. Even though submits to the git repo are locked down, this is still a possible attack vector for your machine. For this reason it's best to run build slaves within a virtual machine.  TODO: link to some VM solutions.
 +
 
 +
At the very least you should run the buildslave as a separate user (not root!). Slave passwords aren't stored in the git repo for security, you'll need to get Simon to add new ones.
 +
 
 +
The buildbot performs full build & test runs with all the options enabled. Please make sure you have all the necessary libraries installed on your system. You need to be able to complete a
 +
 
 +
<pre>
 +
autoconf -i
 +
./configure --enable-e133 --enable-rdm-tests
 +
make
 +
make check
 +
</pre>
 +
 
 +
cycle before proceeding. If you have trouble ask on the mailing list.
 +
 
 +
Buildbot slaves need to connect to  buildbot.openlighting.org:9989 . Make sure your firewall allows this. No port forwarding for inbound connections is required.
  
== Slave Configuration ==
+
== Debian / Ubuntu Instructions ==
  
Documentation is at http://docs.buildbot.net/current/manual/installation.html#creating-a-buildslave
+
This requires wheezy or later. For squeeze you can use the easy_install method below.
  
For our buildbot, slaves need to connect to  buildbot.openlighting.org:9989
+
=== Build Slave Installation ===
  
On Debian/Ubuntu, based on https://kb.askmonty.org/en/buildbot-setup-buildbot-setup-for-ubuntu-debian/, do the following:
+
<pre>
Install buildbot slave:
 
 
  sudo apt-get install buildbot-slave
 
  sudo apt-get install buildbot-slave
 +
</pre>
 +
 +
=== Slave Configuration ===
  
 
Create the slave:
 
Create the slave:
  sudo -u buildbot buildslave create-slave --usepty=0 /var/lib/buildbot/slaves/<slave name> buildbot.openlighting.org:9989 <slave user> <slave password>
+
 
 +
<pre>
 +
  sudo -u buildbot buildslave create-slave --usepty=0 /var/lib/buildbot/slaves/ola buildbot.openlighting.org:9989 <slave user> <slave password>
 +
</pre>
  
 
Update the slave info, edit the files in /var/lib/buildbot/slaves/<slave name>/info to be relevant to you.
 
Update the slave info, edit the files in /var/lib/buildbot/slaves/<slave name>/info to be relevant to you.
Line 30: Line 56:
 
Add config for the slave into /etc/default/buildslave (you'll need to increase the array id if you've got more than one slave on the same host), e.g.:
 
Add config for the slave into /etc/default/buildslave (you'll need to increase the array id if you've got more than one slave on the same host), e.g.:
 
  SLAVE_ENABLED[1]=1                    # 1-enabled, 0-disabled
 
  SLAVE_ENABLED[1]=1                    # 1-enabled, 0-disabled
  SLAVE_NAME[1]="<slave name>"        # short name printed on start/stop
+
  SLAVE_NAME[1]="ola"        # short name printed on start/stop
 
  SLAVE_USER[1]="buildbot"              # user to run slave as
 
  SLAVE_USER[1]="buildbot"              # user to run slave as
 
  SLAVE_BASEDIR[1]="/var/lib/buildbot/slaves/<slave name>"                  # basedir to slave (absolute path)
 
  SLAVE_BASEDIR[1]="/var/lib/buildbot/slaves/<slave name>"                  # basedir to slave (absolute path)
Line 40: Line 66:
  
 
Check the log if there are any issues, or confirm the slave is registered at http://buildbot.openlighting.org/buildslaves:
 
Check the log if there are any issues, or confirm the slave is registered at http://buildbot.openlighting.org/buildslaves:
  tail -f /var/lib/buildbot/slaves/<slave name>/twistd.log
+
  tail -f /var/lib/buildbot/slaves/ola/twistd.log
 +
 
 +
 
 +
 
 +
== Other Platforms ==
 +
 
 +
=== Build Slave Installation ===
 +
 
 +
The easiest way to get started is by using easy_install. You need to have the Python headers available, so on Debian / Ubuntu run:
 +
 
 +
<pre>
 +
sudo apt-get install python-dev
 +
</pre>
 +
 
 +
Then install buildbot-slave:
 +
 
 +
<pre>
 +
easy_install buildbot-slave
 +
</pre>
 +
 
 +
=== Slave Configuration ===
 +
 
 +
Setup a new user:
 +
 
 +
<pre>
 +
sudo -s
 +
adduser ola-build-slave  # use a temp password for now
 +
vi /etc/shadow  # delete the password entry
 +
</pre>
 +
 
 +
Setup the slave:
 +
 
 +
<pre>
 +
su ola-build-slave
 +
cd ~
 +
buildslave create-slave ola-slave buildbot.openlighting.org:9989 <slave user> <slave password>
 +
</pre>

Revision as of 09:51, 29 April 2013

We run a Buildbot instance for OLA.

We're currently only building ola, but this could be extended to do other projects such as the QT GUI etc.

Master Configuration

The buildbot master configuration is stored in git at https://code.google.com/p/open-lighting/source/browse?repo=buildbot-config . It needs checking out, and symlinking to replace master.cfg in the buildbot master's config directory.

N.B. If the git repository is ever moved or changed, ensure the master's gitpoller-workdir folder is emptied out, or the poller won't work properly.

Adding a Slave

Buildbot documentation is at http://docs.buildbot.net/current/manual/installation.html#creating-a-buildslave . The steps below should cover everything you need though.

Prerequisites & Warning

Slaves execute code directly from the git repo. Even though submits to the git repo are locked down, this is still a possible attack vector for your machine. For this reason it's best to run build slaves within a virtual machine. TODO: link to some VM solutions.

At the very least you should run the buildslave as a separate user (not root!). Slave passwords aren't stored in the git repo for security, you'll need to get Simon to add new ones.

The buildbot performs full build & test runs with all the options enabled. Please make sure you have all the necessary libraries installed on your system. You need to be able to complete a

autoconf -i
./configure --enable-e133 --enable-rdm-tests
make
make check

cycle before proceeding. If you have trouble ask on the mailing list.

Buildbot slaves need to connect to buildbot.openlighting.org:9989 . Make sure your firewall allows this. No port forwarding for inbound connections is required.

Debian / Ubuntu Instructions

This requires wheezy or later. For squeeze you can use the easy_install method below.

Build Slave Installation

 sudo apt-get install buildbot-slave

Slave Configuration

Create the slave:

 sudo -u buildbot buildslave create-slave --usepty=0 /var/lib/buildbot/slaves/ola buildbot.openlighting.org:9989 <slave user> <slave password>

Update the slave info, edit the files in /var/lib/buildbot/slaves/<slave name>/info to be relevant to you.

Add config for the slave into /etc/default/buildslave (you'll need to increase the array id if you've got more than one slave on the same host), e.g.:

SLAVE_ENABLED[1]=1                    # 1-enabled, 0-disabled
SLAVE_NAME[1]="ola"         # short name printed on start/stop
SLAVE_USER[1]="buildbot"              # user to run slave as
SLAVE_BASEDIR[1]="/var/lib/buildbot/slaves/<slave name>"                   # basedir to slave (absolute path)
SLAVE_OPTIONS[1]=""                   # buildbot options
SLAVE_PREFIXCMD[1]=""                 # prefix command, i.e. nice, linux32, dchroot

Start the slave

sudo /etc/init.d/buildslave start

Check the log if there are any issues, or confirm the slave is registered at http://buildbot.openlighting.org/buildslaves:

tail -f /var/lib/buildbot/slaves/ola/twistd.log


Other Platforms

Build Slave Installation

The easiest way to get started is by using easy_install. You need to have the Python headers available, so on Debian / Ubuntu run:

sudo apt-get install python-dev

Then install buildbot-slave:

easy_install buildbot-slave

Slave Configuration

Setup a new user:

sudo -s 
adduser ola-build-slave  # use a temp password for now
vi /etc/shadow  # delete the password entry

Setup the slave:

su ola-build-slave
cd ~
buildslave create-slave ola-slave buildbot.openlighting.org:9989 <slave user> <slave password>