Changes between Version 26 and Version 27 of NeoContainers
- Timestamp:
- Oct 13, 2015 12:27:15 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NeoContainers
v26 v27 14 14 users: > git clone https://github.com/deter-project/config_server.git 15 15 }}} 16 1. 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. Use 2a for an existing containers experiment. Use 2b for a standard NS-file based DETER experiment. 17 a. Create an experiment using the existing containers system. Creat a containerized experiment with an NS file and the {{{/share/containers/containerize.py}}} script. 16 18 17 2. 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. Use 2a for an existing containers experiment. Use 2b for a standard NS-file based DETER experiment. 18 19 2a. Create an experiment using the existing containers system. Creat a containerized experiment with an NS file and the {{{/share/containers/containerize.py}}} script. 20 21 In 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. 22 23 * {{{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. 24 * {{{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. 25 * {{{image_name}}} - The name of the image. Any containers that share a name will also share an image. 26 * {{{image_url}}} - A URL must be specified which the neo-containers system uses to download the container image. This URL must be resolvable from the experiment nodes. The image will only be downloaded once as long as the {{{image_name}}}s are the same for each container. Existing and supported images are Ubuntu 14.04 64 @ {{{http://scratch/containers/deter_ub1404_64_vb.box}}} and Windows 7 @ {{{http://scratch/containers/deter_win7.box}}}. 27 28 Here is an example that creates Windows and Ubuntu 14.04 containers: 19 In 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. 20 * {{{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. 21 * {{{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. 22 * {{{image_name}}} - The name of the image. Any containers that share a name will also share an image. 23 * {{{image_url}}} - A URL must be specified which the neo-containers system uses to download the container image. This URL must be resolvable from the experiment nodes. The image will only be downloaded once as long as the {{{image_name}}}s are the same for each container. Existing and supported images are Ubuntu 14.04 64 @ {{{http://scratch/containers/deter_ub1404_64_vb.box}}} and Windows 7 @ {{{http://scratch/containers/deter_win7.box}}}. 24 Here is an example that creates Windows and Ubuntu 14.04 containers: 29 25 {{{ 30 26 set r2d2 [$ns node] … … 41 37 }}} 42 38 43 2b. 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 45 Create 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 39 b. 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. Create 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. 47 40 {{{ 48 41 [ … … 93 86 ] 94 87 }}} 95 96 This example creates four containers on two host nodes. 97 98 If using this mode, skip steps 3 and 4. 88 This example creates four containers on two host nodes.[[BR]] If using this mode, skip steps 3 and 4. 99 89 100 90 3. 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. 101 102 91 4. 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: 103 92 {{{ … … 105 94 tb-set-hardware ${pnode(0000)} MicroCloud 106 95 }}} 107 Remove all existing {{{tb-set-node-startcmd}}} lines as these start the old containers system. This is no longer used.96 Remove all existing {{{tb-set-node-startcmd}}} lines as these start the old containers system. This is no longer used. 108 97 109 The final NS file will look something like this. 110 98 The final NS file will look something like this. 111 99 {{{ 112 100 set ns [new Simulator] … … 125 113 5. 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 114 127 On users (or anywhere that can talk to {{{chef.isi.deterlab.net}}}:115 On users (or anywhere that can talk to {{{chef.isi.deterlab.net}}}: 128 116 {{{ 129 117 > cd [your config_server repository]/bin … … 131 119 }}} 132 120 133 Note 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.121 Note 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 122 135 123 … … 138 126 7. 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. 139 127 140 On a single pnode:128 On a single pnode: 141 129 {{{ 142 130 > ssh pnode-0000.${EXPID}.${PROJID} … … 145 133 }}} 146 134 147 If you are using the existing containers system also load the containers information. 148 135 If you are using the existing containers system also load the containers information. 149 136 {{{ 150 137 > ./load_containers_db.sh -p ${PROJID} -e ${EXPID} 151 138 }}} 152 139 153 At this point, the Chef server and configuration database knows everything it needs to about your experiment and the nodes within it.140 At this point, the Chef server and configuration database knows everything it needs to about your experiment and the nodes within it. 154 141 155 142 8. 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}}}. 156 143 157 On all the pnodes:144 On all the pnodes: 158 145 {{{ 159 146 > ssh pnode-0000.${EXPID}.${PROJID} … … 161 148 > ./bootstrap_node.sh -r pnode 162 149 }}} 150 The {{{pnode}}} role will spawn the containers and configure them. 163 151 164 The {{{pnode}}} role will spawn the containers and configure them. 165 166 Once nodes are bootstrapped, simply running {{{sudo chef-client}}} will re-configure the nodes (both pnodes and the containers) if something should go wrong. 152 Once nodes are bootstrapped, simply running {{{sudo chef-client}}} will re-configure the nodes (both pnodes and the containers) if something should go wrong. 167 153 168 154 9. Remove experiment data from the configuration database once the experiment is complete. 169 155 170 On a machine that can talk to {{{chef.isi.deterlab.net}}}:156 On a machine that can talk to {{{chef.isi.deterlab.net}}}: 171 157 {{{ 172 158 > cd [your config_server repository]/bin … … 174 160 }}} 175 161 176 An alternate way to do this is just to make a call on the {{{config_server}}} directly: 177 162 An alternate way to do this is just to make a call on the {{{config_server}}} directly: 178 163 {{{ 179 164 curl http://chef:5320/exp/${PROJID}/${EXPID}/delete