User:JeffKelley/Automating grid management

THIS IS A DRAFT

Here is one of many solutions to manage a Linux grid from one unique bin folder.

OpenSim configuration
First, we parametrize our configuration files to use shell environment variables. We will use only one variable named SIMULATOR. The expression ${Environment|SIMULATOR} can then be used in various parts of OpenSim.ini and GridCommon.ini.

With such a configuration, the listening port for simulator N will be 900N. [ Note: We assume a one-digit simulator number. If you need more than 10 simulators, you may use 90${Environment|SIMULATOR} and pass a two-digit SIMULATOR variable. ] The regions file for simulator N is located inside path_to_regions/simulN, so you should have this structure on disk :

path_to_regions simul1 Regions.ini simul2 Regions.ini ......

If you are using separate databases for each simulator (this is a design choice), then you can parametrize the ConnectionString in GridCommon.ini this way :

Using GNU screen
At the hearth of the management system is the launch script. We take care to label each session with the -S option.

Launching the grid is a matter of issuing this sequence of commands :

launch robust launch simul1 launch simul2 .............

Then:

This is not very friendly, so we write the procs script

Then:

Automating
Create a file named proclist:

It is easy now to write a couple of scripts that launch the next wanted process, or re-attach the next detached process.

Script s :

Script r :

Starting your grid is now as simple as opening as many terminals as you have grid processes and typing s in each. This can be further automated by having a cron job calling s every minute. The job will launch any missing process from proclist. As an added benefit, it will relaunch crashed simulators.

Adding a simulator
Add a line to proclist

Create a folder path_to_regions/simul7 and put the Regions.ini inside.

That's all.