296 | | |
297 | | |
| 296 | == Generating and Using TopDL Descriptions == |
| 297 | |
| 298 | [TopDl TopDL] is the XML-encoded layout description language that the federation system uses internally. While ns2/tcl can be shorter and easier to generate - especially by human programmers - it can be very difficult for tools to deal with. In particular, because each ns2 description is a program in a Turing-complete interpreted language, extracting the layout for analysts or presentation requires running the program. Translation of XML is much less computationally expensive and presents fewer security concerns. |
| 299 | |
| 300 | The [FeddCommands#fedd_create.py fedd_create.py] command will take either a topdl or an ns2 description. To get topdl description from an ns2 description, one can use the [FeddCommands#fedd_ns2topdl.py fedd_ns2topdl.py] command. Note that this command must contact an [NewFeddAbout#TheExperimentController experiment controller] to do the conversion. DETERLab's experiment controller at !https://users.isi.deterlab.net:23235 provides this service. Running {{{fedd_ns2topdl.py}}} on that machine contacts the experiment controller by default. |
| 301 | |
| 302 | Converting the [attachment:federation1.tcl experiment layout we used above] into topdl is done by running this command on {{{users.isi.deterlab.net}}}: |
| 303 | |
| 304 | {{{ |
| 305 | fedd_ns2topdl.py --file federation1.tcl --out federation1.xml |
| 306 | }}} |
| 307 | |
| 308 | The contents of [attachment:federation1.xml federation1.xml], run through an XML formatter, are attached. The topDL representation is much more verbose, but encodes the same information about layout. |
| 309 | |
| 310 | The information it does not encode is the [NewFeddAbout#ExperimentServices service] information. When using the topdl representation, services have to be passed to [FeddCommands#fedd_create.py fedd_create.py] using the {{{--service}}} parameter, like so: |
| 311 | |
| 312 | {{{ |
| 313 | users:~$ fedd_create.py --service project_export:deter/exp1::project=TIED --service project_export:deter/exp2::project=TIED --file federation1.xml --experiment_name fed2 |
| 314 | localname: fed2 |
| 315 | fedid: 4758ff5a8b20ec1a54ea59f84e1eaaf60ee39cf9 |
| 316 | status: starting |
| 317 | }}} |
| 318 | |
| 319 | The two formats are generally interchangeable using federation tools, though some external tools will prefer one or the other. |