921122116f2689436ac32c73b6ea770ce6f3f56d
[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  * ./kamaki [https://code.grnet.gr/projects/kamaki]
20  * Python sh (previously pbs) [https://github.com/amoffat/sh]
21  * ANSI colors for Python [http://pypi.python.org/pypi/ansicolors]
22  * progress [http://pypi.python.org/pypi/progress]
23
24 The above dependencies are resolved differently, depending on the installation
25 method you choose. There are two installation methods available:
26
27 #. `Installation using official packages <#install-snf-image-creator-using-official-packages>`_ (currently only for Ubuntu 12.04 LTS and 12.10).
28
29 #. `Installation from source <#install-snf-image-creator-from-source>`_
30
31 Install snf-image-creator using official packages
32 =================================================
33
34 For Ubuntu systems, you can use our official packages found in *grnet/synnefo*
35 Lauchpad PPA.
36
37 Add the synnefo PPA in your system:
38
39 .. code-block:: console
40
41    $ sudo apt-add-repository ppa:grnet/synnefo
42    $ sudo apt-get update
43
44 If *apt-add-repository* is missing, install *software-properties-common* first:
45
46 .. code-block:: console
47
48    $ sudo apt-get install software-properties-common
49
50 After the synnefo repository is set up, you should be able to list
51 snf-image-creator by calling:
52
53 .. code-block:: console
54
55    $ apt-cache showpkg snf-image-creator
56
57 Install the package by issuing:
58
59 .. code-block:: console
60
61    $ sudo apt-get install snf-image-creator
62
63 If you are using Ubuntu 12.10, also install libguestfs-tools:
64
65 .. code-block:: console
66
67    $ sudo apt-get install libguestfs-tools
68
69 .. note::
70    If you are asked during the installation to create/update a
71    "supermin appliance", choose "Yes".
72
73 Install snf-image-creator from source
74 =====================================
75
76 Manually install the following dependencies:
77
78  * Python 2 [http://www.python.org/]
79  * Python setuptools [http://pypi.python.org/pypi/setuptools]
80  * Python Dialog [http://pythondialog.sourceforge.net/]
81  * Python bindings for libguestfs [http://libguestfs.org/]
82  * Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
83  * pyparted [https://fedorahosted.org/pyparted/]
84
85 In Ubuntu you can do this using:
86  
87 .. code-block:: console
88
89    $ apt-get install python-setuptools python-guestfs python-dialog \
90      python-sendfile python-parted
91
92 If you are using Ubuntu 12.10 you also need to install libguestfs-tools:
93
94 .. code-block:: console
95
96    $ sudo apt-get install libguestfs-tools
97
98 .. note::
99    If you are asked during the installation to create/update a
100    "supermin appliance", choose "Yes".
101
102 Python Virtual Environment
103 --------------------------
104
105 Since snf-image-creator and the rest of its dependencies won't be installed
106 using packages, it's better to work in an isolated python virtual environment
107 (virtualenv).
108
109 Install the Virtual Python Environment builder:
110 http://pypi.python.org/pypi/virtualenv.
111
112 For Ubuntu use the following command:
113
114 .. code-block:: console
115
116    $ apt-get install python-virtualenv
117
118 Then create a new python virtual environment:
119
120 .. code-block:: console
121
122    $ virtualenv --system-site-packages ~/image-creator-env
123
124 and activate it by executing:
125
126 .. code-block:: console
127
128    $ source ~/image-creator-env/bin/activate
129
130 You may later deactivate it using:
131
132 .. code-block:: console
133
134    $ deactivate
135
136 kamaki Installation
137 -------------------
138
139 Refer to `./kamaki documentation <http://docs.dev.grnet.gr/kamaki/latest/installation.html>`_
140 for instructions. You may install kamaki from source inside the virtualenv
141 you've crated above or by using binary packages if they are available for your
142 distribution.
143
144 snf-image-creator Installation
145 ------------------------------
146
147 Download the latest snf-image-creator source package from
148 `here <https://code.grnet.gr/projects/snf-image-creator/files>`_ and install it
149 inside the virtualenv using the following commands:
150
151 .. code-block:: console
152
153    $ tar -xf snf_image_creator-<VERSION>.tar.gz
154    $ cd snf_image_creator-<VERSION>
155    $ python ./setup install
156
157 Alternatively, you can install the bleeding edge version of the software by
158 cloning its git repository:
159
160 .. code-block:: console
161
162    $ git clone https://code.grnet.gr/git/snf-image-creator
163    $ cd snf-image-creator
164    $ python ./setup.py install
165
166 To do the latter, you'll need to have git (http://git-scm.com/) installed.
167 For ubuntu this can be done using:
168
169 .. code-block:: console
170
171    $ apt-get install git
172
173 .. warning::
174    Keep in mind that the bleeding edge version may be unstable or even
175    unusable.
176