Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

DOCS MATTER! #951

Merged
merged 23 commits into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
Abishek Raju <abishek.raju@gmail.com>
Amin Mosayyebzadeh <mosayyeb@bu.edu>
Andrew Mohn <AndrewMohn@gmail.com>
George Silvis, III <george.iii.silvis@gmail.com>
Ian Ballou <ianballou67@gmail.com>
Ian Denhardt <ian@zenhack.net>
Igibek Koishybayev <koishybayev.igibek@gmail.com>
Jay Hennessey <henn@users.sourceforge.net>
(Jethro) Shuwen Sun <http://orcid.org/0000-0001-6811-8310>
Jonathan Bell <jbell@bu.edu>
Kristi Nikolla <knikolla@massopen.cloud>
Kyle Hogan <klhogan@bu.edu>
Logan Bernard <bernard.logan4@gmail.com>
Lucas Xu <xuh@massopen.cloud>
Naved Ansari <naved001@gmail.com>
Orran Krieger <okrieg@yahoo.com>
Peter Desnoyers <pjd@ccs.new.edu>
Ritesh Singh <ritesh277coe@gmail.com>
Expand Down
98 changes: 47 additions & 51 deletions docs/INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Prerequisite Software
HIL requires a number of packages available through the CentOS RPM
repositories, as well as the EPEL repository. EPEL can be enabled via::

yum install epel-release
$ yum install epel-release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh boy, you went through all the trouble of adding the $ sign everywhere. Sorry I wasn't paying attention that you were taking this up. But if you think about it putting the dollar sign kinda makes it harder to copy and paste it. Earlier, I could triple click and copy the whole line and paste it into a terminal, but with this I would have to remove the dollar sign each time. :(

Don't make this change yet, maybe I copy paste wrong and what you are doing is right. I want to hear from other reviewers or whoever suggested putting the dolla sign there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't make this change yet,

I mean, don't undo your changes yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hah, thought we had a conclusion on that issue.
@shwsun ping~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand the debate. It is convention to have a $ denote that it is a command rather something that you should put into a file. We need to distinguish things should be in the config file from commands we want users to run.

@xuhang57 thank you for your time to clean the HIL doc. While you are at it, could you fix this too? It annoys me a while.

Copy link
Contributor Author

@xuhang57 xuhang57 Feb 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shwsun sure, "user needS" and export before each line? That's all right?
@naved001 once we have a conclusion, I will change the docs accordingly.
ping @zenhack @Izhmash @SahilTikale

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand the debate. It is convention to have a $ denote that it is a command rather something that you should put into a file.

I guess I am not a fan of that convention then, for the reasons I mentioned in my comment.

We need to distinguish things should be in the config file from commands we want users to run.

I don't know, but I feel it's apparent from the context and that the fact that we mention on top of the block of lines if it goes into a file.

In any case, I'll wait to hear what others have to say; but now I am inclined to follow the convention just because that's the convention.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Izhmash @zenhack @SahilTikale @knikolla anyone want to weigh in?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion, but my inclination is to include the $, as these are meant to be instructions, not a script -- we should be optimizing for understanding, not copy & paste. The $ is conventional and provides a useful cue to the reader, even if we do mention above that it's a shell command.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am used to seeing $ when reading documentation. It helps when you need to quickly scan through a wall of text to piece out what needs to be run in the terminal.


Then, the rest of the packages can be installed via::

yum install libvirt bridge-utils ipmitool telnet httpd mod_wsgi python-pip qemu-kvm python-virtinst virt-install python-psycopg2 vconfig net-tools
$ yum install libvirt bridge-utils ipmitool telnet httpd mod_wsgi python-pip qemu-kvm python-virtinst virt-install python-psycopg2 vconfig net-tools

In addition, HIL depends on a number of python libraries. Many of these are
available as RPMs as well, but we recommend installing them with pip, since
Expand All @@ -35,7 +35,7 @@ The setup described in this document runs into problems with SELinux. In the
future, we hope to ship a set of SELinux security policies with HIL, but for
now the solution is to disable SELinux::

