Changes between Version 7 and Version 8 of NeoContainers


Ignore:
Timestamp:
Jul 13, 2015 10:35:03 AM (9 years ago)
Author:
Geoff Lawler
Comment:

HOWTO section added.

Legend:

Unmodified
Added
Removed
Modified
  • NeoContainers

    v7 v8  
    22
    33The neo-containers system uses cloud-container technology to abstract and generalize container creation and initialization.  There is a per-experiment control node that centralizes configuration details. At the DETER level, the experiments have the control node and a number of "pnodes" which serve as hosts for the virtualized containers. The control node configures the pnodes as well as the containerized nodes as well as itself.  The bootstrap script is run on the control node and: 1) installs configuration software on itself, 2) updates its own configuration, 3) updates the configuration of the other physical nodes (which includes virtual networking and starting virtual machines), 4) give configuration information to virtual nodes and allows them to configuration themselves.
     4
     5=== HOWTO run neo-containers ===
     6
     71. 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{{{
     9users: > cd src
     10users: > git clone ssh://tardis.deterlab.net:/var/local/git/benito containers
     11users: > cd containers
     12users: > git checkout configdb
     13}}}
     14
     152. 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{{{
     17set config [$ns node]
     18tb-set-node-os $config UB14-CHEF12
     19tb-set-hardware $config container0
     20tb-add-node-attribute $config containers:node_type "embedded_pnode"
     21}}}
     22The {{{UB14-CHEF12}}} image is not required, but speeds things up a bit.
     23For 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)
     36So 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
     39Here is an example Windows and Ubuntu 14.04 container:
     40{{{
     41set r2d2 [$ns node]
     42tb-add-node-attribute $r2d2 containers:image_os windows
     43tb-add-node-attribute $r2d2 containers:image_type vagrant
     44tb-add-node-attribute $r2d2 containers:image_name deter/win7
     45tb-add-node-attribute $r2d2 containers:image_url http://scratch/benito/deter_win7.box
     46
     47set c3po [$ns node]
     48tb-add-node-attribute $c3po containers:image_os ubuntu
     49tb-add-node-attribute $c3po containers:image_type vagrant
     50tb-add-node-attribute $c3po containers:image_name ubuntu/trusty64
     51}}}
     52
     532. Use the NS file to create a containerized experiment using the existing containers scripts (on users): {{{/share/containers/containerize.py [group] [experiment] [ns file]}}}
     543. 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}}}
     59Add 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{{{
     61tb-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.)
     644. Swap in the experiment and wait a long time. There is no great way to tell when the containers are up, unfortunately.
     65
    466
    567=== Execution Flow ===
     
    769The execution flow of is as follows. The initialization uses the existing containers system as a bootstrap.
    870
    9 1. Create a containerized experiment with an NS file and the {{{/share/containers/containerize.py}}} script.
     711. 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.
     72
    10732. Modify the generated NS file.
    1174   a. Change the OS type of the pnodes to {{{PNODE-BASE}}}. e.g. make the line in the NS file: