<commit_before>.. sectnum::
   :start: 2



UNORDERED NOTES 

Operating System Preparation
================================

In this Section we summarize some important packages that need to be installed in order to run cloudmesh.


OSX
----------

TODO: lots of missing 

Install Mongo
^^^^^^^^^^^^^^^



Install RabbitMQ
^^^^^^^^^^^^^^^^

TBD

Sphinx autorun
^^^^^^^^^^^^^^^

This package is only needed if you like to generate the documentation. Most developers will want to install it::

    $ hg clone http://bitbucket.org/birkenfeld/sphinx-contrib/
    $ cd sphinx-contrib/autorun
    $ python setup.py install

Blockdiag family
^^^^^^^^^^^^^^^^^

TODO: this expalanation is incomplete

To install these packages you need to execute::

    pip install "blockdiag[PDF]"
	pip install "rackdiag[PDF]"
	pip install nwdiag[PDF]"
	
The documentation to this package is located at 

* http://blockdiag.com/en/blockdiag/introduction.html#setup

blockdiag uses TrueType Font to render text. blockdiag try to detect installed fonts but if nothing detected, You can specify fonts with -f (–font) option::

    $ blockdiag -f /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf simple.diag

If you always use same font, write $HOME/.blockdiagrc::

    $ cat $HOME/.blockdiagrc
    [blockdiag]
    fontpath = /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf

TODO: distribute a standard ttf font and use sh so that the -f font is included from the deployed package

Ubuntu
------------

Assuming a basic Ubuntu Desktop 13.04, install prerequsites::

   $ sudo apt-get install \
      git \
      curl \
      python-virtualenv \
      python-dev \
      libldap2-dev \
      libsasl2-dev

TODO: do we also have to do::

   (Allan did not need to do this, already in requirements.txt)
   $ pip install python-ldap

TODO: do we have to install ldap-user

   sudo apt-get install ldap-user


TODO: What is different for Ubuntu 12.04 ?
 
TODO: Do we need to test Ubuntu 10.04 ?


Install Mongo
^^^^^^^^^^^^^^^

    $ sudo apt-get install mongodb

Note: the mongod process will by default try to use /data/db for its
database files.  We recommend using the --dbpath option to specify a
directory in your own home.  See start() method in fabfiles/server.py.

The first startup of mongod will take some time as it creates files in
the dbpath.  Unless these are deleted, subsequent startup times should
be much faster.


Install RabbitMQ
^^^^^^^^^^^^^^^^

Install from standard packages::

    $ sudo apt-get install rabbitmq-server


Sphinx autorun
^^^^^^^^^^^^^^^

TBD

Blockdiag family
^^^^^^^^^^^^^^^^^

TBD

CentOS
--------------------

Minimal initial requirements, git, python2.7, and virtualenv
installed.  If you don't have python2.7, see the manual installation
steps below.  The system will also need to be configure to use the
EPEL repo (for mongodb and rabbitmq).

Otherwise, create a virtualenv for cloudmesh, activate it, and run::

    $ pip install fabric

Then clone the cloudmesh repository::

    $ git clone https://github.com/cloudmesh/cloudmesh.git

Then run::

    $ cd cloudmesh && fab -f install.fabfile.py deploy

TODO: Explain how the user gets their cloudmesh.yaml file.

Assuming there are no errors, run::

    $ fab server.start


Manual installation
^^^^^^^^^^^^^^^^^^^

Assuming a basic CentOS 6.4 Server, install prerequsites::

    $ sudo yum install -y \
        git \
        wget \
        gcc \
        make \
        readline-devel \
        zlib-devel \
        openssl-devel \
        openldap-devel \
        bzip2-devel


Install Python
^^^^^^^^^^^^^^^

Cloudmesh requires python 2.7, and CentOS comes with Python 2.6.
However we cannot replace the system python as yum and other tools
depend on it, so we will configure it to install in /opt/python::

    $ wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz

Recommended: verify the md5 checksum, b4f01a1d0ba0b46b05c73b2ac909b1df for the above.::

    $ tar xzf Python-2.7.5.tgz
    $ cd Python-2.7.5
    $ configure --prefix=/opt/python && make
    $ sudo make install

Edit your ~/.bash_profile to add /opt/python/bin to the start of your
PATH, then log out and back in.

Install Python Virtualenv
^^^^^^^^^^^^^^^^^^^^^^^^^

Verify that python2.7 is active::

    $ python --version
    Python 2.7.5

If you see Python 2.6.6, fix your PATH to include /opt/python/bin before /usr/bin.::

    $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gzcd
    $ tar xfz virtualenv-1.10.1.tar.gz
    $ cd virtualenv-1.10.1.tar.gz
    $ sudo python setup.py install


Install Mongo
^^^^^^^^^^^^^^^
Create /etc/yum.repos.d/10gen containing::

    [10gen]
    name=10gen Repository
    baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
    gpgcheck=0
    enabled=1

Then::

    $ sudo yum install mongo-10gen mongo-10gen-server


Install RabbitMQ
^^^^^^^^^^^^^^^^

Intstall from standard packages::

    $ sudo yum install rabbitmq-server
    $ sudo service rabbitmq-server start


Sphinx autorun
^^^^^^^^^^^^^^^

TBD

Blockdiag family
^^^^^^^^^^^^^^^^^

TBD


Installing the source code
=============================

Create a virtualenv::

    $ virtualenv --no-site-packages cloudmesh_v

Note: the name of the virtualenv is your choice, it does not need to be called "cloudmesh_v."

Activate the vitrualenv::

    $ . cloudmesh_v/bin/activate
<commit_msg>tested centos<commit_after>.. sectnum::
   :start: 2



