Changes between Version 24 and Version 25 of NeoContainers


Ignore:
Timestamp:
Oct 7, 2015 2:38:21 PM (9 years ago)
Author:
Geoff Lawler
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NeoContainers

    v24 v25  
    1515}}}
    1616
    17 2. Create a containerized experiment with an NS file and the {{{/share/containers/containerize.py}}} script. (There is a mode of neo-containers which does *not* require running the older containerization scripts. This will be documented.)
     172. Create an experiment in which to run your containers. There are two modes: using the existing containers system or not using it. Neo-continainers uses the existing containers system to figure out more complex network topologies. If you just want containers "hanging off" your physical nodes and can compute IP addresses for your containers by hand, you do not need to use the existing containers system at all.
     18
     192a. Create an experiment using the existing containers system. Creat a containerized experiment with an NS file and the {{{/share/containers/containerize.py}}} script.
    1820
    1921In your NS file for each container in the experiment, specify  {{{image_os}}}, {{{image_type}}}, {{{image_name}}}, and {{{image_url}}} via the {{{tb-add-node-attribute}}} syntax. Details on each attribute is given below.
     
    3941}}}
    4042
    41 Currently Windows nodes do not get fully configured and a final script must be run by hand on the container.
     432b. Create an experiment without using the existing containers system. Just create an NS file with a fully connected network. Use the PNODE-BASE image for all machines on which you want to run containers.
     44
     45Create a JSON file which describes your containers. It's a list of containers. For each container you must specify the {{{host}}} (machine it runs on), {{{interfaces}}} in addition to the parameters from 2a above.
     46
     47{{{
     48[
     49    {
     50        "host": "alice",
     51        "name": "xanadu",
     52        "image_url": "http://scratch/containers/deter_win7_candidate.box"
     53        "image_os": "windows",
     54        "image_type": "vagrant",
     55        "image_name": "deter/win7",
     56        "interfaces": [
     57            { "address": "10.1.1.200", "mac": "de:ad:be:ef:00:ae" }
     58        ]
     59    },
     60    {
     61        "host": "alice",
     62        "name": "grease",
     63        "image_url": "http://scratch/containers/deter_win7_candidate.box"
     64        "image_os": "windows",
     65        "image_type": "vagrant",
     66        "image_name": "deter/win7",
     67        "interfaces": [
     68            { "address": "10.1.1.201", "mac": "de:ad:be:ef:00:af" }
     69        ]
     70    },
     71    {
     72        "host": "bob",
     73        "name": "maisie",
     74        "image_url": "http://scratch/containers/deter_ub1404_64_vb.box",
     75        "image_os": "ubuntu 14.04 64",
     76        "image_type": "vagrant",
     77        "image_name": "deter/ub14",
     78        "interfaces": [
     79            { "address": "10.1.1.101", "mac": "de:ad:be:ef:00:be" }
     80        ]
     81    },
     82    {
     83        "host": "bob",
     84        "name": "olive",
     85        "image_url": "http://scratch/containers/deter_ub1404_64_vb.box",
     86        "image_os": "ubuntu 14.04 64",
     87        "image_type": "vagrant",
     88        "image_name": "deter/ub14",
     89        "interfaces": [
     90            { "address": "10.1.1.102", "mac": "de:ad:be:ef:00:bf" }
     91        ]
     92    }
     93]
     94}}}
     95
     96This example creates four containers on two host nodes.
     97
     98If using this mode, skip steps 3 and 4.
    4299
    431003. Use the NS file to create a containerized experiment using the existing containers scripts (on users): {{{/share/containers/containerize.py [group] [experiment] [ns file]}}}. Note that the experiment must currently be created in the {{{Deter}}} group as that's where the custom pnode disk images are. This will change.
     
    66123}}}
    67124
    68 5. Swap in the experiment.
    69 
    70 6. Populate the configuration database that runs on {{{chef.isi.deterlab.net}}} by running the database population scripts {{{load_containers_db.sh}}} and {{{load_config_db.sh}}} (This will automated in the future.) This should be run from a physical node in the experiment. I use {{{pnode-0000}}} in the example below.
     1255. If your experiment does not rely on the existing containers system, you need to tell DETER about your containers before swapping in the experiment so that it can allocate control network addresses for your containers. (The existing containers system does this for you, but since you've not run {{{containerize.py}}}, you must do this yourself.)
     126
     127On users (or anywhere that can talk to {{{chef.isi.deterlab.net}}}:
     128{{{
     129> cd [your config_server repository]/bin
     130> ./load_containers_db.sh -f [path to your containers.json file]
     131}}}
     132
     133Note that you only have to do this once per experiment. You do not have to do this before each swap in! Just once to reserve control net addresses from DETER.
     134
     135
     1366. Swap in the experiment.
     137
     1387. Populate the configuration database that runs on {{{chef.isi.deterlab.net}}} by running the database population scripts {{{load_containers_db.sh}}} and {{{load_config_db.sh}}} (This will automated in the future.) This should be run from a physical node in the experiment. I use {{{pnode-0000}}} in the example below.
    71139
    72140On a single pnode:
     
    74142> ssh pnode-0000.${EXPID}.${PROJID}
    75143> cd [your config_server repository]/bin
     144> ./load_config_db.sh
     145}}}
     146
     147If you are using the existing containers system also load the containers information.
     148
     149{{{
    76150> ./load_containers_db.sh -p ${PROJID} -e ${EXPID}
    77 > ./load_config_db.sh
    78151}}}
    79152
    80153At this point, the Chef server and configuration database knows everything it needs to about your experiment and the nodes within it.
    81154
    82 7. Let Chef configure the nodes. Bootstrap and configure the pnodes. To configure/bootstrap the node use the {{{bootstrap_node.sh}}} script. The script needs to know which role the node plays in the experiment. There are currently three roles: {{{pnode}}}, {{{container}}}, and {{{win-container}}}.
     1558. Let Chef configure the nodes. Bootstrap and configure the pnodes. To configure/bootstrap the node use the {{{bootstrap_node.sh}}} script. The script needs to know which role the node plays in the experiment. There are currently three roles: {{{pnode}}}, {{{container}}}, and {{{win-container}}}.
    83156
    84157On all the pnodes:
     
    93166Once nodes are bootstrapped, simply running {{{sudo chef-client}}} will re-configure the nodes (both pnodes and the containers) if something should go wrong.
    94167
    95 8. Remove experiment data from the configuration database once the experiment is complete.
    96 
    97 On a single pnode:
    98 {{{
    99 > ssh pnode-0000.${EXPID}.${PROJID}
     1689. Remove experiment data from the configuration database once the experiment is complete.
     169
     170On a machine that can talk to {{{chef.isi.deterlab.net}}}:
     171{{{
    100172> cd [your config_server repository]/bin
    101173> ./rm_experiment_config.sh -p ${PROJID} -e ${EXPID}