Confirmed users
211
edits
(Created page with "= 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...") |
(Marking this page obsolete) |
||
(11 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
= What is it? | {{Obsolete RelEng Page|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. | 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 [ | Its source code lives on [https://github.com/mozilla/build-slaveapi github]. | ||
= Where is it? = | = Where is it? = | ||
SlaveAPI has both a [http://slaveapi-dev1.srv.releng.scl3.mozilla.com: | SlaveAPI has both a [http://slaveapi-dev1.srv.releng.scl3.mozilla.com:8080 dev] and [https://secure.pub.build.mozilla.org/slaveapi 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. | |||
= Requirements/dependencies = | = Requirements/dependencies = | ||
Line 11: | Line 15: | ||
= Deployment = | = Deployment = | ||
{{Release Engineering Deployment|slaveapi}} | |||
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 config or credentials file should be done through Puppet. Both instances will pick up the changes and automatically reload the server. | ||
Line 16: | Line 21: | ||
sudo su - cltbld | sudo su - cltbld | ||
cd /builds/slaveapi/dev (or prod) | cd /builds/slaveapi/dev (or prod) | ||
source bin/activate | |||
slaveapi-server.py stop slaveapi.ini && slaveapi-server.py start slaveapi.ini | slaveapi-server.py stop slaveapi.ini && slaveapi-server.py start slaveapi.ini | ||
The manual restart will be done automatically once {{bug|924616}} is fixed. | The manual restart will be done automatically once {{bug|924616}} is fixed. | ||
The full process looks like this: | |||
# bump the package version like in https://github.com/mozilla/build-slaveapi/commit/60d25601e0783bbfb9d5959c4092693fdb026321 | |||
# note: package is versioned according to http://semver.org/ | |||
$ vim slaveapi/__init__.py | |||
# get review, commit, push, then | |||
$ python setup.py sdist | |||
$ ls dist | |||
slaveapi-1.0.19.tar.gz | |||
$ scp slaveapi-1.0.19.tar.gz root@releng-puppet2.srv.releng.scl3.mozilla.com: | |||
$ ssh root@releng-puppet2.srv.releng.scl3.mozilla.com | |||
$ mv -i slaveapi-1.0.19.tar.gz /data/python/packages/ | |||
$ puppetmaster-fixperms | |||
# you should see the new package at http://puppetagain.pub.build.mozilla.org/data/python/packages/ | |||
# 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>@slaveapi1.build.mozilla.org or <username>slaveapi-dev1.srv.releng.scl3.mozilla.com | |||
$ 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 | |||
slaveapi==1.0.19 | |||
$ slaveapi-server.py stop slaveapi.ini && slaveapi-server.py start slaveapi.ini | |||
= API Documentation = | = API Documentation = | ||
The details of the API are documented alongside the code, and an HTML version [http://mozilla-slaveapi.readthedocs.org/en/latest/ is available at mozilla-slaveapi.readthedocs.org]. |