Commit 8c719573 authored by Mike Hibler's avatar Mike Hibler

Changes to support running the centralized dbmonitor analogous to the

template world:
	set no_plab to 1
	set use_dbmonitor to 1
	put enough nodes in the plabnodes list
	use start-run and stop-run to do it
parent e47a905b
......@@ -76,7 +76,7 @@ set plabsites {}
# Empty list
set plabnodes {}
# Example node list
#set plabnodes {plab425 plab72 plab635 plab139 plab605}
#set plabnodes {plab518 plab541 plab628 plab736 plab360}
#
# Where to grab your tarball of pelab software from. To make this tarball:
......@@ -148,6 +148,12 @@ if {$do_bsd} {
set use_dbmonitor 1
}
#
# If dbmonitor is set, this is the interval in seconds at which to poll the DB
# and potentially update the shaping characteristics
#
set dbmonitor_interval 10
#
# If non-zero, limits the number of slots in the queues for the fake PlanetLab
#
......@@ -171,6 +177,9 @@ if {$no_plab} {
# End of user-settable options
##########
set pid ${GLOBALS::pid}
set eid ${GLOBALS::eid}
set delay_os FBSD54-DNODE
if {$do_bsd} {
......@@ -208,7 +217,9 @@ if {$use_magent} {
} else {
set stubcommand "/bin/sh /local/pelab/stub/auto-stub.sh"
}
if {$use_dbmonitor} {
# we don't run dbmonitor on the nodes anymore
if {0 && $use_dbmonitor} {
set moncommand "$elabshell /local/pelab/dbmonitor/auto-dbmonitor.sh"
} else {
set moncommand "$elabshell /local/pelab/monitor/auto-monitor.sh --stub-port=$stub_command_port"
......@@ -308,6 +319,17 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
}
}
#
# Run the DB monitor on ops
#
if {$use_dbmonitor} {
set dbmonitor [new Program $ns]
$dbmonitor set node "ops"
$dbmonitor set command "/usr/testbed/sbin/dbmonitor.pl -i $dbmonitor_interval $pid $eid"
$dbmonitor set expected-exit-code $ecode
set monitorlist $dbmonitor
}
#
# Set up groups to make it easy for us to start/stop program agents
#
......@@ -410,9 +432,7 @@ if {$fake_plab} {
tb-set-ip-link $prouter $internet 192.168.254.2
}
set pid ${GLOBALS::pid}
set eid ${GLOBALS::eid}
# for one-off ops commands
set opsagent [new Program $ns]
$opsagent set node "ops"
$opsagent set command "/bin/true"
......@@ -426,13 +446,15 @@ $opsagent set command "/bin/true"
#
# Build up the event sequences to start and stop an actual run.
#
if {$real_plab} {
if {$no_plab || $real_plab} {
set start [$ns event-sequence]
$start append "$ns log \"Starting REAL plab experiment\""
# stop stubs and monitors
$start append "$ns log \"##### Stopping stubs and monitors...\""
$start append "$planetstubs stop"
if {$real_plab} {
$start append "$planetstubs stop"
}
$start append "$monitorgroup stop"
# stop servers
......@@ -456,18 +478,22 @@ if {$real_plab} {
$start append "$elabc clear"
$start append "$elabc reset"
# distinguish between real/fake runs
# XXX I'm thinkin...we can do better than this!
$start append "$opsagent run -command \"cp /dev/null /proj/$pid/exp/$eid/tmp/real_plab\""
# save off node list
$start append "$ns log \"##### Creating node list...\""
$start append "$opsagent run -command \"/usr/testbed/bin/node_list -m -e $pid,$eid > /proj/$pid/exp/$eid/tmp/node_list\""
# initialize path characteristics
$start append "$ns log \"##### Initialize emulation node path characteristics...\""
$start append "$elabc create"
$start append "$opsagent run -command \"/usr/testbed/bin/init-elabnodes.pl -o /proj/$pid/exp/$eid/tmp/initial-conditions.txt $pid $eid\""
if {$real_plab} {
# distinguish between real/fake runs
# XXX I'm thinkin...we can do better than this!
$start append "$opsagent run -command \"cp /dev/null /proj/$pid/exp/$eid/tmp/real_plab\""
# save off node list
$start append "$ns log \"##### Creating node list...\""
$start append "$opsagent run -command \"/usr/testbed/bin/node_list -m -e $pid,$eid > /proj/$pid/exp/$eid/tmp/node_list\""
# initialize path characteristics
$start append "$ns log \"##### Initialize emulation node path characteristics...\""
$start append "$elabc create"
$start append "$opsagent run -command \"/usr/testbed/bin/init-elabnodes.pl -o /proj/$pid/exp/$eid/tmp/initial-conditions.txt $pid $eid\""
} else {
$start append "$elabc create"
}
# restart link tracing
# XXX cleanlogs has unlinked the current trace log, so we have to
......@@ -484,23 +510,24 @@ if {$real_plab} {
# restart stubs and monitors
$start append "$ns log \"##### Starting stubs and monitors...\""
$start append "$planetstubs start"
if {$real_plab} {
$start append "$planetstubs start"
}
$start append "$monitorgroup start"
# gather up the data and inform the user
$start append "$ns log \"##### Experiment run started!\""
# XXX cannot do a report here as that will cause the logs to be
# deleted before the next loghole sync
if {0} {
$start append "$ns report"
}
set stop [$ns event-sequence]
$stop append "$ns log \"Stopping REAL plab experiment\""
# stop stubs and monitors
$stop append "$ns log \"##### Stopping stubs and monitors...\""
$stop append "$planetstubs stop"
if {$real_plab} {
$stop append "$planetstubs stop"
}
$stop append "$monitorgroup stop"
# stop servers
......@@ -514,13 +541,6 @@ if {$real_plab} {
$stop append "$link trace stop"
}
# grab logfiles XXX report will do this for us
if {0} {
$stop append "$ns log \"##### Grabbing logs...\""
$stop append "$opsagent run -command \"loghole -e $pid/$eid sync\""
$stop append "$opsagent run -command \"loghole -e $pid/$eid archive\""
}
# reset shaping characteristics for all nodes
$stop append "$ns log \"##### Resetting links...\""
$stop append "$elabc clear"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment