4 .. highlight:: shell-example
9 Most dependencies from :doc:`install-quick`, plus (for Python):
11 - `GNU make <http://www.gnu.org/software/make/>`_
12 - `GNU tar <http://www.gnu.org/software/tar/>`_
13 - `Gzip <http://www.gnu.org/software/gzip/>`_
14 - `pandoc <http://johnmacfarlane.net/pandoc/>`_
15 - `python-sphinx <http://sphinx.pocoo.org/>`_
16 (tested with version 0.6.1)
17 - `graphviz <http://www.graphviz.org/>`_
18 - the `en_US.UTF-8` locale must be enabled on the system
19 - `pylint <http://www.logilab.org/857>`_ and its associated
21 - `pep8 <https://github.com/jcrocholl/pep8/>`_
23 Note that for pylint, at the current moment the following versions
28 astng 0.20.1, common 0.50.3
30 To generate unittest coverage reports (``make coverage``), `coverage
31 <http://pypi.python.org/pypi/coverage>`_ needs to be installed.
33 For Haskell development, again all things from the quick install
36 - `haddock <http://www.haskell.org/haddock/>`_, documentation
37 generator (equivalent to epydoc for Python)
38 - `HsColour <http://hackage.haskell.org/package/hscolour>`_, again
39 used for documentation (it's source-code pretty-printing)
40 - `hlint <http://community.haskell.org/~ndm/hlint/>`_, a source code
41 linter (equivalent to pylint for Python), recommended version 1.8 or
42 above (tested with 1.8.15)
43 - the `QuickCheck <http://hackage.haskell.org/package/QuickCheck>`_
45 - ``hpc``, which comes with the compiler, so you should already have
47 - `shelltestrunner <http://joyful.com/shelltestrunner>`_, used for
50 Under Debian Wheezy or later, these can be installed (on top of the
51 required ones from the quick install document) via::
53 $ apt-get install libghc-quickcheck2-dev hscolour hlint
55 Or alternatively via ``cabal``::
57 $ cabal install quickcheck hscolour hlint shelltestrunner
60 Configuring for development
61 ---------------------------
63 Run the following command (only use ``PYTHON=...`` if you need to use a
64 different python version)::
67 ./configure --prefix=/usr/local --sysconfdir=/etc --localstatedir=/var
69 Note that doing development on a machine which already has Ganeti
70 installed is problematic, as ``PYTHONPATH`` behaviour can be confusing
71 (see Issue 170 for a bit of history/details; in general it works if
72 the installed and developed versions are very similar, and/or if
73 PYTHONPATH is customised correctly). As such, in general it's
74 recommended to use a "clean" machine for ganeti development.
76 Haskell development notes
77 -------------------------
79 There are a few things which can help writing or debugging the Haskell
82 You can run the Haskell linter :command:`hlint` via::
86 This is not enabled by default (as the htools component is
87 optional). The above command will generate both output on the terminal
88 and, if any warnings are found, also an HTML report at
91 When writing or debugging TemplateHaskell code, it's useful to see
92 what the splices are converted to. This can be done via::
94 $ make HEXTRA="-ddump-splices"
96 Due to the way TemplateHaskell works, it's not straightforward to
97 build profiling code. The recommended way is to run ``make hs-prof``,
98 or alternatively the manual sequence is::
101 $ make htools/htools HEXTRA="-osuf .o"
103 $ make htools/htools HEXTRA="-osuf .prof_o -prof -auto-all"
105 This will build the binary twice, per the TemplateHaskell
106 documentation, the second one with profiling enabled.
112 Ganeti is mostly developed and tested on `Debian
113 <http://www.debian.org/>`_-based distributions, while still keeping
114 adaptability to other Linux distributions in mind.
116 The ``doc/examples/`` directory contains a number of potentially useful
117 scripts and configuration files. Some of them might need adjustment
123 This script, in the source code as ``daemons/daemon-util.in``, is used
124 to start/stop Ganeti and do a few other things related to system
125 daemons. It is recommended to use ``daemon-util`` also from the system's
126 init scripts. That way the code starting and stopping daemons is shared
127 and future changes have to be made in only one place.
129 ``daemon-util`` reads extra arguments from variables (``*_ARGS``) in
130 ``/etc/default/ganeti``. When modifying ``daemon-util``, keep in mind to
131 not remove support for the ``EXTRA_*_ARGS`` variables for starting
132 daemons. Some parts of Ganeti use them to pass additional arguments when
135 The ``reload_ssh_keys`` function can be adjusted to use another command
136 for reloading the OpenSSH daemon's host keys.
138 .. vim: set textwidth=72 :