docmalloc / gplmt

GNU Affero General Public License v3.0
1 stars 0 forks source link

parametrized run elements #15

Closed docmalloc closed 8 years ago

docmalloc commented 8 years ago

We need support for parameterized run elements to execute the same command on the same target in different variations.

Use case: We have a controller C creating tunnels to PlanetLab nodes using a cmd line tool "tunnel". We have the set of planetlab nodes available and we have to execute the cmd line tool with the different nodes:

nodes=[a,b,c,d] C$ tunnel a C$ tunnel b C$ tunnel c

for n in nodes: run ("tunnel", "a")

docmalloc commented 8 years ago

Perhaps we could have like an additional section to define such parameters:

and extend run with somethin like

run = element run { start_time?, stop_time?, element command { text }, element command_arguments { text }, element execution_order {text}, element timeout { xsd:integer }, element expected_return_code { xsd:integer }, element expected_output { text }, element stop_on_fail { xsd:boolean } } for n in nodes: run ("tunnel", "--destination $argsrc")
docmalloc commented 8 years ago

Use case: We want to run gplmt in a loop: same experiment with slightly different arguments for run-commands. We have to establish tunnels to two PlanetLab nodes, so we have different hostnames in every loop iteration. In our case environment variables seem to be a great solution..

Therefore pseudocode is:

nodes = get_planetlab_nodes() pairs = create_pairs(nodes) foreach p in pairs: export n1 = p.node1 export n2 = p.node2 ./gplmt-lite.py experiment.xml

with experiment.xml

"tunnel $n1" "tunnel $n2"
FlorianDold commented 8 years ago

I believe this is now solved with being able to pass environment variables, which may depend on the target.