From MozillaWiki
Jump to: navigation, search
Warning: This RelEng page is obsolete!
RelEng doesn't use BuildBot anymore.

What is it?

SlaveAPI is a service that is intended to be a single point of entry for all actions related to slaves. Clients interact with it through a simple REST API and it communicates with many other systems on the backend to fulfill the requests (eg, bugzilla, slavealloc, inventory) made.

Its source code lives on github.

Where is it?

SlaveAPI has both a dev and production instance. Each lives on its own machine within the RelEng network. Unless you're in the process of landing a patch to SlaveAPI, you should be using the production instance.

These machines are managed by PuppetAgain.


SlaveAPI depends on many Python packages to function correctly. Installing it through its will take care of pulling in everything you need.


Changes to SlaveAPI's config or credentials file should be done through Puppet. Both instances will pick up the changes and automatically reload the server.

Changes to SlaveAPI's code are a little trickier. SlaveAPI itself is deployed through pip by Puppet, so the first step is to upload a new version of SlaveAPI to PuppetAgain and update the version in the Puppet manifests. Once those are done the machine will automatically install the new version. However, the SlaveAPI service must be restarted to pick up the changes. You can do this by logging onto the machine and running the following:

sudo su - cltbld
cd /builds/slaveapi/dev (or prod)
source bin/activate stop slaveapi.ini && start slaveapi.ini

The manual restart will be done automatically once bug 924616 is fixed.

The full process looks like this:

# bump the package version like in
# note: package is versioned according to
$ vim slaveapi/
# get review, commit, push, then
$ python sdist
$ ls dist
$ scp slaveapi-1.0.19.tar.gz
$ ssh
$ mv -i slaveapi-1.0.19.tar.gz /data/python/packages/
$ puppetmaster-fixperms
# you should see the new package at 
# update slaveapi version in [puppet]/modules/slaveapi/manifests/instance.pp
$ vim modules/slaveapi/manifests/instance.pp
# get review, commit, push
# merge to puppet 'production' branch and push
# need to restart the production daemon
$ ssh <username> or <username>
$ sudo su - cltbld
$ cd /builds/slaveapi/prod or dev
# make sure the local package version has been upgraded by puppet before restarting the daemon
$ source bin/activate
$ pip freeze | grep slaveapi
$ stop slaveapi.ini && start slaveapi.ini

API Documentation

The details of the API are documented alongside the code, and an HTML version is available at