Implement an optional json output 4 outputing cmds
[kamaki] / docs / installation.rst
index 2be955f..4fffadf 100644 (file)
@@ -6,119 +6,206 @@ This guide describes the standard installation process for kamaki, with the aspi
 
 * Kamaki repository: `http://code.grnet.gr/git/kamaki <http://code.grnet.gr/git/kamaki>`_
 
-* Synnefo Linux packages: `http://apt.dev.grnet.gr <http://apt.dev.grnet.gr>`_
+* Kamaki at pypi: `http://pypi.python.org/pypi/kamaki <https://pypi.python.org/pypi/kamaki>`_
+
+* Synnefo Linux packages: `http://apt2.dev.grnet.gr <http://apt2.dev.grnet.gr>`_
 
 Linux and Unix-like enviroments
 -------------------------------
 
-.. _installing-from-source-ref:
+Debian:
+^^^^^^^
 
-Installing from source (git repos.)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The following steps describe a command-line approach, but any graphic package manager can be used instead.
 
-1. Setup a virtual enviroment (optional)
-""""""""""""""""""""""""""""""""""""""""
+* As root, append the following to */etc/apt/sources.list* ::
 
-With virtualenv users can setup kamaki and synnefo services in a sandbox environment.
+    deb http://apt2.dev.grnet.gr stable/
 
-.. code-block:: console
+* Make sure the GPG public key for the Synnefo development team is added:
 
-    $ virtualenv kamaki-env
+    .. code-block:: console
 
-    $ source kamaki-env/bin/activate
+        $ sudo curl https://dev.grnet.gr/files/apt-grnetdev.pub|apt-key add -
 
-.. hint:: More about virtualenv: `<http://www.virtualenv.org>`_
+    otherwise *apt-get update* will produce GPG warnings.
 
-2. Install snf-common from synnefo project (required since v0.6.0)
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+* Update the Debian sources:
 
-Package snf-common is required since kamaki 0.6.0.
+    .. code-block:: console
 
-.. code-block:: console
+        $ sudo apt-get update
 
-    $ git clone http://code.grnet.gr/git/synnefo
+* Install kamaki:
 
-    $ cd synnefo/snf-common
+    .. code-block:: console
 
-    $ ./setup build install
+        $ sudo apt-get install kamaki
 
-    $ cd -
+Ubuntu
+^^^^^^
 
-3. Install kamaki
-"""""""""""""""""
+The following steps describe a command-line approach, but any graphic package manager can be used instead.
 
-.. code-block:: console
+* Let ppa take care of the repository configuration:
+
+    .. code-block:: console
+
+        $ sudo apt-get install python-software-properties
+        $ sudo add-apt-repository ppa:grnet/synnefo
 
-    $ git clone http://code.grnet.gr/git/kamaki
+* Update the Debian sources:
 
-    $ cd kamaki
+    .. code-block:: console
 
-    $ ./setup build install
+        $ sudo apt-get update
 
-4. Install progress and/or ansicolors (optional)
-""""""""""""""""""""""""""""""""""""""""""""""""
+* Install kamaki:
 
-progress: command-line progress bars (in some commands)
+    .. code-block:: console
 
-ansicolors: color kamaki output (can switched on and off in `setup <setup.html>`_)
+        $ sudo apt-get install kamaki
+
+Install ansicolors (optional but recommended)
+"""""""""""""""""""""""""""""""""""""""""""""
 
 .. code-block:: console
 
-    $ pip install progress
+    $ sudo apt-get install python-ansicolors
 
-    $ pip install ansicolors
+Install mock (for developers only)
+""""""""""""""""""""""""""""""""""
 
-Ubuntu and Debian packages
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. code-block:: console
 
-The following steps describe a command-line approach, but any graphic package manager can be used instead.
+    $ sudo apt-get install python-mock
+
+.. warning:: kamaki.clients unit-tests need python-mock 1.X or better. e.g.::
+
+    $ sudo apt-get install python-mock=1.0.1
+
+.. _installing-from-pypi-ref:
+
+Installing from pypi
+^^^^^^^^^^^^^^^^^^^^
 
-1. Add the following to apt sources list
-""""""""""""""""""""""""""""""""""""""""
+Requirements
+""""""""""""
 
-* Debian::
+Essential:
 
-    deb http://apt.dev.grnet.gr/ sid main
+ * Python 2.6 or better [http://www.python.org]
+ * Python setuptools [http://pypi.python.org/pypi/setuptools]
 
-* Ubuntu::
+Optional:
 
-    deb http://apt.dev.grnet.gr/ precise main
+ * VirtualEnv (python-virtualenv) [http://www.virtualenv.org]
 
-2. Update
-"""""""""
+Setup a virtual enviroment (optional)
+"""""""""""""""""""""""""""""""""""""
+
+With virtualenv users can setup kamaki and synnefo services in a sandbox environment.
 
 .. code-block:: console
 
