ReleaseEngineering/Applications: Difference between revisions

Jump to navigation Jump to search
Line 35: Line 35:


= slavealloc =
= slavealloc =
(still being deployed .. so at the moment all of this is future)
(still being deployed .. so at the moment much of this is future)
== Application Description ==
== Application Description ==
Slavealloc is a client-server application.  The client is [http://hg.mozilla.org/build/puppet-manifests/file/tip/modules/buildslave/files/runslave.py runslave.py].  Communication is via a very basic HTTP request to http://slavealloc.build.mozilla.org/production/gettac/$slavename, where the response is expected to be a <tt>buildbot.tac</tt> file suitable for use to start buildslave.
Slavealloc is a client-server application.  The client is [http://hg.mozilla.org/build/puppet-manifests/file/tip/modules/buildslave/files/runslave.py runslave.py].  Communication is via a very basic HTTP request to http://slavealloc.build.mozilla.org/production/gettac/$slavename, where the response is expected to be a <tt>buildbot.tac</tt> file suitable for use to start buildslave.


The slavealloc server is a implemented as a small Twisted application ([http://hg.mozilla.org/build/tools/file/tip/slavealloc source]) which serves the tac generator, a JSON REST interface, and a client-side JavaScript interface.
The slavealloc server is a implemented as a small Twisted application ([http://hg.mozilla.org/build/tools/file/tip/lib/python/slavealloc source]) which serves the tac generator, a JSON REST interface, and a client-side JavaScript interface.


The same source code also implements a command-line frontend to the REST interface.
The same source code also implements a command-line frontend to the REST interface.
Line 58: Line 58:
The 'slavealloc' user runs the twisted daemon on this host.  The user account is locked and accessed only via su from root.
The 'slavealloc' user runs the twisted daemon on this host.  The user account is locked and accessed only via su from root.


The daemon is installed in a virtualenv at <tt>/tools/slavealloc-$rev</tt>, using the pre-checked python packages on the puppet server:
The daemon is installed in a virtualenv at <tt>/tools/slavealloc-$rev</tt>, using the pre-checked python packages on the puppet server.  Note that <tt>--no-site-packages</tt> is ''not'' used here, because we need access to the (binary) MySQL-python package which is installed systemwide:
  cd /tools
  cd /tools
  virtualenv --no-site-packages slavealloc-8fe4dbc09d03
  virtualenv slavealloc-8fe4dbc09d03
ln -s slavealloc-8fe4dbc09d03 slavealloc
  /slavealloc-8fe4dbc09d03/bin/pip install -e hg+http://hg.mozilla.org/build/tools@8fe4dbc09d03#egg=tools \
  /slavealloc-8fe4dbc09d03/bin/pip install -e hg+http://hg.mozilla.org/build/tools@8fe4dbc09d03#egg=tools \
     --no-index --find-links=http://staging-puppet.build.mozilla.org/staging/python-packages/
     --no-index --find-links=http://staging-puppet.build.mozilla.org/staging/python-packages/
Once this was set up, the 'slavealloc dbinit' command was used to initialize the database.
The production and staging tac files are in <tt>/build/slavealloc</tt>.  Staging runs on port 1079, and production runs on 1080.
TODO (temp)
* initscript
* nginx
* set up production


== External Resources ==
== External Resources ==
Line 78: Line 88:
Note that due to what I believe to be a bug in pip, you may need to explicitly install Twisted to get the twistd executable installed:
Note that due to what I believe to be a bug in pip, you may need to explicitly install Twisted to get the twistd executable installed:
  pip install -U twisted
  pip install -U twisted
 
To set up a fresh database, use
sandbox/bin/slavealloc dbinit -D sqlite:///slavealloc.db
This configuration will use SQLite to access {{{slavealloc.db}}} in the current directory.  You can hack on the static web content while the daemon is running.
This configuration will use SQLite to access {{{slavealloc.db}}} in the current directory.  You can hack on the static web content while the daemon is running.


canmove, Confirmed users
1,394

edits

Navigation menu