59665c429340e5c67af00bf7aac0de79c22a5c1d
[snf-image-creator] / docs / install.rst
1 Installation
2 ^^^^^^^^^^^^
3
4 This guide describes how to install snf-image-creator on a Linux system. It is
5 highly recommended to have virtualization capable hardware. snf-image-creator
6 will work on processors that do not support virtualization but it will be slow.
7
8 Dependencies
9 ============
10
11 snf-image-creator depends on the following programs:
12
13  * Python 2 [http://www.python.org/]
14  * Python setuptools [http://pypi.python.org/pypi/setuptools]
15  * Python Dialog [http://pythondialog.sourceforge.net/]
16  * Python bindings for libguestfs [http://libguestfs.org/]
17  * Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
18  * pyparted [https://fedorahosted.org/pyparted/]
19  * rsync [http://rsync.samba.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
25 The above dependencies are resolved differently, depending on the installation
26 method you choose. There are two installation methods available:
27
28 #. `Installation using packages <#install-snf-image-creator-using-packages>`_
29
30 #. `Installation from source <#install-snf-image-creator-from-source>`_
31
32 Install snf-image-creator using packages
33 ========================================
34
35 Debian
36 ------
37
38 For *Debian 7.0 (wheezy)* you can use our official packages found in our
39 development repository.
40
41 Add the following line to */etc/apt/sources.list*:
42
43 .. code-block:: console
44
45    deb http://apt.dev.grnet.gr wheezy/
46
47 And resynchronize the package index files from their sources:
48
49 .. code-block:: console
50
51    $ sudo apt-get update
52
53 You should be able to list the package by calling:
54
55 .. code-block:: console
56
57    $ apt-cache showpkg snf-image-creator
58
59 And install the package with this command:
60
61 .. code-block:: console
62
63    $ apt-get install snf-image-creator
64
65 Ubuntu
66 ------
67
68 For *Ubuntu 12.04 LTS*, *12.10* and *13.04* systems, you can use our official
69 packages found in *grnet/synnefo* Lauchpad PPA.
70
71 Add the synnefo PPA in your system:
72
73 .. code-block:: console
74
75    $ sudo apt-add-repository ppa:grnet/synnefo
76    $ sudo apt-get update
77
78 If *apt-add-repository* is missing, first install:
79
80 *software-properties-common* (Ubuntu 12.10 & 13.04):
81
82 .. code-block:: console
83
84    $ sudo apt-get install software-properties-common
85
86 Or *python-software-properties* (Ubuntu 12.04):
87
88 .. code-block:: console
89
90    $ sudo apt-get install python-software-properties
91
92 After the synnefo repository is set up, you should be able to list
93 snf-image-creator by calling:
94
95 .. code-block:: console
96
97    $ apt-cache showpkg snf-image-creator
98
99 Install the package by issuing:
100
101 .. code-block:: console
102
103    $ sudo apt-get install snf-image-creator
104
105 .. note::
106    If you are asked during the installation to create/update a
107    "supermin appliance", choose "Yes".
108
109 Fedora
110 ------
111
112 For *Fedora 17* you can use our official packages hosted at the *synnefo*
113 repository of the openSUSE Build Service.
114
115 Add the *synnefo* repository for *Fedora 17* to *yum*:
116
117 .. code-block:: console
118
119    $ cd /etc/yum.repos.d
120    $ wget http://download.opensuse.org/repositories/home:/GRNET:/synnefo/Fedora_17/home:GRNET:synnefo.repo
121
122 To list the *snf-image-creator* package use the following command:
123
124 .. code-block:: console
125
126    $ yum info snf-image-creator
127
128 Install the package by issuing:
129
130 .. code-block:: console
131
132    $ yum install snf-image-creator
133
134 CentOS
135 ------
136
137 For *CentOS 6* you can use our official packages hosted at the *synnefo*
138 repository of the openSUSE Build Service.
139
140 Add the *synnefo* repository for *CentOS 6* to the yum repositories list:
141
142 .. code-block:: console
143
144    $ cd /etc/yum.repos.d
145    $ wget http://download.opensuse.org/repositories/home:/GRNET:/synnefo/CentOS_CentOS-6/home:GRNET:synnefo.repo
146
147 Check the `Fedora <#fedora>`_ instructions on how to install the software.
148
149 Arch Linux
150 ----------
151
152 For *Arch Linux* there are **unofficial** packages in AUR:
153 https://aur.archlinux.org/packages/snf-image-creator/ kindly provided by
154 Axilleas Pipinellis <axilleas@archlinux.info>.
155
156 .. note::
157     Those packages are not maintained by the Synnefo development team.
158
159     Please direct package-specific questions to Axilleas Pipinellis <axilleas@archlinux.info>,
160     Cc: the Synnefo development team <synnefo-devel@googlegroups.com>
161
162 To install the package you may use *yaourt*. Create and install
163 the *yaourt* package:
164
165 .. code-block:: console
166
167    $ wget https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz
168    $ tar -xvf package-query.tar.gz
169    $ cd package-query
170    $ makepkg -s
171    $ pacman -U package-query-<VERSION>-<ARCH>.pkg.tar.xz
172    $ cd ..
173    $ wget https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz
174    $ tar -xvf yaourt.tar.gz
175    $ cd yaourt
176    $ makepkg -s
177    $ pacman -U yaourt-<VERSION>-<ARCH>.pkg.tar.xz
178
179 Install *snf-image-creator* using yaourt:
180
181 .. code-block:: console
182
183    $ yaourt -Sa snf-image-creator
184
185 Install snf-image-creator from source
186 =====================================
187
188 Manually install the following dependencies:
189
190  * Python 2 [http://www.python.org/]
191  * Python setuptools [http://pypi.python.org/pypi/setuptools]
192  * Python Dialog [http://pythondialog.sourceforge.net/]
193  * Python bindings for libguestfs [http://libguestfs.org/]
194  * Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
195  * pyparted [https://fedorahosted.org/pyparted/]
196  * rsync [http://rsync.samba.org/]
197
198 In Ubuntu you can do this using:
199  
200 .. code-block:: console
201
202    $ sudo apt-get install python-setuptools python-guestfs python-dialog \
203      python-sendfile python-parted rsync
204
205 If you are using Ubuntu 12.10 you also need to install libguestfs-tools:
206
207 .. code-block:: console
208
209    $ sudo apt-get install libguestfs-tools
210
211 .. note::
212    If you are asked during the installation to create/update a
213    "supermin appliance", choose "Yes".
214
215 Python Virtual Environment
216 --------------------------
217
218 Since snf-image-creator and the rest of its dependencies won't be installed
219 using packages, it's better to work in an isolated python virtual environment
220 (virtualenv).
221
222 Install the Virtual Python Environment builder:
223 http://pypi.python.org/pypi/virtualenv.
224
225 For Ubuntu use the following command:
226
227 .. code-block:: console
228
229    $ sudo apt-get install python-virtualenv
230
231 Then create a new python virtual environment:
232
233 .. code-block:: console
234
235    $ virtualenv --system-site-packages ~/image-creator-env
236
237 and activate it by executing:
238
239 .. code-block:: console
240
241    $ source ~/image-creator-env/bin/activate
242
243 You may later deactivate it using:
244
245 .. code-block:: console
246
247    $ deactivate
248
249 kamaki Installation
250 -------------------
251
252 Refer to `./kamaki documentation <http://docs.dev.grnet.gr/kamaki/latest/installation.html>`_
253 for instructions. You may install kamaki from source inside the virtualenv
254 you've created above or by using binary packages if they are available for your
255 distribution.
256
257 snf-image-creator Installation
258 ------------------------------
259
260 Download the latest snf-image-creator source package from
261 `here <https://code.grnet.gr/projects/snf-image-creator/files>`_ and install it
262 inside the virtualenv using the following commands:
263
264 .. code-block:: console
265
266    $ tar -xf snf_image_creator-<VERSION>.tar.gz
267    $ cd snf_image_creator-<VERSION>
268    $ python ./setup.py install
269
270 Alternatively, you can install the bleeding edge version of the software by
271 cloning its git repository:
272
273 .. code-block:: console
274
275    $ git clone https://code.grnet.gr/git/snf-image-creator
276    $ cd snf-image-creator
277    $ python ./setup.py install
278
279 To do the latter, you'll need to have git (http://git-scm.com/) installed.
280 For ubuntu this can be done using:
281
282 .. code-block:: console
283
284    $ sudo apt-get install git
285
286 .. warning::
287    Keep in mind that the bleeding edge version may be unstable or even
288    unusable.
289