Use RST document coding conventions

Change-Id: I98f8b006a614b827129d41ae808efb6ccced716b
This commit is contained in:
Mark Hamzy 2016-10-28 09:53:32 -05:00
parent 512fa17501
commit c6e60848aa
1 changed files with 72 additions and 74 deletions

View File

@ -9,42 +9,44 @@ Starting
Before starting the server for the first time, the createDB.py Before starting the server for the first time, the createDB.py
script must be run. script must be run.
To start the server: To start the server::
```bash
moltenirond-helper start moltenirond-helper start
```
To stop the server::
moltenirond-helper stop
To stop the server:
```bash
moltenirond-helper stop
```
MoltenIron client MoltenIron client
----------------- -----------------
Use the molteniron client (molteniron) to communicate with the server. For Use the molteniron client (molteniron) to communicate with the server. For
usage information type: usage information type::
```bash
molteniron -h molteniron -h
```
For usage of a specific command use::
molteniron [command] -h
For usage of a specific command use:
```bash
molteniron [command] -h
```
MoltenIron commands MoltenIron commands
------------------- -------------------
command | description +----------+---------------------------------------------+
------- | ----------- |command | description |
add | Add a node +----------+---------------------------------------------+
allocate | Allocate a node |add | Add a node |
release | Release a node |allocate | Allocate a node |
get_field | Get a specific field in a node |release | Release a node |
set_field | Set a specific field with a value in a node |get_field | Get a specific field in a node |
status | Return the status of every node |set_field | Set a specific field with a value in a node |
delete_db | Delete every database entry |status | Return the status of every node |
|delete_db | Delete every database entry |
+----------+---------------------------------------------+
Configuration of MoltenIron Configuration of MoltenIron
--------------------------- ---------------------------
@ -55,19 +57,21 @@ Configuration of MoltenIron is specified in the file conf.yaml.
the server. "C)" means that it is required only for the client. "S)" means the server. "C)" means that it is required only for the client. "S)" means
it is only required for the server. it is only required for the server.
usage | key | description +------+------------+----------------------------------------------------------+
----- | --- | ----------- |usage | key | description |
B) | mi_port | the port that the server uses to respond to commands. +------+------------+----------------------------------------------------------+
C) | serverIP | The IP address of the server. This is only used by |B) | mi_port | the port that the server uses to respond to commands. |
| | clients. |C) | serverIP | The IP address of the server. This is only used by |
S) | maxTime | The maximum amount of time, in seconds, that a node | | | clients. |
| | is allowed to be allocated to a particular BM node. |S) | maxTime | The maximum amount of time, in seconds, that a node |
S) | logdir | The path to the directory where the logs should be | | | is allowed to be allocated to a particular BM node. |
| | stored. |S) | logdir | The path to the directory where the logs should be |
S) | maxLogDays | The amount of time, in days, to keep old logs. | | | stored. |
S) | sqlUser | The username to use for the MI server. This user |S) | maxLogDays | The amount of time, in days, to keep old logs. |
| | will automatically be generated when createDB.py is run. |S) | sqlUser | The username to use for the MI server. This user |
S) | sqlPass | The password of sqlUser | | | will automatically be generated when createDB.py is run. |
|S) | sqlPass | The password of sqlUser |
+------+------------+----------------------------------------------------------+
Running testcases Running testcases
----------------- -----------------
@ -76,55 +80,49 @@ The suite of testcases is checked by tox. But, before you can run tox, you
need to change the local yaml configuration file to point to the log need to change the local yaml configuration file to point to the log
directory. directory.
```bash (LOG=$(pwd)/testenv/log; sed -i -r -e 's,^(logdir: )(.*)$,\1'${LOG}',' conf.yaml; rm -rf testenv/; tox -e testenv)
(LOG=$(pwd)/testenv/log; sed -i -r -e 's,^(logdir: )(.*)$,\1'${LOG}',' conf.yaml; rm -rf testenv/; tox -e testenv)
```
Running inside a Continuous Integration environment Running inside a Continuous Integration environment
--------------------------------------------------- ---------------------------------------------------
During the creation of a job, add the following snippet of bash code: During the creation of a job, in the pre_test_hook.sh, add the following snippet of bash code::
```bash # Setup MoltenIron and all necessary prerequisites.
# Setup MoltenIron and all necessary prerequisites. # And then call the MI script to allocate a node.
# And then call the MI script to allocate a node. (
( REPO_DIR=/opt/stack/new/third-party-ci-tools
REPO_DIR=/opt/stack/new/third-party-ci-tools MI_CONF_DIR=/usr/local/etc/molteniron/
MI_CONF_DIR=/usr/local/etc/molteniron/ MI_IP=10.1.2.3 # @TODO - Replace with your IP addr here!
MI_IP=10.1.2.3 # @TODO - Replace with your IP addr here!
# Grab molteniron and install it # Grab molteniron and install it
git clone https://git.openstack.org/openstack/third-party-ci-tools ${REPO_DIR} || exit 1 git clone https://git.openstack.org/openstack/third-party-ci-tools ${REPO_DIR} || exit 1
cd ${REPO_DIR}/nodepool/molteniron cd ${REPO_DIR}/nodepool/molteniron
# @BUG Install prerequisite before running pip to install the requisites # @BUG Install prerequisite before running pip to install the requisites
hash mysql_config || sudo apt install -y libmysqlclient-dev hash mysql_config || sudo apt install -y libmysqlclient-dev
# Install the requisites for this package # Install the requisites for this package
sudo pip install --upgrade --force-reinstall --requirement requirements.txt sudo pip install --upgrade --force-reinstall --requirement requirements.txt
# Run the python package installation program # Run the python package installation program
sudo python setup.py install sudo python setup.py install
if [ -n "${MI_IP}" ] if [ -n "${MI_IP}" ]
then then
# Set the molteniron server IP in the conf file # Set the molteniron server IP in the conf file
sudo sed -i "s/127.0.0.1/${MI_IP}/g" ${MI_CONF_DIR}/conf.yaml sudo sed -i "s/127.0.0.1/${MI_IP}/g" ${MI_CONF_DIR}/conf.yaml
fi fi
export dsvm_uuid export dsvm_uuid
# NOTE: dsvm_uuid used in the following script, hence the -E # NOTE: dsvm_uuid used in the following script, hence the -E
sudo -E ${REPO_DIR}/nodepool/molteniron/utils/test_hook_configure_mi.sh sudo -E ${REPO_DIR}/nodepool/molteniron/utils/test_hook_configure_mi.sh
) || exit $? ) || exit $?
```
and change the MI_IP environment variable to be your MoltenIron server! and change the MI_IP environment variable to be your MoltenIron server!
During the destruction of a job, add the following snippet of bash code: During the destruction of a job, in the post_test_hook.sh, add the following snippet of bash code::
```bash DSVM_UUID="$(</etc/nodepool/uuid)"
DSVM_UUID="$(</etc/nodepool/uuid)" echo "Cleaning up resources associated with node: ${DSVM_UUID}"
echo "Cleaning up resources associated with node: ${DSVM_UUID}" molteniron release ${DSVM_UUID}
molteniron release ${DSVM_UUID}
```