Add ability to specify multiple apps to run on each node

refs: #2933

Change-Id: Ic5d47bb3e9ab830f01b55be37848aa680174cf32
This commit is contained in:
Ashlesh Gawande
2015-07-01 15:39:44 -05:00
parent 792c6aa970
commit 557cb8466a
3 changed files with 19 additions and 10 deletions
+4 -2
View File
@@ -200,8 +200,10 @@ def execute(template_file='minindn.conf', testbed=False, experimentName=None, nP
for host in net.hosts:
if 'app' in host.params:
if host.params['app'] != '_':
host.cmd(host.params['app'])
if host.params['app'] != '':
app = host.params['app']
print "Starting " + app + " on node " + host.name
print(host.cmd(app))
# Load experiment
if experimentName is not None:
+9 -5
View File
@@ -197,10 +197,13 @@ class HostDialog(CustomDialog):
# Start command
#print self.isRouter
if self.isRouter == 'False':
Label(self.propFrame, text="Start Command:").grid(row=5, sticky=E)
self.startEntry = Entry(self.propFrame)
self.startEntry.grid(row=5, column=1, sticky='nswe', columnspan=3)
Label(self.propFrame, text="[full path]").grid(row=5, column=2, sticky=W)
Label(self.propFrame, text="Start Command(s):").grid(row=5, sticky=E)
self.scrollbar = Scrollbar(self.propFrame, orient="horizontal")
self.startEntry = Entry(self.propFrame, xscrollcommand=self.scrollbar.set,)
self.startEntry.grid(row=5, column=1)
self.scrollbar.grid(row=6, column=1, sticky=N+S+E+W)
self.scrollbar.config(command=self.startEntry.xview)
Label(self.propFrame, text="[Use bash syntax]").grid(row=5, column=2, sticky=W)
if 'startCommand' in self.prefValues:
self.startEntry.insert(0, str(self.prefValues['startCommand']))
else:
@@ -711,7 +714,8 @@ class MiniEdit( Frame ):
hOpts=self.hostOpts[name]
template.write(name + ': ')
if 'startCommand' in hOpts:
template.write(hOpts['startCommand'] + ' ')
cmds = hOpts['startCommand'].replace("\"", "\\\"")
template.write('apps="%s" ' % cmds)
else:
template.write('_ ')
if 'cache' in hOpts:
+6 -3
View File
@@ -1,4 +1,5 @@
import ConfigParser, re
import shlex
class confNDNHost():
@@ -58,9 +59,7 @@ def parse_hosts(conf_arq):
name = item[0]
rest = item[1].split()
app = rest.pop(0)
rest = shlex.split(item[1])
uris = rest
params = {}
@@ -77,6 +76,10 @@ def parse_hosts(conf_arq):
cache = uri.split('=')[1]
elif re.match("mem",uri):
mem = uri.split('=')[1]
elif re.match("app",uri):
app = uri.split('=')[1]
elif re.match("_", uri):
app = ""
else:
params[uri.split('=')[0]] = uri.split('=')[1]