Statistics
| Branch: | Tag: | Revision:

root / docs / installation.rst @ 16d7b9ff

History | View | Annotate | Download (6.3 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 environments
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 repository 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
54
manager can be used instead.
55

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

    
58
    .. code-block:: console
59

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

    
63
* Update the Debian sources:
64

    
65
    .. code-block:: console
66

    
67
        $ sudo apt-get update
68

    
69
* Install kamaki:
70

    
71
    .. code-block:: console
72

    
73
        $ sudo apt-get install kamaki
74

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

    
78
.. code-block:: console
79

    
80
    $ sudo apt-get install python-ansicolors
81

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

    
85
.. code-block:: console
86

    
87
    $ sudo apt-get install python-mock
88

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

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

    
93
.. hint:: To activate functional tests in kamaki enable the preconfigured
94
    *livetest* command group:
95

    
96
    .. code-block:: console
97

    
98
        $ kamaki config set livetest_cli livetest
99

    
100

    
101
.. _installing-from-pypi-ref:
102

    
103
Installing from pypi
104
^^^^^^^^^^^^^^^^^^^^
105

    
106
Requirements
107
""""""""""""
108

    
109
Essential:
110

    
111
 * Python 2.6 or 2.7 [http://www.python.org]
112
 * Python setuptools [http://pypi.python.org/pypi/setuptools]
113

    
114
Optional:
115

    
116
 * VirtualEnv (python-virtualenv) [http://www.virtualenv.org]
117

    
118
Setup a virtual enviroment (optional)
119
"""""""""""""""""""""""""""""""""""""
120

    
121
Use virtualenv to setup kamaki and Synnefo services in a sandbox environment.
122

    
123
.. code-block:: console
124

    
125
    $ virtualenv kamaki-env
126
    $ source kamaki-env/bin/activate
127

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

    
131
Install kamaki
132
""""""""""""""
133

    
134
.. code-block:: console
135

    
136
    $ pip install kamaki
137

    
138
Install ansicolors
139
""""""""""""""""""
140

    
141
The **ansicolors** package is not required for running kamaki, but it is
142
recommended as a user experience improvement. In specific, ansicolors
143
adds colors to kamaki responses.
144

    
145
.. code-block:: console
146

    
147
    $ pip install ansicolors
148

    
149
Install mock (developers only)
150
""""""""""""""""""""""""""""""
151

    
152
The **mock** package is needed for running the prepared unit-tests in the
153
kamaki.clients package. This feature is useful when extending / debugging
154
kamaki functionality and is aimed to kamaki developers and contributors.
155
Therefore, users can enjoy the full kamaki user experience without installing
156
mock.
157

    
158
.. code-block:: console
159

    
160
    $ pip install mock
161

    
162
.. warning:: mock version >= 1.X
163

    
164
.. hint:: To activate functional tests in kamaki. enable the preconfigured
165
    *livetest* command group:
166

    
167
    .. code-block:: console
168

    
169
        $ kamaki config set livetest_cli livetest
170

    
171

    
172
Mac OS X
173
--------
174

    
175
Kamaki can be installed on Mac OS X systems, by following the steps
176
at :ref:`installing-from-pypi-ref`.
177

    
178
Windows
179
-------
180

    
181
Kamaki can be installed on Windows by following the pypi method. Installing the
182
requirements is a bit different than in other systems. 
183

    
184
The full process is detailed in the following:
185

    
186
Requirements
187
^^^^^^^^^^^^
188

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

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

    
193
Users who have already set up python and setuptools (e.g., for
194
another project) may skip Python and / or setuptools installation.
195

    
196
Install Python
197
^^^^^^^^^^^^^^
198

    
199
Download and run the Windows installer from
200
`here <http://www.python.org/getit>`_
201

    
202
Users should pick the installer that fits their windows version and machine
203
architecture.
204

    
205
Add Python to windows path
206
^^^^^^^^^^^^^^^^^^^^^^^^^^
207

    
208
The following will allow users to run Python and Python scripts from command
209
line.
210

    
211
* Select **System** from the Control Panel, select the **Advanced** tab, the
212
    **Environment Variables** button and then find the **PATH** (user or
213
    system) and **edit**
214

    
215
* Without removing existing values, append the following to PATH::
216

    
217
    ;C:\Python27;C:\Python27\Scripts
218

    
219
.. note:: Path values are separated by semicolons
220

    
221
.. warning:: In case of a different version, C:\\Python27 should be replaced
222
    with the actual python path in the system
223

    
224
Install setuptools
225
^^^^^^^^^^^^^^^^^^
226

    
227
According to the corresponding
228
`python org page <http://pypi.python.org/pypi/setuptools>`_, the setuptools
229
installer doesn't currently work on 64bit machines.
230

    
231
* Users with 32-bit platforms should download and run the graphic
232
    installer
233

    
234
* Users with 64-bit platforms should download the
235
    `ez_setup.py <http://peak.telecommunity.com/dist/ez_setup.py>`_ script and
236
    install it from a command shell. In the following example, the script was
237
    downloaded at C:\\Downloads::
238

    
239
        C:\> cd Downloads
240
        C:\Downloads\> python ez_setup.py
241
        ...
242
        Installation finished
243
        C:\Downloads\>
244

    
245
Install kamaki
246
^^^^^^^^^^^^^^
247

    
248
.. code-block:: console
249

    
250
    $ easy_install kamaki