<commit_before>**HaaS**
========

HaaS is a low-level tool for reserving physical machines and connecting
them via isolated networks. It does not prescribe a particular
method for imaging/managing said machines, allowing the user to use
any solution of their choosing.

HaaS keeps track of available resources in a database, which a system
administrator must populate initially. 

**This includes information such as:**

- What machines are available
- What network interfaces they have
- Where those NICs are connected (what port on what switch)

**From there, a regular user may:**

- Reserve physical machines
- create isolated logical networks
- create "headnodes," which are small virtual machines usable for
  management/provisioning purposes
- connect network interfaces belonging to physical and/or headnodes to
  logical networks.

**A typical user workflow might look like:**

1. Reserve some machines.
#. Create a logical "provisioning" network.
#. Connect each machine's IPMI controller to said network.
#. Create a headnode, and attach it to the provisioning network
#. Log in to the headnode, and use IPMI to deploy some image/operating
   system onto the nodes.

This is only an example; mechanisms other than IPMI could be used
for power cycling, booting, and provisioning machines.

HaaS is still in a very early alpha stage of development, and isn't
production ready yet.

**Hacking**
===========

This project is part of the larger Massachusetts Open Cloud, for list
of authors, description of the team, workflow, ... look here_  

There's some assorted documentation in the `doc/` directory.

.. _here: https://github.com/CCI-MOC/moc-public/blob/master/README.md

**Getting Started**
===================


The first time you start working in the repository, set up a clean test
environment::

  virtualenv .venv

Next, each time you start working, enter the environment::

  source .venv/bin/activate

The first time you enter the environment, install the ``haas`` code and all
its dependencies into the virtual environment::

  pip install -e .

On systems with older versions of ``pip``, such as Debian Wheezy and Ubuntu
12.04, this install will fail with the following error::

  AttributeError: 'NoneType' object has no attribute 'skip_requirements_regex'

Fix this by upgrading ``pip`` within the virtual environment::

  pip install --upgrade pip

Versions of python prior to 2.7 don't have importlib as part of their
standard library, but it is possible to install it separately. If you're
using python 2.6 (which is what is available on CentOS 6, for example),
you may need to run::

  pip install importlib


**Testing the HaaS**
====================<commit_msg>Add info re: moc-rest dependency to README.<commit_after>**HaaS**
========

HaaS is a low-level tool for reserving physical machines and connecting
them via isolated networks. It does not prescribe a particular
method for imaging/managing said machines, allowing the user to use
any solution of their choosing.

HaaS keeps track of available resources in a database, which a system
administrator must populate initially. 

**This includes information such as:**

- What machines are available
- What network interfaces they have
- Where those NICs are connected (what port on what switch)

**From there, a regular user may:**

- Reserve physical machines
- create isolated logical networks
- create "headnodes," which are small virtual machines usable for
  management/provisioning purposes
- connect network interfaces belonging to physical and/or headnodes to
  logical networks.

**A typical user workflow might look like:**

1. Reserve some machines.
#. Create a logical "provisioning" network.
#. Connect each machine's IPMI controller to said network.
#. Create a headnode, and attach it to the provisioning network
#. Log in to the headnode, and use IPMI to deploy some image/operating
   system onto the nodes.

This is only an example; mechanisms other than IPMI could be used
for power cycling, booting, and provisioning machines.

HaaS is still in a very early alpha stage of development, and isn't
production ready yet.

**Hacking**
===========

This project is part of the larger Massachusetts Open Cloud, for list
of authors, description of the team, workflow, ... look here_  

There's some assorted documentation in the `doc/` directory.

.. _here: https://github.com/CCI-MOC/moc-public/blob/master/README.md

**Getting Started**
===================


The first time you start working in the repository, set up a clean test
environment::

  virtualenv .venv

Next, each time you start working, enter the environment::

  source .venv/bin/activate

The HaaS has an unspecified dependency on the ``moc-rest`` library:

.. https://github.com/cci-moc/moc-rest

The recommended way for developers to satisfy this is to clone that repository,
and then (while in the virtual environment)::

  pip install -e ${path_to_moc_rest_clone}

Next, proceed with installing the HaaS and the rest of its dependencies into
the virtual environment::

  pip install -e .

On systems with older versions of ``pip``, such as Debian Wheezy and Ubuntu
12.04, this install will fail with the following error::

  AttributeError: 'NoneType' object has no attribute 'skip_requirements_regex'

Fix this by upgrading ``pip`` within the virtual environment::

  pip install --upgrade pip

Versions of python prior to 2.7 don't have importlib as part of their
standard library, but it is possible to install it separately. If you're
using python 2.6 (which is what is available on CentOS 6, for example),
you may need to run::

  pip install importlib


**Testing the HaaS**
====================
{'fraction_non_alphanumeric': 0.08252512784341386, 'fraction_numerical': 0.0035267148651031564, 'mean_word_length': 4.3763033175355455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '1135035', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1428, 'n_words': 782}