UNORDERED NOTES 

Operating System Preparation
================================

In this Section we summarize some important packages that need to be installed in order to run cloudmesh.


OSX
----------

TODO: lots of missing 

Install Mongo
^^^^^^^^^^^^^^^



Install RabbitMQ
^^^^^^^^^^^^^^^^

TBD

Sphinx autorun
^^^^^^^^^^^^^^^

This package is only needed if you like to generate the documentation. Most developers will want to install it::

    $ hg clone http://bitbucket.org/birkenfeld/sphinx-contrib/
    $ cd sphinx-contrib/autorun
    $ python setup.py install

Blockdiag family
^^^^^^^^^^^^^^^^^

TODO: this expalanation is incomplete

To install these packages you need to execute::

    pip install "blockdiag[PDF]"
	pip install "rackdiag[PDF]"
	pip install nwdiag[PDF]"
	
The documentation to this package is located at 

* http://blockdiag.com/en/blockdiag/introduction.html#setup

blockdiag uses TrueType Font to render text. blockdiag try to detect installed fonts but if nothing detected, You can specify fonts with -f (–font) option::

    $ blockdiag -f /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf simple.diag

If you always use same font, write $HOME/.blockdiagrc::

    $ cat $HOME/.blockdiagrc
    [blockdiag]
    fontpath = /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf

TODO: distribute a standard ttf font and use sh so that the -f font is included from the deployed package

Ubuntu
------------

Assuming a basic Ubuntu Desktop 13.04, install prerequsites::

   $ sudo apt-get install \
      git \
      curl \
      python-virtualenv \
      python-dev \
      libldap2-dev \
      libsasl2-dev

TODO: do we also have to do::

   (Allan did not need to do this, already in requirements.txt)
   $ pip install python-ldap

TODO: do we have to install ldap-user

   sudo apt-get install ldap-user


TODO: What is different for Ubuntu 12.04 ?
 
TODO: Do we need to test Ubuntu 10.04 ?


Install Mongo
^^^^^^^^^^^^^^^

    $ sudo apt-get install mongodb

Note: the mongod process will by default try to use /data/db for its
database files.  We recommend using the --dbpath option to specify a
directory in your own home.  See start() method in fabfiles/server.py.

The first startup of mongod will take some time as it creates files in
the dbpath.  Unless these are deleted, subsequent startup times should
be much faster.


Install RabbitMQ
^^^^^^^^^^^^^^^^

Install from standard packages::

    $ sudo apt-get install rabbitmq-server


Sphinx autorun
^^^^^^^^^^^^^^^

TBD

Blockdiag family
^^^^^^^^^^^^^^^^^

TBD

CentOS
--------------------

Minimal initial requirements, git, python2.7, and virtualenv
installed.  If you don't have python2.7, see the manual installation
steps below.  The system will also need to be configure to use the
EPEL repo (for mongodb and rabbitmq).

Otherwise, create a virtualenv for cloudmesh, activate it, and run::

    $ pip install fabric

Then clone the cloudmesh repository::

    $ git clone https://github.com/cloudmesh/cloudmesh.git

Then run::

    $ cd cloudmesh && fab -f install.fabfile.py deploy

TODO: Explain how the user gets their cloudmesh.yaml file.

Assuming there are no errors, run::

    $ fab server.start


Manual installation
^^^^^^^^^^^^^^^^^^^

Assuming a basic CentOS 6.4 Server, install prerequsites::

    $ sudo yum install -y \
        git \
        wget \
        gcc \
        make \
        readline-devel \
        zlib-devel \
        openssl-devel \
        openldap-devel \
        bzip2-devel


Install Python
^^^^^^^^^^^^^^^

Cloudmesh requires python 2.7, and CentOS comes with Python 2.6.
However we cannot replace the system python as yum and other tools
depend on it, so we will configure it to install in /opt/python::

    $ wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz

Recommended: verify the md5 checksum, b4f01a1d0ba0b46b05c73b2ac909b1df for the above.::

    $ tar xzf Python-2.7.5.tgz
    $ cd Python-2.7.5
    $ configure --prefix=/opt/python && make
    $ sudo make install

Edit your ~/.bash_profile to add /opt/python/bin to the start of your
PATH, then log out and back in.

Install Python Virtualenv
^^^^^^^^^^^^^^^^^^^^^^^^^

Verify that python2.7 is active::

    $ python --version
    Python 2.7.5

If you see Python 2.6.6, fix your PATH to include /opt/python/bin before /usr/bin.::

    $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gzcd
    $ tar xfz virtualenv-1.10.1.tar.gz
    $ cd virtualenv-1.10.1.tar.gz
    $ sudo python setup.py install


Install Mongo
^^^^^^^^^^^^^^^
Intstall from EPEL packages::

    $ sudo yum install mongodb mongodb-server


Install RabbitMQ
^^^^^^^^^^^^^^^^

Intstall from EPEL packages::

    $ sudo yum install rabbitmq-server
    $ sudo service rabbitmq-server start


Sphinx autorun
^^^^^^^^^^^^^^^

TBD

Blockdiag family
^^^^^^^^^^^^^^^^^

TBD


Installing the source code
=============================

Create a virtualenv::

    $ virtualenv --no-site-packages cloudmesh_v

Note: the name of the virtualenv is your choice, it does not need to be called "cloudmesh_v."

Activate the vitrualenv::

    $ . cloudmesh_v/bin/activate

{'fraction_non_alphanumeric': 0.13421870584910991, 'fraction_numerical': 0.015823679005368747, 'mean_word_length': 3.14765625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '337320', 'n_tokens_mistral': 3557, 'n_tokens_neox': 3247, 'n_words': 1187}