scenario_file_format
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
scenario_file_format [2017/09/01 09:07] – created mimbert | scenario_file_format [2023/08/29 15:29] (current) – Add example of passive keyword in new syntax cmorin | ||
---|---|---|---|
Line 1: | Line 1: | ||
The scenario of a minus task is a file named '' | The scenario of a minus task is a file named '' | ||
- | The syntax of the file is [YAML](http:// | + | ====== Syntax ====== |
+ | |||
+ | The syntax of the file is [YAML](http:// | ||
Please bear in mind that YAML is indentation sensitive, just like python. YAML will follow whatever indentation system the scenario file uses, provided that it is consistent within the file. Note that in particular you should not mix spaces and tabs (beware, some text editors do that silently and need to be properly configured to avoid that). The suggested best practice is to use two spaces for indentation. | Please bear in mind that YAML is indentation sensitive, just like python. YAML will follow whatever indentation system the scenario file uses, provided that it is consistent within the file. Note that in particular you should not mix spaces and tabs (beware, some text editors do that silently and need to be properly configured to avoid that). The suggested best practice is to use two spaces for indentation. | ||
+ | |||
+ | Comments in YAML start with a ''#'' | ||
+ | |||
+ | The syntax of a yaml file may be checked with http:// | ||
+ | ====== Grammar ====== | ||
+ | |||
+ | We're progressively adding new capabilities to the CorteXlab platform. There is now two different syntaxes for the scenario file, the legacy syntax, where commands are run on the nodes, and the new syntax, where [[docker|docker]] containers are run on the nodes. Both syntaxes are allowed, even in the same scenario, but only one syntax is allowed per-node. | ||
+ | |||
+ | The scenario.yaml file is structured as follows: | ||
+ | * It //MUST// contain a '' | ||
+ | * It //MUST// contain a '' | ||
+ | * It //MUST// contain a '' | ||
+ | * Nodes key, value pairs, whose keys are the node names (in the set '' | ||
+ | * which //MUST// contain **//ONLY ONE//** of the following: | ||
+ | * **(new syntax)** a '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * **(old syntax)** a '' | ||
+ | nodes: | ||
+ | node1: | ||
+ | command: | ||
+ | - sleep 10000 | ||
+ | - ./my_script | ||
+ | </ | ||
+ | * which //MAY// contain a '' | ||
+ | |||
+ | An example scenario (new syntax):< | ||
+ | description: | ||
+ | duration: 120 | ||
+ | nodes: | ||
+ | node3: | ||
+ | container: | ||
+ | - image: m1mbert/ | ||
+ | - image: m1mbert/ | ||
+ | command: / | ||
+ | node4: | ||
+ | container: | ||
+ | image: m1mbert/ | ||
+ | passive: true | ||
+ | </ | ||
+ | |||
+ | An example scenario (old syntax):< | ||
+ | description: | ||
+ | duration: 60 | ||
+ | nodes: | ||
+ | node1: | ||
+ | command: sleep 1000 | ||
+ | # a bash command | ||
+ | passive: true | ||
+ | node2: | ||
+ | command: ./myscript | ||
+ | # relative path to a script embedded in the task | ||
+ | node3: | ||
+ | command: gnuradio-config-info -v | ||
+ | # calling a gnuradio executable which is in the $PATH | ||
+ | node4: | ||
+ | command: / | ||
+ | # absolute path to a script or binary | ||
+ | </ | ||
+ |
scenario_file_format.1504249664.txt.gz · Last modified: 2017/09/01 09:07 by mimbert