Implement an optional json output 4 outputing cmds
[kamaki] / docs / installation.rst
index e3aa8d5..4fffadf 100644 (file)
@@ -6,80 +6,88 @@ 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>`_, `http://apt2.dev.grnet.gr <http://apt2.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
 -------------------------------
 
-Ubuntu and Debian packages
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+Debian:
+^^^^^^^
 
 The following steps describe a command-line approach, but any graphic package manager can be used instead.
 
-Add the following to apt sources list
-"""""""""""""""""""""""""""""""""""""
+* As root, append the following to */etc/apt/sources.list* ::
 
-As root, append one of the following to */etc/apt/sources.list*:
+    deb http://apt2.dev.grnet.gr stable/
 
+* Make sure the GPG public key for the Synnefo development team is added:
 
-* Debian Stable::
+    .. code-block:: console
 
-    deb http://apt.dev.grnet.gr/ squeeze main
-    deb http://apt2.dev.grnet.gr stable/
+        $ sudo curl https://dev.grnet.gr/files/apt-grnetdev.pub|apt-key add -
 
-* Ubuntu::
+    otherwise *apt-get update* will produce GPG warnings.
 
-    deb http://ppa.launchpad.net/grnet/synnefo/ubuntu <UBUNTU_VERSION> main
-    deb-src http://ppa.launchpad.net/grnet/synnefo/ubuntu <UBUNTU_VERSION> main
+* Update the Debian sources:
 
-where <UBUNTU_VERSION> is the system Ubuntu version (e.g. precise)
+    .. code-block:: console
 
-Update
-""""""
+        $ sudo apt-get update
 
-* In Debian, make sure the GPG public key for the GRNET dev team is added:
+* Install kamaki:
 
     .. code-block:: console
 
-        $ curl https://dev.grnet.gr/files/apt-grnetdev.pub|apt-key add -
+        $ sudo apt-get install kamaki
 
-    otherwise *apt-get update* will produce GPG warnings.
+Ubuntu
+^^^^^^
+
+The following steps describe a command-line approach, but any graphic package manager can be used instead.
 
-* In Ubuntu, make sure the correct PPA signing key is installed:
+* 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
 
-Finally:
+* Update the Debian sources:
 
-.. code-block:: console
+    .. code-block:: console
 
-    $ sudo apt-get update
+        $ sudo apt-get update
 
+* Install kamaki:
 
-Install kamaki
-""""""""""""""
+    .. code-block:: console
 
-.. note:: The objpool package is available at synnefo repositories and is automatically installed as a dependency.
+        $ sudo apt-get install kamaki
+
+Install ansicolors (optional but recommended)
+"""""""""""""""""""""""""""""""""""""""""""""
 
 .. code-block:: console
 
-    $ sudo apt-get install kamaki
+    $ sudo apt-get install python-ansicolors
 
-Install ansicolors and/or progress (Optional)
-"""""""""""""""""""""""""""""""""""""""""""""
+Install mock (for developers only)
+""""""""""""""""""""""""""""""""""
 
 .. code-block:: console
 
-    $ sudo apt-get install python-ansicolors
-    $ sudo apt-get install python-progress
+    $ sudo apt-get install python-mock
+
+.. warning:: kamaki.clients unit-tests need python-mock 1.X or better. e.g.::
 
-.. _installing-from-source-ref:
+    $ sudo apt-get install python-mock=1.0.1
 
-Installing from source (git repos.)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. _installing-from-pypi-ref:
+
+Installing from pypi
+^^^^^^^^^^^^^^^^^^^^
 
 Requirements
 """"""""""""
@@ -103,85 +111,70 @@ With virtualenv users can setup kamaki and synnefo services in a sandbox environ
     $ virtualenv kamaki-env
     $ source kamaki-env/bin/activate
 
-A more detailed example of using virtual env can be found at the `snf-image-creator setup guide <http://docs.dev.grnet.gr/snf-image-creator/latest/install.html#python-virtual-environment>`_
-
-Install objpool (was: snf-common)
-"""""""""""""""""""""""""""""""""
-
-Since 0.6.2, kamaki is based on python-objpool. The objpool package is easy to install from source (even on windows platforms):
-
-.. code-block:: console
-
-    $ git clone http://code.grnet.gr/git/objpool
-    $ cd objpool
-    $ ./setup build install
-    $ cd -
+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
 """"""""""""""
 
-Kamaki can be downloaded from `this location <https://code.grnet.gr/projects/kamaki/files>`_, where users can pick the version they prefer and unzip it locally:
-
 .. code-block:: console
 
-    $ tar xvfz kamaki-0.6.2.tar.gz
-
-or it can be downloaded directly from the git repository:
-
-.. code-block:: console
+    $ pip install kamaki
 
-    $ git clone http://code.grnet.gr/git/kamaki
+Install ansicolors
+""""""""""""""""""
 
-and then installed by the setup script:
+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
 
-    $ cd kamaki
-    $ ./setup build install
-
-Install progress and/or ansicolors (optional)
-"""""""""""""""""""""""""""""""""""""""""""""
+    $ pip install ansicolors
 
-progress: command-line progress bars (in some commands)
+Install mock
+""""""""""""
 
-ansicolors: color kamaki output (can switched on and off in `setup <setup.html>`_)
+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
 
-    $ pip install progress
-    $ pip install ansicolors
+    $ pip install mock
+
+.. 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
 -------
 
-Since version 0.6.2 kamaki can run on Windows, either on standard Windows console, or inside an improved command line shell. The present guide presents a tested method for using kamaki in windows
+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>`_)
 
-* Git (download `windows version <http://git-scm.com/download/win>`_)
-
 * Setuptools (`Official versions and workarounds <http://pypi.python.org/pypi/setuptools>`_)
 
-Installation from source
-^^^^^^^^^^^^^^^^^^^^^^^^
+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.
 
@@ -196,7 +189,7 @@ The following will allow users to run python and python scripts from command lin
 .. 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.
 
@@ -210,43 +203,9 @@ According to the corresponding `python org page <http://pypi.python.org/pypi/set
     Installation finished
     C:\Downloads\>
 
-Install GIT
-"""""""""""
-
-`Download GIT <http://git-scm.com/download/win>`_ and run the graphic installer. During the installation, users will be able to modify some installation options. The present guide is tested with the default selections.
-
-After the installation is completed, a GIT standalone shell will be installed (a desktop shortcut is created, by default). Users are advised to run kamaki through this shell.
-
 Install kamaki
-""""""""""""""
-
-* Run the GIT standalone shell
-
-* Enter the location where kamaki will be installed, e.g. **C:\\**
-
-    .. code-block:: console
-
-        $ cd /c/
+^^^^^^^^^^^^^^
 
-* Download source from GRNET repository
-
-    .. code-block:: console
-
-        $ git clone http://code.grnet.gr/git/kamaki
-        Cloning into 'kamaki'...
-        Receiving objects: ...
-        Resolving Deltas: ...
-
-* Enter source and install kamaki
-
-    .. code-block:: console
-
-        $ cd kamaki
-        $ python setup.py install
-        running install
-        ...
-        Finished processing dependencies for kamaki==0.6.2
-
-.. warning:: kamaki version should be 0.6.2 or better, otherwise it will not function. Users can test that by running::
+.. code-block:: console
 
-    $ kamaki --version
+    $ easy_setup kamaki