sudo setenforce 0
$ sudo setenforce 0

Make sure SELinux is also disabled on startup. To do this `on
CentOS/RHEL <https://wiki.centos.org/HowTos/SELinux>`_, edit
Expand All @@ -48,46 +48,42 @@ to
SELINUX=permissive
```

User need to choose appropriate values for their environment:
User needs to choose appropriate values for their environment:
-------------------------------------------------------------

For simplicity we have provided default values:
Copy the following lines in file ``hil_env``

HIL_USER=hil
export HIL_USER=hil

HIL_DB_ROLE=hil
export HIL_ADMIN=hil

HIL_DB_PASSWORD=secret
export HIL_ADMIN_PASSWORD=secret

HIL_ADMIN=hil

HIL_ADMIN_PASSWORD=secret

HIL_HOME_DIR=/var/lib/hil
export HIL_HOME_DIR=/var/lib/hil



Before starting this procedure do::

source hil_env
$ source hil_env


Setting up system user for HIL:
--------------------------------

First create a system user ``${HIL_USER}`` with::

sudo useradd --system ${HIL_USER} -d /var/lib/hil -m -r
$ sudo useradd --system ${HIL_USER} -d /var/lib/hil -m -r


The HIL software itself can then be installed as root by running::

sudo su -
cd /root
git clone https://github.com/CCI-MOC/hil
cd hil
sudo python setup.py install
$ sudo su -
$ cd /root
$ git clone https://github.com/CCI-MOC/hil
$ cd hil
$ python setup.py install


hil.cfg
Expand Down Expand Up @@ -115,12 +111,12 @@ permissions should be set to read-only and ownership set to ``${HIL_USER}``
From source directory of hil as user root do the following::

(from /root/hil)
cp examples/hil.cfg /etc/hil.cfg
chown ${HIL_USER}:${HIL_USER} hil.cfg
chmod 400 hil.cfg
$ cp examples/hil.cfg /etc/hil.cfg
$ chown ${HIL_USER}:${HIL_USER} hil.cfg
$ chmod 400 hil.cfg
(run following command as ${HIL_USER} from ${HIL_HOME_DIR}
su - ${HIL_USER}
ln -s /etc/hil.cfg .
$ su - ${HIL_USER}
$ ln -s /etc/hil.cfg .

Authentication and Authorization
--------------------------------
Expand Down Expand Up @@ -175,14 +171,14 @@ provides one way to accomplish this.
To create the database tables, first make sure ``hil.cfg`` is set up the way
you need, including any extensions you plan to use, then::

sudo -i -u ${HIL_USER}; hil-admin db create
$ sudo -i -u ${HIL_USER}; hil-admin db create

If the authorization backend activated in ``hil.cfg`` is ``hil.ext.auth.database =``
then you will need to add an initial user with administrative privileges to the
database in order to bootstrap the system.
You can do this by running the following command (as user ``hil``)::

sudo -i -u ${HIL_USER}; hil create_admin_user ${HIL_ADMIN_USER} ${HIL_ADMIN_PASSWORD}
$ sudo -i -u ${HIL_USER}; hil create_admin_user ${HIL_ADMIN_USER} ${HIL_ADMIN_PASSWORD}

You can then create additional users via the HTTP API. You may want to
subsequently delete the initial user; this can also be done via the API.
Expand All @@ -191,7 +187,7 @@ subsequently delete the initial user; this can also be done via the API.

All HIL commands in these instructions should be run in this directory::

cd /var/lib/hil
$ cd /var/lib/hil

Networking - Bridges
--------------------
Expand Down Expand Up @@ -241,21 +237,21 @@ Starting the service:
^^^^^^^^^^^^^^^^^^^^^

Following commands will start the daemon:
``systemctl daemon-reload``
``systemctl start create_bridges.service``
``$ systemctl daemon-reload``
``$ systemctl start create_bridges.service``

You can check the status using:
``systemctl status create_bridges.service``
``$ systemctl status create_bridges.service``

To auto-start the service on boot (recommended):
``systemctl enable create_bridges.service``
``$ systemctl enable create_bridges.service``

For systems that do not support systemd:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can add the following line::

(cd /etc && create_bridges)
($ cd /etc && create_bridges)

to the end of ``/etc/rc.local``.

Expand All @@ -280,16 +276,16 @@ uncomment the following lines::

Then create the group 'libvirt' and add the HIL user to that group::

sudo groupadd libvirt
sudo gpasswd libvirt -a hil
$ sudo groupadd libvirt
$ sudo gpasswd libvirt -a hil

Finally, restart ``libvirt`` with::

sudo service libvirtd restart
$ sudo service libvirtd restart

You should also set libvirt to start on boot::

sudo chkconfig libvirtd on
$ sudo chkconfig libvirtd on

Headnode image
^^^^^^^^^^^^^^
Expand All @@ -312,8 +308,8 @@ The directory specified by path must already exist, and be readable and
writable by the ``libvirt`` user. Then activate the pool, and make the it
activate on boot, with::

virsh --connect qemu:///system pool-start hil_headnodes
virsh --connect qemu:///system pool-autostart hil_headnodes
$ virsh --connect qemu:///system pool-start hil_headnodes
$ virsh --connect qemu:///system pool-autostart hil_headnodes

The scripts in ``examples/cloud-img-with-passwd`` can be used to build
an ubuntu 14.04 or centos 7 disk image with a default root password. Read
Expand All @@ -322,11 +318,11 @@ the README in that directory for more information.
Once the disk image is built, copy ito the storage pool directory (here we
assume it is called ``base.img``)::

mv base.img /var/lib/libvirt/images/
$ mv base.img /var/lib/libvirt/images/

Finally, create the base headnode with::

virsh --connect qemu:///system define base.xml
$ virsh --connect qemu:///system define base.xml

where ``base.xml`` contains a description of the headnode::

Expand Down Expand Up @@ -423,18 +419,18 @@ following directive will have to be turned on

If you haven't already, create the directory that will contain the HIL WSGI module::

sudo mkdir /var/www/hil/
$ sudo mkdir /var/www/hil/

Copy the file ``hil.wsgi`` from the top of the hil source tree to the
location indicated by the ``WSGIScriptAlias`` option. The virtual host and
server name should be set according to the hostname (and port) by which clients
will access the api. Then, restart Apache::

sudo service httpd restart
$ sudo service httpd restart

You should also set apache to start on boot::

sudo chkconfig httpd on
$ sudo chkconfig httpd on

Running the network server:
---------------------------
Expand Down Expand Up @@ -465,14 +461,14 @@ Starting the service:
---------------------

Following commands will start the daemon:
``systemctl daemon-reload``
``systemctl start hil_network``
``$ systemctl daemon-reload``
``$ systemctl start hil_network``

You can check the status using:
``systemctl status hil_network``
``$ systemctl status hil_network``

To auto-start the service on boot:
``systemctl enable hil_network``
``$ systemctl enable hil_network``


For systems that do not support systemd:
Expand All @@ -482,11 +478,11 @@ It uses "Upstart" an equivalent of systemd to manage its daemons/processes.

For such systems, the networking server may be started as the HIL user by running::

hil serve_networks &
$ hil serve_networks &

To make this happen on boot, add the following to ``/etc/rc.local``::

(cd /var/lib/hil && su hil -c 'hil serve_networks') &
($ cd /var/lib/hil && su hil -c 'hil serve_networks') &


HIL Client:
Expand All @@ -506,8 +502,8 @@ Create a file ``client_env`` with following entries::

To get started with HIL from your home dir do the following::

source client_env
hil list_nodes all
$ source client_env
$ hil list_nodes all

If you get an empty list ``[]`` as output then congratulations !!
At this point, you should have a functional HIL service running!
Expand Down
Loading