wiki:SimulateCobalt
Last modified 8 years ago Last modified on 03/06/15 18:14:01

Setting up the Simulator

Note: Cobalt version 0.98.x requires python 2.5 and the tlslite python package

Cobalt version 0.99.0 to Current requires python 2.6 or python 2.7. tlslite is no longer used in favor of Python's openssl support.

Checkout from git, and set symlink

 git clone http://git.mcs.anl.gov/cobalt.git cobalt
 ln -s cobalt/src/lib cobalt/src/Cobalt

Add cobalt/src/ to $PYTHONPATH

The configuration file (cobalt.conf)

Set the environment variable $COBALT_CONFIG_FILE (Recommended)

or

Edit the DEFAULT_CONFIG_FILES variable in cobalt/src/lib/__init__.py to match the location of your cobalt.conf file,

Edit cobalt.conf as below (see cobalt/misc/cobalt.conf)

[bgpm]
mpirun: /path/to/cobalt/src/clients/brun.py

[cqm]
log_dir: /path/to/writable/dir

[bgsched]
utility_file: /path/to/empty/file

[statefiles]
location: /path/to/writable/dir

[components]
service-location=https://localhost:port

Generate cobalt.key and cobalt.cert

Using openssl generate a key and a cert file.

# openssl req -batch -x509 -nodes -subj "/C=US/ST=Illinois/L=Argonne/CN=$HOST" -days 1000 -newkey rsa:2048 -keyout /etc/cobalt.key -noout
# openssl req -batch -new -subj "/C=US/ST=Illinois/L=Argonne/CN=$HOST" -key /etc/cobalt.key | openssl x509 -req -days 1000 -signkey /etc/cobalt.key -out /etc/cobalt.cert

Edit the key variable in the [communication] section of cobalt.conf to point to cobalt.key

[communication]
key=/path/to/cobalt.key
cert=/path/to/cobalt.cert
ca=/path/to/cobalt.cert
password=password

password may be set to any string you wish.

The simulator component

The simulator component (brooklyn) reads in system information from an XML file. Use cobalt/misc/partitions.xml for reference.

ln -s cobalt/misc/partitions.xml cobalt/src/components/simulator.xml

You can also dump a valid xml machine representation from a running system using partadm.py

partadm.py --xml

Starting the Simulator

This is not necessary if you are planning on running the queue simulator, qsim.

Starting the simulator means starting the components as usual, replacing bgsystem with brooklyn in the startup sequence.

Using the init.d script

sh cobalt/misc/cobalt start-debug

Manually

cd cobalt/src/components
./slp.py & ./brooklyn.py & ./cqm.py & ./scriptm.py & ./bgsched.py &

Queue Simulator

See this page for info on qsim.