VILLASframework
Modular co-simulation framework
Usage

VILLAScontroller consist of two parts:

  • A daemon which listens for control commands from an AMQP broker and controls the simulator.
  • A CLI tool for sending commands to the broker

Both parts are accessible from the villas-controller command.

Quickstart

  1. Install VILLAScontroller
$ git clone git@git.rwth-aachen.de:acs/public/villas/controller.git
$ sudo python3 setup.py install
  1. Start RabbitMQ broker
$ docker run -p 5672:5672 -p 15672:15672 -d rabbitmq:management
  1. Create configuration file: config.json:
{
"broker" : {
"url" : "amqp://guest:guest@localhost/%2F"
},
"components" : [
{
"name" : "Dummy Simulator #1",
"type" : "dummy",
"realm" : "de.rwth-aachen.eonerc.acs",
"uuid" : "e15f5ad4-041f-11e8-9bf3-23372608bf60",
"location" : "Steffen's Laptop",
"owner" : "svo"
},
{
"name" : "Dummy Simulator #2",
"type" : "dummy",
"realm" : "de.rwth-aachen.eonerc.acs",
"uuid" : "ef6f6e46-044e-11e8-812f-17b6617a2f37",
"location" : "Markus' Laptop",
"owner" : "mgr"
}
]
}
  1. Start VILLAScontroller daemon:
$ villas-controller --config config.json daemon
  1. Start monitor:
$ villas-controller monitor

Note: If you have jq installed, you might want to add | jq . to the end for pretty printing the JSON messages.

  1. Discover / ping simulators:
$ villas-controller simulator ping
  1. Send commands to VILLAScontroller daemon:

Note: Take the UUID from step 5.

$ villas-controller simulator --uuid ef6f6e46-044e-11e8-812f-17b6617a2f37 start
$ villas-controller simulator --uuid ef6f6e46-044e-11e8-812f-17b6617a2f37 pause
$ villas-controller simulator --uuid ef6f6e46-044e-11e8-812f-17b6617a2f37 resume
$ villas-controller simulator --uuid ef6f6e46-044e-11e8-812f-17b6617a2f37 stop

Example: Kubernetes

MANAGER_UUID=614dc3d3-6825-47d3-b991-05d082eb2494
SIMULATOR_UUID=9afeebf4-825a-45cd-bd25-1b6c219ed72a

Create simulator

$ villas-controller --config etc/config_k8s.yaml simulator --uuid ${MANAGER_UUID} create --parameters-file etc/params_k8s_create.yaml

Start job/simulation

$ villas-controller --config etc/config_k8s.yaml simulator --uuid ${SIMULATOR_UUID} start