Statistics
| Branch: | Tag: | Revision:

root / docs / installation.rst @ fa479dc3

History | View | Annotate | Download (6 kB)

1
Installation
2
============
3

    
4
This guide describes the standard installation process for kamaki, with the
5
aspiration of covering as much cases as possible. Although kamaki was initially
6
targeted to Linux/Unix-like users, it is quite straightforward to install and
7
have it up and running in all platforms running python 2.6 or 2.7.
8

    
9

    
10
* Kamaki repository: `http://code.grnet.gr/git/kamaki <http://code.grnet.gr/git/kamaki>`_
11

    
12
* Kamaki at pypi: `http://pypi.python.org/pypi/kamaki <https://pypi.python.org/pypi/kamaki>`_
13

    
14
* Synnefo Linux packages: `http://apt.dev.grnet.gr <http://apt.dev.grnet.gr>`_
15

    
16
Linux and Unix-like enviroments
17
-------------------------------
18

    
19
Debian:
20
^^^^^^^
21

    
22
The following steps describe a command-line approach, but any graphic package manager can be used instead.
23

    
24
* As root, append the following to */etc/apt/sources.list* ::
25

    
26
    deb http://apt.dev.grnet.gr wheezy/
27

    
28
.. warning:: Debian Squeeze users may replace "wheezy" with "squeeze"
29

    
30
* Make sure the GPG public key for the Synnefo development team is added:
31

    
32
    .. code-block:: console
33

    
34
        $ sudo curl https://dev.grnet.gr/files/apt-grnetdev.pub|apt-key add -
35

    
36
    otherwise *apt-get update* will produce GPG warnings.
37

    
38
* Update the Debian sources:
39

    
40
    .. code-block:: console
41

    
42
        $ sudo apt-get update
43

    
44
* Install kamaki:
45

    
46
    .. code-block:: console
47

    
48
        $ sudo apt-get install kamaki
49

    
50
Ubuntu
51
^^^^^^
52

    
53
The following steps describe a command-line approach, but any graphic package manager can be used instead.
54

    
55
* Let ppa take care of the repository configuration:
56

    
57
    .. code-block:: console
58

    
59
        $ sudo apt-get install python-software-properties
60
        $ sudo add-apt-repository ppa:grnet/synnefo
61

    
62
* Update the Debian sources:
63

    
64
    .. code-block:: console
65

    
66
        $ sudo apt-get update
67

    
68
* Install kamaki:
69

    
70
    .. code-block:: console
71

    
72
        $ sudo apt-get install kamaki
73

    
74
Install ansicolors (optional but recommended)
75
"""""""""""""""""""""""""""""""""""""""""""""
76

    
77
.. code-block:: console
78

    
79
    $ sudo apt-get install python-ansicolors
80

    
81
Install mock (for developers only)
82
""""""""""""""""""""""""""""""""""
83

    
84
.. code-block:: console
85

    
86
    $ sudo apt-get install python-mock
87

    
88
.. warning:: kamaki.clients unit-tests need python-mock 1.X or better. e.g.::
89

    
90
    $ sudo apt-get install python-mock=1.0.1
