| 4 | |
| 5 | === HOWTO run neo-containers === |
| 6 | |
| 7 | 1. The neo-containers are started via a single script run on the {{{config}}} node. The script is on the {{{configdb}}} branch of the (existing) containers source repository. The script is {{{./bin/container_bootstrap.sh}}}. Checkout the containers repository and switch to the correct branch: |
| 8 | {{{ |
| 9 | users: > cd src |
| 10 | users: > git clone ssh://tardis.deterlab.net:/var/local/git/benito containers |
| 11 | users: > cd containers |
| 12 | users: > git checkout configdb |
| 13 | }}} |
| 14 | |
| 15 | 2. Create a containerized experiment with an NS file and the {{{/share/containers/containerize.py}}} script. The NS file should declare a {{{config}}} node as an embedded container that uses the {{{UB14-CHEF12}}} image. Use a snippet like so: |
| 16 | {{{ |
| 17 | set config [$ns node] |
| 18 | tb-set-node-os $config UB14-CHEF12 |
| 19 | tb-set-hardware $config container0 |
| 20 | tb-add-node-attribute $config containers:node_type "embedded_pnode" |
| 21 | }}} |
| 22 | The {{{UB14-CHEF12}}} image is not required, but speeds things up a bit. |
| 23 | For each container in the experiment, specify {{{image_os}}}, {{{image_type}}}, {{{mage_name}}}, and optionally an {{{image_url}}} via the {{{tb-add-node-attribute}}} syntax. Details on each attribute is given below. |
| 24 | |
| 25 | * {{{image_os}}} - This is really just to distinguish Windows from non-Windows nodes. If the {{{image_os}}} starts with "{{{windows}}}", the image will be treated as a Windows node. Otherwise it'll be assumed to be some sort of Unix-y container. |
| 26 | * {{{image_type}}} - This setting describes the containerization tech of the node. Currently this is *always* set to "{{{vagrant}}}" as Vagrant is the only package used to spin up the containers. |
| 27 | * {{{image_name}}} - The name of the image. The name identifies an OS, virtualization platform, and version. This name is based on the Vagrant naming scheme. The standard, "baked in" image names are: |
| 28 | * chef/centos-7.0 (virtualbox, 1.0.0) |
| 29 | * chef/freebsd-10.0 (virtualbox, 1.0.0) |
| 30 | * fgrehm/precise64-lxc (lxc, 1.2.0) |
| 31 | * fgrehm/trusty64-lxc (lxc, 1.2.0) |
| 32 | * hashicorp/precise64 (virtualbox, 1.1.0) |
| 33 | * liibvert/centos64 (libvirt, 0) |
| 34 | * ubuntu/precise64 (virtualbox, 12.04.4) |
| 35 | * ubuntu/trusty64 (virtualbox, 14.04) |
| 36 | So to create an Ubuntu 14.04 64 bit container, the name would be "{{{ubuntu/trusty64}}}". The only fully tested image is "ubuntu/trusty64". We are working on the LXC nodes. Each container that has the same name, will use a copy of the same container image. |
| 37 | * {{{image_url}}} - If the image name is not one of the baked in images above, a URL must be specified from which the neo-containers system can download the container image. This URL must be resolvable from the {{{config}}} experiment node. There is an existing tested Windows 7 image at {{{http://scratch/benito/deter_win7.box}}}. The image will only be downloaded once as long as the {{{image_name}}}s are the same for the containers. |
| 38 | |
| 39 | Here is an example Windows and Ubuntu 14.04 container: |
| 40 | {{{ |
| 41 | set r2d2 [$ns node] |
| 42 | tb-add-node-attribute $r2d2 containers:image_os windows |
| 43 | tb-add-node-attribute $r2d2 containers:image_type vagrant |
| 44 | tb-add-node-attribute $r2d2 containers:image_name deter/win7 |
| 45 | tb-add-node-attribute $r2d2 containers:image_url http://scratch/benito/deter_win7.box |
| 46 | |
| 47 | set c3po [$ns node] |
| 48 | tb-add-node-attribute $c3po containers:image_os ubuntu |
| 49 | tb-add-node-attribute $c3po containers:image_type vagrant |
| 50 | tb-add-node-attribute $c3po containers:image_name ubuntu/trusty64 |
| 51 | }}} |
| 52 | |
| 53 | 2. Use the NS file to create a containerized experiment using the existing containers scripts (on users): {{{/share/containers/containerize.py [group] [experiment] [ns file]}}} |
| 54 | 3. Modify the NS file generated by {{{containerize.py}}} to have a new image for the pnode machines. Navigate to the new experiment page and click {{{Modify Experiment}}}. Change the OS type of the pnodes to {{{PNODE_BASE}}} and the hardware type to {{{MicroCloud}}}. I.e. for each pnode in the NS file, make the lines have the form: |
| 55 | {{{ |
| 56 | tb-set-node-os ${pnode(0000)} PNODE-BASE |
| 57 | tb-set-hardware ${pnode(0000)} MicroCloud |
| 58 | }}} |
| 59 | Add the bootstrap script to the {{{config}}} node, so it's execute after boot. Add the following to the {{{config}}} node stanza in the NS file: |
| 60 | {{{ |
| 61 | tb-set-node-startcmd $config "~/src/containers/bin/container_bootstrap.sh" |
| 62 | }}} |
| 63 | (Of course have it match the path to your copy of the containers repository.) |
| 64 | 4. Swap in the experiment and wait a long time. There is no great way to tell when the containers are up, unfortunately. |
| 65 | |