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