| 22 | |
| 23 | == Containerizing Your Experiment == |
| 24 | |
| 25 | The {{{containerize.py}}} program creates a DETER experiment made up of containers. There will generally be more containers than there are DETER nodes in your new experiment. The {{{containerize.py}}} program is available from {{{/share/containers/containerize.py}}} on {{{users.isi.deterlab.net}}}. A sample invocation is: |
| 26 | |
| 27 | {{{ |
| 28 | $ /share/containers/containerize.py MyProject MyExperiment ~/mytopology.tcl |
| 29 | }}} |
| 30 | |
| 31 | It will create a new experiment in {{{MyProject}}} called {{{MyExperiment}}} containing the experiment topology in {{{mytopology.tcl}}}. All the topology creation commands supported by DETER are supported by the conatainerization system, but systems like program agents are not. Start commands '''are''' supported. |
| 32 | |
| 33 | Either an ns2 file or a topdl experiment is supported. Ns2 descriptions must end with {{{.tcl}}} or {{{.ns}}}. Other files are assumed to be topdl descriptions. |
| 34 | |
| 35 | |
| 36 | By default, {{{containerize.py}}} program will partition the topology into openvz containers, packed 10 containers per physical computer. If the topology is already partitioned - at least one element has a {{{partition}}} atttribute - {{{containerize.py}}} will not partition it. Similarly, if container types have been assigned to nodes, {{{containerize.py}}} will respect them. |
| 37 | |
| 38 | It takes several parameters that can change its behavior: |
| 39 | |
| 40 | {{{--default-container}}}=''kind'':: |
| 41 | Containerize nodes without a container type into ''kind''. If no nodes have been assigned containers, this puts all them into ''kind'' containers. |
| 42 | {{{--force-partition}}}:: |
| 43 | Partition the experiment whether or not it has been paritioned already |
| 44 | {{{--packing=}}}''int'':: |
| 45 | Attempt to put ''int'' containers into each physical node. The default {{{--packing}}} is 10. |
| 46 | {{{--config=}}}''filename'':: |
| 47 | Read configuration variables from ''filename'' the configuration values are discussed below. |
| 48 | {{{--debug}}}:: |
| 49 | Print additional diagnostics |
| 50 | |
| 51 | This invocation: |
| 52 | |
| 53 | {{{ |
| 54 | $ ./containerize.py --packing 25 --default-container=qemu --force-partition DeterTest faber-packem ~/experiment.xml |
| 55 | }}} |
| 56 | |
| 57 | takes the topology in {{{~/experiment.xml}}} (which must be topdl), packs it into 25 qemu containers per physical node, and creates an experiment called DeterTest/faber-packem that can be swapped in. If {{{experiment.xml}}} were already partitioned, it will be re-partitioned. If some nodes in that topology were assigned to openvz nodes already, those nodes will be still be in openvz containers. |
| 58 | |
| 59 | The result of a successful {{containerize.py}}} run is a DETER experiment that can be swapped in. |
| 60 | |
| 61 | |