<commit_before>Savanna UI Dev Environment Setup
============================================

These installation steps suite for two purposes:
 * to setup dev environment
 * to setup isolated Dashboard for Savanna

Note that the host where you're going to perform installation has to be
able to connected to all OpenStack endpoints. You can list all available
endpoints using the following command:

.. sourcecode:: console

    $ keystone endpoint-list

1. Install prerequisites

.. sourcecode:: console

    $ sudo apt-get update
    $ sudo apt-get install git-core python-dev gcc python-setuptools python-virtualenv node-less

On Ubuntu 12.10 and higher you have to install the following lib as well:

.. sourcecode:: console

    $ sudo apt-get install nodejs-legacy

2. Checkout Horizon from git and switch to your version of OpenStack (stable/grizzly or stable/folsom).
Here is an example for grizzly:

.. sourcecode:: console

    $ git clone https://github.com/openstack/horizon
    $ git checkout -b stable/grizzly origin/stable/grizzly
..

    Then install virtual environment:

.. sourcecode:: console

    $ python tools/install_venv.py

3. Create ``local_settings.py`` file:

.. sourcecode:: console

    $ cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py

4. Open file ``openstack_dashboard/local/local_settings.py`` and uncomment strings:

.. sourcecode:: python

   from horizon.utils import secret_key
   SECRET_KEY = secret_key.generate_or_read_....

and set right value for variables:

.. sourcecode:: python

   OPENSTACK_HOST = "ip of your controller"
   SAVANNA_URL = "url for savanna (e.g. "http://localhost:8386/v1.0")"

5. Clone savanna-dashboard sources from ``https://github.com/stackforge/savanna-dashboard.git``

.. sourcecode:: console

    $ git clone https://github.com/stackforge/savanna-dashboard.git

6. Export SAVANNA_DASHBOARD_HOME environment variable with path to savanna-dashboard folder. E.g.:

.. sourcecode:: console

    $ export SAVANNA_DASHBOARD_HOME=$(pwd)/savanna-dashboard

7. Install savanna-dashboard module to horizon's venv. Go to horizon folder and execute:

.. sourcecode:: console

    $ .venv/bin/python $SAVANNA_DASHBOARD_HOME/setup.py install

8. Create a symlink to savanna-dashboard source

.. sourcecode:: console

   $ ln -s $SAVANNA_DASHBOARD_HOME/savanna-dashboard .venv/lib/python2.7/site-packages/savanna-dashboard

9. In ``openstack_dashboard/settings.py`` add savanna to

.. sourcecode:: python

    HORIZON_CONFIG = {
        'dashboards': ('nova', 'syspanel', 'settings', 'savanna'),

and add savannadashboard to

.. sourcecode:: python
<commit_msg>Docs fixed for horizon<commit_after>Savanna UI Dev Environment Setup
============================================

These installation steps suite for two purposes:
 * to setup dev environment
 * to setup isolated Dashboard for Savanna

Note that the host where you're going to perform installation has to be
able to connected to all OpenStack endpoints. You can list all available
endpoints using the following command:

.. sourcecode:: console

    $ keystone endpoint-list

1. Install prerequisites

.. sourcecode:: console

    $ sudo apt-get update
    $ sudo apt-get install git-core python-dev gcc python-setuptools python-virtualenv node-less

On Ubuntu 12.10 and higher you have to install the following lib as well:

.. sourcecode:: console

    $ sudo apt-get install nodejs-legacy

2. Checkout Horizon from git and switch to your version of OpenStack (stable/grizzly or stable/folsom).
Here is an example for grizzly:

.. sourcecode:: console

    $ git clone https://github.com/openstack/horizon
    $ git checkout -b stable/grizzly origin/stable/grizzly
..

    Then install virtual environment:

.. sourcecode:: console

    $ python tools/install_venv.py

3. Create ``local_settings.py`` file:

.. sourcecode:: console

    $ cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py

4. Open file ``openstack_dashboard/local/local_settings.py`` and uncomment strings:

.. sourcecode:: python

   from horizon.utils import secret_key
   SECRET_KEY = secret_key.generate_or_read_....

and set right value for variables:

.. sourcecode:: python

   OPENSTACK_HOST = "ip of your controller"
   SAVANNA_URL = "url for savanna (e.g. "http://localhost:8386/v1.0")"

5. Clone savanna-dashboard sources from ``https://github.com/stackforge/savanna-dashboard.git``

.. sourcecode:: console

    $ git clone https://github.com/stackforge/savanna-dashboard.git

6. Export SAVANNA_DASHBOARD_HOME environment variable with path to savanna-dashboard folder. E.g.:

.. sourcecode:: console

    $ export SAVANNA_DASHBOARD_HOME=$(pwd)/savanna-dashboard

7. Install savanna-dashboard module to horizon's venv. Go to horizon folder and execute:

.. sourcecode:: console

    $ .venv/bin/python $SAVANNA_DASHBOARD_HOME/setup.py install

8. Create a symlink to savanna-dashboard source

.. sourcecode:: console

   $ ln -s $SAVANNA_DASHBOARD_HOME/savannadashboard .venv/lib/python2.7/site-packages/savannadashboard

9. In ``openstack_dashboard/settings.py`` add savanna to

.. sourcecode:: python

    HORIZON_CONFIG = {
        'dashboards': ('nova', 'syspanel', 'settings', 'savanna'),

and add savannadashboard to

.. sourcecode:: python

{'fraction_non_alphanumeric': 0.10809799887787544, 'fraction_numerical': 0.007854871890779876, 'mean_word_length': 3.97951582867784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4882420', 'n_tokens_mistral': 1665, 'n_tokens_neox': 1602, 'n_words': 507}