2 NEPI, a framework to manage network experiments
3 Copyright (C) 2013 INRIA
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 from nepi.execution.ec import ExperimentController, ECState
22 from nepi.execution.resource import ResourceState, ResourceAction, \
25 from optparse import OptionParser, SUPPRESS_HELP
30 def add_node(ec, host, user):
31 node = ec.register_resource("LinuxNode")
32 ec.set(node, "hostname", host)
33 ec.set(node, "username", user)
34 ec.set(node, "cleanHome", True)
35 ec.set(node, "cleanProcesses", True)
39 app = ec.register_resource("LinuxApplication")
40 ec.set(app, "command", "sleep 30; echo 'HOLA'")
44 slicename = os.environ.get("PL_SLICE")
46 usage = "usage: %prog -s <pl-slice>"
48 parser = OptionParser(usage=usage)
49 parser.add_option("-s", "--pl-slice", dest="pl_slice",
50 help="PlanetLab slicename", default=slicename, type="str")
51 parser.add_option("-l", "--exp-id", dest="exp_id",
52 help="Label to identify experiment", type="str")
54 (options, args) = parser.parse_args()
56 return (options.pl_slice, options.exp_id)
58 if __name__ == '__main__':
59 ( pl_slice, exp_id ) = get_options()
61 # Search for available RMs
67 #"planetlab-2.research.netlab.hut.fi",
68 "planetlab2.willab.fi",
71 "planetlab1.willab.fi",
72 "planetlab1.s3.kth.se",
73 "itchy.comlab.bth.se",
74 "planetlab-1.ida.liu.se",
75 "planetlab2.s3.kth.se",
77 #"planetlab1.tlm.unavarra.es",
78 #"planetlab2.uc3m.es",
79 #"planetlab1.uc3m.es",
81 "planet1.servers.ua.pt",
82 "planetlab2.fct.ualg.pt",
83 "planetlab-1.tagus.ist.utl.pt",
84 "planetlab-2.tagus.ist.utl.pt",
85 "planetlab-um00.di.uminho.pt",
86 "planet2.servers.ua.pt",
87 "planetlab1.mini.pw.edu.pl",
89 "planetlab1.ci.pwr.wroc.pl",
90 "planetlab1.pjwstk.edu.pl",
91 "ple2.tu.koszalin.pl",
92 "planetlab2.ci.pwr.wroc.pl",
93 "planetlab2.cyfronet.pl",
94 "plab2.ple.silweb.pl",
95 "planetlab1.cyfronet.pl",
96 "plab4.ple.silweb.pl",
97 "ple2.dmcs.p.lodz.pl",
98 "planetlab2.pjwstk.edu.pl",
99 "ple1.dmcs.p.lodz.pl",
100 "gschembra3.diit.unict.it",
101 "planetlab1.science.unitn.it",
102 "planetlab-1.ing.unimo.it",
103 "gschembra4.diit.unict.it",
104 "iraplab1.iralab.uni-karlsruhe.de",
105 "planetlab-1.fokus.fraunhofer.de",
106 "iraplab2.iralab.uni-karlsruhe.de",
108 #"pl2.uni-rostock.de",
109 "onelab-1.fhi-fokus.de",
110 "planet2.l3s.uni-hannover.de",
111 "planetlab1.exp-math.uni-essen.de",
112 "planetlab-2.fokus.fraunhofer.de",
113 "planetlab02.tkn.tu-berlin.de",
114 "planetlab1.informatik.uni-goettingen.de",
115 "planetlab1.informatik.uni-erlangen.de",
116 "planetlab2.lkn.ei.tum.de",
117 "planetlab1.wiwi.hu-berlin.de",
118 "planet1.l3s.uni-hannover.de",
119 "planetlab1.informatik.uni-wuerzburg.de",
120 "host3-plb.loria.fr",
121 "inriarennes1.irisa.fr",
122 "inriarennes2.irisa.fr",
123 "peeramide.irisa.fr",
124 "planetlab-1.imag.fr",
125 "planetlab-2.imag.fr",
127 "planetlab1.u-strasbg.fr",
128 "planetlab1.ionio.gr",
129 "planetlab2.ionio.gr",
130 "stella.planetlab.ntua.gr",
131 "vicky.planetlab.ntua.gr",
132 "planetlab1.cs.uoi.gr",
133 "pl002.ece.upatras.gr",
134 "planetlab04.cnds.unibe.ch",
135 "lsirextpc01.epfl.ch",
136 "planetlab2.csg.uzh.ch",
137 "planetlab1.csg.uzh.ch",
138 "planetlab-2.cs.unibas.ch",
139 "planetlab-1.cs.unibas.ch",
140 "planetlab4.cs.st-andrews.ac.uk",
141 "planetlab3.xeno.cl.cam.ac.uk",
142 "planetlab1.xeno.cl.cam.ac.uk",
143 "planetlab2.xeno.cl.cam.ac.uk",
144 "planetlab3.cs.st-andrews.ac.uk",
145 "planetlab1.aston.ac.uk",
146 "planetlab1.nrl.eecs.qmul.ac.uk",
147 "chimay.infonet.fundp.ac.be",
148 "orval.infonet.fundp.ac.be",
149 "rochefort.infonet.fundp.ac.be",
152 ec = ExperimentController(exp_id = exp_id)
154 for host in hostnames:
155 node = add_node(ec, host, pl_slice)
158 ec.register_connection(app, node)
163 ec.wait_finished(apps)