Setting up a development buildservice instance

Posted by – 9. September 2009

This article explains how to setup all parts of the openSUSE buildservice.
It will describe the needed steps to get it running with the latest sourcecode from svn, ready to use it and develop it.

If you just want to use the buildservice and are not interested in the latest code and it’s development, it is recommended to simply use the openSUSE instance, or install it from
rpm (howto).

The buildservice consists of various parts, mainly the backend, the frontend (API), and different clients that connect to the API, we will set it up with the webclient.

At first we need to check out the buildservice code:

svn co


Setting up the backend:

We need to initialize the config file, add a buildservice user, and create the working directories:

cd src/backend
sudo useradd obsrun -s /bin/false
sudo /usr/sbin/groupadd obsrun

sudo mkdir -p /srv/obs/run /srv/obs/projects
sudo chown -R obsrun /srv/obs/

This needs to be done as root or with sudo rights. To change the default directory or the user edit the file.

Now we are ready to start the servers. You should start each one in it’s own terminal to see the logfiles.

sudo ./bs_srcserver
sudo ./bs_repserver
sudo ./bs_dispatch
sudo mkdir /tmp/state
sudo ./bs_worker --root /tmp/build --statedir /tmp/state

Setting up the frontend (API):

We can create a config file for the development machine, so we don’t have to change the original one:

cd frontend; pushd config/environments;
cp development_base.rb development.`hostname`.rb;

Now we need to set up a database for the frontend, simply configure a database user in config/database.yml, crete the database and run:

rake db:migrate

now the database should be correctly initialized. Starting the API server with:

./script/server -p3001

makes it available at: Using a browser on this address you can change some administrative stuff. The pre-configured admin user has the credentials: Admin:opensuse

The API documentation is now available here:

This API can now be used by different clients, or standard tools like curl (howto).

Setting up the webclient:

Setting up the weblient for usage with the API is very easy, and explained in the wiki.

To use it with our local frontend, we just need to change some config values:

cd webclient; pushd config/environments/;
cp development_base.rb development.`hostname`.rb;

and set:

FRONTEND_HOST = "localhost"
Let’s start it on default port 3000 with:


Link your instance to the buildservice

As our backend does not yet have any repositories we could build packages against, the easiest way to get started is to link it against the openSUSE buildservice, so we are able to build against all repositories from there. This is unfortunately not yet possible from the admin interface, so we have to use the API directly with curl:

curl -u Admin:opensuse -T opensuse_link

with opensuse_link being a file with this content: 

<project name="" >
<title> build link</title>
<description>Build against projects from</description>
The linked project shown in the webclient


Now I want to create a project that builds against this repository, and build a package inside of it to show that everything is really working. For that, we create a home project for the admin user by clicking on „Home Project“.

We need to use curl again to add a repository from the linked buildservice as a build target:

curl -u Admin:opensuse -T _meta

with _meta being a file with this content: 

<project name="home:Admin">
  <title>Admin's Home Project</title>
  <repository name="openSUSE_11.1">
  <path project="" repository="standard"/>
  <person role="maintainer" userid="Admin"/>
  <person role="bugowner" userid="Admin"/>


The project is now ready to build packages against the openSUSE 11.1 repository from the linked buildservice. We could now create new packages and upload the sources and .spec files, but I will just link a package from the openSUSE buildservice to build it unchanged.


YAY! After some time we can see that the first package was build by our local buildservice and the RPMs are ready!

Did you get interested in buildservice development, or did you run into some limitations that you want to fix? There also is a wiki page at: that lists some tasks that can be done.


The buildservice community can be found on irc at #opensuse-buildservice at freenode, and on (subscribe).


Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.