Statistics
| Branch: | Tag: | Revision:

root / docs / dev-guide.rst @ 3df48a3f

History | View | Annotate | Download (2.5 kB)

1
.. _dev-guide:
2

    
3
Synnefo Developer's Guide
4
^^^^^^^^^^^^^^^^^^^^^^^^^
5

    
6
This is the complete Synnefo Developer's Guide.
7

    
8
Environment set up
9
==================
10

    
11
First of all you have to set up a developing environment for Synnefo.
12

    
13
**1. Create a new VM**
14

    
15
It has been tested on Debian Wheezy. It is expected to work with other
16
releases (e.g., Squeeze) too, as long as they are supported by
17
``snf-deploy``.
18

    
19
**2. Build your own Synnefo installation**
20

    
21
Follow the instructions `here <http://www.synnefo.org/docs/synnefo/latest/quick-install-guide.html>`_
22
to build Synnefo on a single node using ``snf-deploy``.
23

    
24
**3. Install GitPython**
25

    
26
.. code-block:: console
27

    
28
   # pip install gitpython
29

    
30
**4. Install devflow**
31

    
32
Devflow is a tool to manage versions, helps implement the git flow development process,
33
and builds Python and Debian packages. You will need it to create your code's version.
34

    
35
.. code-block:: console
36

    
37
   # pip install devflow
38

    
39
**5. Get Synnefo code**
40

    
41
First you need to install git
42

    
43
.. code-block:: console
44

    
45
   # apt-get install git
46

    
47
And now get the Synnefo code from the official Synnefo repository
48

    
49
.. code-block:: console
50

    
51
   # su some_regular_user
52
   $ git clone https://code.grnet.gr/git/synnefo
53

    
54
Make sure you clone the repository as a regular user. Otherwise you will
55
have problems with file permissions when deploying.
56

    
57
**6. Code and deploy**
58

    
59
1. Configure the version
60

    
61
.. code-block:: console
62

    
63
   $ devflow-update-version
64

    
65
2. Code
66
3. In every component you change, run as root
67

    
68
.. code-block:: console
69

    
70
   # python setup.py develop -N
71

    
72
This does not automatically install dependencies, in order to avoid
73
confusion with synnefo packages installed by ``snf-deploy``. External
74
dependencies have already been installed by ``snf-deploy``; if you introduce
75
a new dependency, you will have to explicitly install it.
76

    
77
4. You will need to restart the server with
78

    
79
.. code-block:: console
80

    
81
   # service gunicorn restart
82

    
83
5. If your changes affected ``snf-dispatcher`` (from package
84
   ``snf-cyclades-app``) or ``snf-ganeti-eventd`` (from
85
   ``snf-cyclades-gtools``) you will need to restart these daemons, too.
86
   Since step 3 installed the former under ``/usr/local/``, you need to
87
   make sure that the correct version is evoked. You can override the
88
   version installed by ``snf-deploy`` with
89

    
90
.. code-block:: console
91

    
92
   # ln -sf /usr/local/bin/snf-dispatcher /usr/bin/snf-dispatcher
93

    
94
and then restart the daemons
95

    
96
.. code-block:: console
97

    
98
   # service snf-dispatcher restart
99
   # service snf-ganeti-eventd restart
100

    
101
6. Refresh the web page and see your changes