Maestro is a tool that uses paramiko to control all the nodes and hub of the Sentinel network at the same time.
- Create a new virtual environment:
virtualenv venv
- Activate it:
source venv/bin/activate
- Install the dependencies:
pip install -r requirements.txt
To run maestro
, you need to give it a configuration file that contains the list of all the devices it should connect to, as well as where to find the needed application folders on eadch of them. Premade config files are stored in the maestro/configs
folder.
Important: the config file name should correspond to a folder in the experiments/
folder of the Scheduler install of the hub. This is unwieldy as it was patched together quite quickly. Ideally, this would be replaced by an option in the maestro
config file that specifies which experimental folder should be used.
-
Make sure the hub and each node are accessible over SSH from this machine, using a single SSH key.
-
cd
into themaestro
folder. -
Run
MAESTRO_CONFIG=configs.$CONFIG_NAME python run.py
, where$CONFIG_NAME
is the name of the Python config file, without its.py
extention
The run.py
performs the following tasks:
- Connect to the nodes and hub
- Start the nodes Sentinel application
- Start the nodes IoT device handlers
- Start the hub Sentinel application
- Start the hub Scheduler application
- Wait until the Scheduler process is done
- Kill all started processes and terminate
If you want to run a single shell command on a set of devices (e.g. to upgrade packages), you can use the command.py
file. This file connects to the nodes, and executes the shell command that is written in the Python file.