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