Bring installation instructions up-to-date
[snf-image-creator] / docs / install.rst
1 Installation
2 ^^^^^^^^^^^^
3
4 This guide describes how to install snf-image-creator on an Ubuntu 12.04 LTS
5 system. It it highly recommended to have virtualization capable hardware.
6 snf-image-creator will work on processors that do not support virtualization
7 but it will be extremely slow.
8
9 Dependencies
10 ============
11
12 snf-image-creator depends on the following programs:
13
14  * Python 2 [http://www.python.org/]
15  * Python development headers
16  * Python setuptools [http://pypi.python.org/pypi/setuptools]
17  * Python Dialog [http://pythondialog.sourceforge.net/]
18  * Python gevent library [http://pypi.python.org/pypi/gevent]
19  * Python bindings for libguestfs [http://libguestfs.org/]
20  * Kamaki [https://code.grnet.gr/projects/kamaki]
21  * Python sh (previously pbs) [https://github.com/amoffat/sh]
22  * ANSI colors for Python [http://pypi.python.org/pypi/ansicolors]
23  * progress [http://pypi.python.org/pypi/progress]
24  * Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
25
26 The first six programs (python2, python-dev, setuptools, Python-Dialog, 
27 python-gevent and libguestfs) need to be installed manually by the user. In an
28 Ubuntu 12.04 LTS system this can be achieved by installing packages provided by
29 the distribution, using the following command:
30
31 .. code-block:: console
32
33    $ apt-get install python-setuptools python-guestfs python-dialog \
34      python-gevent python-dev
35
36 The rest of the dependencies will be automatically resolved by setuptools.
37 Keep in mind though that git needs to be installed to download the source 
38 files. You can use the following command:
39
40 .. code-block:: console
41
42    $ apt-get install git
43  
44 Python Virtual Environment
45 ==========================
46
47 Since snf-image-creator and the rest of it's dependencies won't be installed
48 using packages, it's better to work in an isolated python virtual environment
49 (virtualenv). Installing the Virtual Python Environment builder in Ubuntu can
50 be accomplished using the following command:
51
52 .. code-block:: console
53
54    $ apt-get install python-virtualenv
55
56 Now, create a new python virtual environment like this:
57
58 .. code-block:: console
59
60    $ virtualenv --system-site-packages ~/image-creator-env
61
62 and activate it by executing:
63
64 .. code-block:: console
65
66    $ source ~/image-creator-env/bin/activate
67
68 You can later deactivate it using the following command:
69
70 .. code-block:: console
71
72    $ deactivate
73
74
75 snf-common Installation
76 =======================
77
78 Install snf-common from source, by cloning it's repository:
79
80 .. code-block:: console
81    
82    $ cd ~
83    $ git clone https://code.grnet.gr/git/synnefo
84    $ cd synnefo/snf-common
85    $ python setup.py build
86
87 Then, make sure you are within the activated virtual environment before you
88
89 .. code-block:: console
90
91    $ python setup.py install
92
93 kamaki Installation
94 ===================
95
96 Install kamaki from source, by cloning it's repository:
97
98 .. code-block:: console
99
100    $ cd ~
101    $ git clone https://code.grnet.gr/git/kamaki
102    $ cd kamaki
103    $ ./setup.py build
104
105 As above, make sure you are within the activated virtual environment before you
106 execute:
107
108 .. code-block:: console
109
110    $ ./setup.py install
111
112 snf-image-creator Installation
113 ==============================
114
115 Install snf-image-creator the same way:
116
117 .. code-block:: console
118
119    $ cd ~
120    $ git clone https://code.grnet.gr/git/snf-image-creator
121    $ git checkout stable-0.1
122    $ cd snf-image-creator
123    $ ./setup.py build
124
125 And from within the virtual environment execute:
126
127 .. code-block:: console
128
129    $ ./setup.py install