91

    
92
.. _installing-from-pypi-ref:
93

    
94
Installing from pypi
95
^^^^^^^^^^^^^^^^^^^^
96

    
97
Requirements
98
""""""""""""
99

    
100
Essential:
101

    
102
 * Python 2.6 or 2.7 [http://www.python.org]
103
 * Python setuptools [http://pypi.python.org/pypi/setuptools]
104

    
105
Optional:
106

    
107
 * VirtualEnv (python-virtualenv) [http://www.virtualenv.org]
108

    
109
Setup a virtual enviroment (optional)
110
"""""""""""""""""""""""""""""""""""""
111

    
112
With virtualenv users can setup kamaki and synnefo services in a sandbox
113
environment.
114

    
115
.. code-block:: console
116

    
117
    $ virtualenv kamaki-env
118
    $ source kamaki-env/bin/activate
119

    
120
A more detailed example of using virtual env can be found at the 
121
`snf-image-creator setup guide <http://www.synnefo.org/docs/snf-image-creator/latest/install.html#python-virtual-environment>`_
122

    
123
Install kamaki
124
""""""""""""""
125

    
126
.. code-block:: console
127

    
128
    $ pip install kamaki
129

    
130
Install ansicolors (optional)
131
"""""""""""""""""""""""""""""
132

    
133
The **ansicolors** package is not required for running kamaki, but it is
134
recommended as a user experience improvement. In specific, ansicolors
135
adds colors to kamaki responses.
136

    
137
.. code-block:: console
138

    
139
    $ pip install ansicolors
140

    
141
Install mock (developers only)
142
""""""""""""""""""""""""""""""
143

    
144
The **mock** package is needed for running the prepared unit-tests in the
145
kamaki.clients package. This feature is useful when extending / debugging
146
kamaki functionality and is aimed to kamaki developers and contributors.
147
Therefore, users can enjoy the full kamaki user experience without installing
148
mock.
149

    
150
.. code-block:: console
151

    
152
    $ pip install mock
153

    
154
.. warning:: mock version >= 1.X
155

    
156
Mac OS X
157
--------
158

    
159
Kamaki can be installed on Mac OS X systems from source, by following the steps
160
at :ref:`installing-from-pypi-ref`.
161

    
162
Windows
163
-------
164

    
165
Kamaki can be installed on Windows by following the pypi method. Installing the
166
requirements is a bit different than in other systems. 
167

    
168
The full process is detailed in the following:
169

    
170
Requirements
171
^^^^^^^^^^^^
172

    
173
* Python 2.7 or better (`Official versions <http://www.python.org/getit>`_)
174

    
175
* Setuptools (`Official versions and workarounds <http://pypi.python.org/pypi/setuptools>`_)
176

    
177
Users who have already set up and wokring python and setuptools (e.g. for
178
another project) may skip python and / or setup tools installation.
179

    
180
Install python
181
^^^^^^^^^^^^^^
182

    
183
Download and run the Windows installer from
184
`here <http://www.python.org/getit>`_
185

    
186
Users should pick the installer that fits their windows version and machine
187
architecture.
188

    
189
Add python to windows path
190
^^^^^^^^^^^^^^^^^^^^^^^^^^
191

    
192
The following will allow users to run python and python scripts from command
193
line.
194

    
195
* Select **System** from the Control Panel, select the **Advanced** tab, the
196
    **Environment Variables** button and then find the **PATH** (user or
197
    system) and **edit**
198

    
199
* Without removing existing values, append the following to PATH::
200

    
201
    ;C:\Python27;C:\Python27\Scripts
202

    
203
.. note:: Path values are separated by semicolons
204

    
205
.. warning:: In case of a different version, C:\\Python27 should be replaced
206
    with the actual python path in the system
207

    
208
Install setuptools
209
^^^^^^^^^^^^^^^^^^
210

    
211
According to the corresponding
212
`python org page <http://pypi.python.org/pypi/setuptools>`_, the setuptools
213
installer doesn't currently work on 64bit machines.
214

    
215
* Users with 32-bit operating systems should download and run the graphic
216
    installer
217

    
218
* Users with 64-bit machines should download the
219
    `ez_setup.py <http://peak.telecommunity.com/dist/ez_setup.py>`_ script and
220
    install it from a command shell. In the following example, the script was
221
    downloaded at C:\\Downloads::
222

    
223
        C:\> cd Downloads
224
        C:\Downloads\> python ez_setup.py
225
        ...
226
        Installation finished
227
        C:\Downloads\>
228

    
229
Install kamaki
230
^^^^^^^^^^^^^^
231

    
232
.. code-block:: console
233

    
234
    $ easy_install kamaki