Remove unwanted spaces
[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 is 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 setuptools [http://pypi.python.org/pypi/setuptools]
16  * Python Dialog [http://pythondialog.sourceforge.net/]
17  * Python bindings for libguestfs [http://libguestfs.org/]
18  * Kamaki [https://code.grnet.gr/projects/kamaki]
19  * Python sh (previously pbs) [https://github.com/amoffat/sh]
20  * ANSI colors for Python [http://pypi.python.org/pypi/ansicolors]
21  * progress [http://pypi.python.org/pypi/progress]
22  * Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
23
24 The above dependencies are resolved differently, depending on the installation
25 method you choose.
26
27 There are two installation methods. The first uses official packages whereas
28 the second installs snf-image-creator and its dependencies from source. Both
29 methods are presented below.
30
31 Install snf-image-creator using official packages
32 =================================================
33
34 This method of installing snf-image-creator boasts all the advantages of
35 Ubuntu's APT installation:
36
37 * Automatic resolution of dependencies
38 * Simple installation of consequent updates
39
40 In order to proceed with the installation, you must first add GRNET's dev repo
41 to your sources. You can use the following commands:
42
43 .. code-block:: console
44
45    cd /etc/apt/sources.list.d
46    echo "deb http://apt.dev.grnet.gr precise main" | \
47    sudo tee -a  apt.dev.grnet.gr.list
48    echo "deb-src http://apt.dev.grnet.gr precise main" | \
49    sudo tee -a apt.dev.grnet.gr.list
50
51 You will also need to import the repo's GPG key. You can use the ``curl`` tool
52 for this.
53
54 .. code-block:: console
55
56    $ sudo apt-get install curl
57
58 Use the following command to import the GPG key:
59
60 .. code-block:: console
61
62    $ sudo curl https://dev.grnet.gr/files/apt-grnetdev.pub | sudo apt-key add -
63
64 You can verify that the repo has been added successfully if snf-image-creator
65 exists as a package. First do an update of your sources:
66
67 .. code-block:: console
68
69    $ sudo apt-get update
70
71 then check if snf-image-creator exists with the following command:
72
73 .. code-block:: console
74
75    $ apt-cache showpkg snf-image-creator
76
77 If GRNET's dev repo has been added successfully, you can install
78 snf-image-creator, along with its dependencies, with the following command:
79
80 .. code-block:: console
81
82    $ sudo apt-get install snf-image-creator
83
84 The installation might take a while. Please note that at some point during the
85 installation you will be prompted to create/update a "supermin appliance". This
86 is a setting regarding libguestfs and you can safely choose "Yes".
87
88 Install snf-image-creator from source
89 =====================================
90
91 This method provides you with the cutting edge of snf-image-creator, which
92 gives you access to all the latest features. Keep in mind, however,
93 that you may experience instability issues.
94
95 The first four dependencies (python2, setuptools, Python-Dialog, and
96 libguestfs) need to be installed manually by the user. In an Ubuntu 12.04 LTS
97 system this can be achieved by installing packages provided by the
98 distribution, using the following command:
99
100 .. code-block:: console
101
102    $ apt-get install python-setuptools python-guestfs python-dialog
103
104 The rest of the dependencies will be automatically resolved by setuptools.
105 Keep in mind though that git needs to be installed to download the source
106 files. You can use the following command:
107
108 .. code-block:: console
109
110    $ apt-get install git
111
112 Python Virtual Environment
113 --------------------------
114
115 Since snf-image-creator and the rest of it's dependencies won't be installed
116 using packages, it's better to work in an isolated python virtual environment
117 (virtualenv). Installing the Virtual Python Environment builder in Ubuntu can
118 be accomplished using the following command:
119
120 .. code-block:: console
121
122    $ apt-get install python-virtualenv
123
124 Now, create a new python virtual environment like this:
125
126 .. code-block:: console
127
128    $ virtualenv --system-site-packages ~/image-creator-env
129
130 and activate it by executing:
131
132 .. code-block:: console
133
134    $ source ~/image-creator-env/bin/activate
135
136 You can later deactivate it using the following command:
137
138 .. code-block:: console
139
140    $ deactivate
141
142 snf-common Installation
143 -----------------------
144
145 Install snf-common from source, by cloning it's repository:
146
147 .. code-block:: console
148
149    $ cd ~
150    $ git clone https://code.grnet.gr/git/synnefo
151    $ cd synnefo/snf-common
152    $ python setup.py build
153
154 Then, make sure you are within the activated virtual environment before you
155
156 .. code-block:: console
157
158    $ python setup.py install
159
160 kamaki Installation
161 -------------------
162
163 Install kamaki from source, by cloning it's repository:
164
165 .. code-block:: console
166
167    $ cd ~
168    $ git clone https://code.grnet.gr/git/kamaki
169    $ cd kamaki
170    $ ./setup.py build
171
172 As above, make sure you are within the activated virtual environment before you
173 execute:
174
175 .. code-block:: console
176
177    $ ./setup.py install
178
179 snf-image-creator Installation
180 ------------------------------
181
182 Install snf-image-creator the same way:
183
184 .. code-block:: console
185
186    $ cd ~
187    $ git clone https://code.grnet.gr/git/snf-image-creator
188    $ git checkout stable-0.1
189    $ cd snf-image-creator
190    $ ./setup.py build
191
192 And from within the virtual environment execute:
193
194 .. code-block:: console
195
196    $ ./setup.py install
197