-    $ sudo apt-get update
+    $ virtualenv kamaki-env
+    $ source kamaki-env/bin/activate
 
-.. note:: Safely ignore a signature verification error like the following, if it emerges:
+A more detailed example of using virtual env can be found at the `snf-image-creator setup guide <http://www.synnefo.org/docs/snf-image-creator/latest/install.html#python-virtual-environment>`_
+
+Install kamaki
+""""""""""""""
+
+.. code-block:: console
 
-    .. warning:: GPG error: http://apt.dev.grnet.gr precise/sid InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXX
+    $ pip install kamaki
 
-3. Install kamaki
-"""""""""""""""""
+Install ansicolors
+""""""""""""""""""
 
-Since version 0.6.0, the package snf-common (available at synnefo apt repository) will be automatically installed as a dependency.
+The **ansicolors** package is not required for running kamaki, but it is
+recommended as a user experience improvement. In specific, ansicolors
+adds colors to kamaki responses.
 
 .. code-block:: console
 
-    $ sudo apt-get install kamaki
+    $ pip install ansicolors
+
+Install mock
+""""""""""""
 
-4. Install ansicolors and/or progress (Optional)
-""""""""""""""""""""""""""""""""""""""""""""""""
+The **mock** package is needed for running the prepared unit-tests in the kamaki.clients
+package. This feature is useful when extendnig / debugging kamaki functionality and is
+aimed to kamaki developers and contributors. Therefore, users can enjoy the full kamaki
+user experience without installing mock.
 
 .. code-block:: console
 
-    $ sudo apt-get install python-ansicolors
+    $ pip install mock
 
-    $ sudo apt-get install python-progress
+.. warning:: mock version >= 1.X
 
 Mac OS X
 --------
 
-Kamaki can be installed on Mac OS X systems from source, by following the steps at :ref:`installing-from-source-ref`.
+Kamaki can be installed on Mac OS X systems from source, by following the steps at :ref:`installing-from-pypi-ref`.
 
 Windows
 -------
 
-It has proven possible (and not too tricky) to install kamaki on Windows console using some auxiliary applications, but Windows users are not the target audience for the time being.
+Kamaki can be installed on Windows by following the pypi method. Installing the requirements is a bit different than in other systems. 
+
+The full process is detailed in the following:
+
+Requirements
+^^^^^^^^^^^^
+
+* Python 2.7 or better (`Official versions <http://www.python.org/getit>`_)
+
+* Setuptools (`Official versions and workarounds <http://pypi.python.org/pypi/setuptools>`_)
+
+Users who have already set up python and setuptools (e.g. for another project) may skip python and / or setup tools installation.
+
+Install python
+^^^^^^^^^^^^^^
+
+Download and run the Windows installer from `here <http://www.python.org/getit>`_
+
+Users should pick the installer that fits their windows version and architecture.
+
+Add python to windows path
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following will allow users to run python and python scripts from command line.
+
+* Select **System** from the Control Panel, select the **Advanced** tab, the **Environment Variables** button and then find the **PATH** (user or system) and **edit**
+
+* Without removing existing values, append the following to PATH::
+
+    C:\Python;C:\Python\Scripts
+
+.. note:: Path values are separated by semicolons
+
+.. warning:: C:\\Python should be replaced with the actual python path in the system, e.g. C:\\Python27
+
+Install setuptools
+^^^^^^^^^^^^^^^^^^
+
+According to the corresponding `python org page <http://pypi.python.org/pypi/setuptools>`_, the setuptools installer doesn't currently work on 64bit machines.
+
+* Users with 32-bit operating systems should download and run the graphic installer
+
+* Users with 64-bit machines should download the `ez_setup.py <http://peak.telecommunity.com/dist/ez_setup.py>`_ script and install it from a command shell. In the following example, the script was downloaded at C:\\Downloads::
+
+    C:\> cd Downloads
+    C:\Downloads\> python ez_setup.py
+    ...
+    Installation finished
+    C:\Downloads\>
+
+Install kamaki
+^^^^^^^^^^^^^^
+
+.. code-block:: console
+
+    $ easy_setup kamaki