[docs] Moved nailgun development instructions

This commit is contained in:
Mike Scherbakov 2013-07-13 19:06:17 +04:00
parent eb84a1fc60
commit fb12115044
3 changed files with 60 additions and 9 deletions

View File

@ -5,4 +5,5 @@ Nailgun
.. toctree::
develop/nailgun/reliability
nailgun/development
nailgun/reliability

View File

@ -0,0 +1,45 @@
Nailgun Development Instructions
================================
Prepare environment
-------------------
All our development is commonly done on Ubuntu 12. Follow the steps to prepare an environment:
#. Install and configure Postgres DB::
sudo apt-get install postgresql
sudo -u postgres createuser -D -A -P nailgun (enter password nailgun)
sudo -u postgres createdb nailgun
sudo apt-get install postgresql-server-dev-9.1 python-dev
sudo pip install psycopg2
#. Install python dependencies (cobbler can't be installed from pypi)::
sudo pip install -r requirements-eggs.txt
sudo pip install PyYAML
git clone git://github.com/cobbler/cobbler.git
cd cobbler
git checkout release24
sudo make install
#. SyncDB::
cd nailgun
./manage.py syncdb
./manage.py loaddefault # It loads all basic fixtures listed in settings.yaml, such as admin_network, startup_notification and so on
./manage.py loaddata nailgun/fixtures/sample_environment.json # Loads fake nodes
#. Create required folder for log files::
sudo mkdir /var/log/nailgun
sudo chown -R `whoami`.`whoami` /var/log/nailgun
#. Start application in "fake" mode, when no real calls to orchestrator are performed::
python manage.py run -p 8000 --fake-tasks | grep --line-buffered -v -e HTTP -e '^$' >> /var/log/nailgun.log 2>&1 &
#. (optional) You can also use --fake-tasks-amqp option if you want to make fake environment use real RabbitMQ instead of fake one::
python manage.py run -p 8000 --fake-tasks-amqp | grep --line-buffered -v -e HTTP -e '^$' >> /var/log/nailgun.log 2>&1 &

View File

@ -27,9 +27,11 @@ GET request on that node would return 500 Internal Server Error.
Looks like it should affect the only one node, and logically we could remove such
failing node from the environment to get it discovered again.
However, UI + API handlers were written in the following way:
- UI calls /api/nodes to fetch info about all nodes to just show how many nodes are
allocated, and how many are not
- NodesCollectionHandler would return 500 if any of nodes raise an exception
* UI calls /api/nodes to fetch info about all nodes to just show how many nodes are allocated, and how many are not
* NodesCollectionHandler would return 500 if any of nodes raise an exception
It is simple to guess, that the whole UI was completely destroyed by just one
failed node. It was impossible to do any action on UI.
@ -37,11 +39,14 @@ These two examples give us the starting point to rethink on how to avoid
Nailgun crash just if one of the meta attr is wrong.
First, we must devide the meta attributes discovered by agent on two categories:
- absolutely required for node discovering (i.e. MAC address)
- non-required for discovering
- required for deployment (i.e. disks)
- non-required for deployment (i.e. current_speed)
(additional division?)
* absolutely required for node discovering (i.e. MAC address)
* non-required for discovering
* required for deployment (i.e. disks)
* non-required for deployment (i.e. current_speed)
Second, we must have UI refactored to fetch only the information required,
not the whole DB to just show two numbers. To be more specific,