Commit 73d52a50 authored by Mike Hibler's avatar Mike Hibler

Various changes:

 * auto-pelab.ns: add an event-group that runs 'update -t' on the nodes
   to update the tarballs/RPMs.  NOTE that you will need to modify your
   experiment and update your version of the NS file for this to work.

 * install-tarball: simple script to run tevc and trigger the tarball
   updates

 * start-experiment: '-p' option to monitor the real planetlab nodes
   instead of the emulated ones, -M/-S to set the arguments passed to
   the monitors/stubs, -m/-s to append to the current arguments passed
   to the monitors/stubs.

 * monitor/auto-monitor.sh: pass through the command line arguments
parent 70dbea63
......@@ -51,6 +51,24 @@ Running an experiment with the auto-pelab scripts:
Clean logfiles
Restart iperf servers on all 'elab-*' nodes
start-experiment has a few useful options for passing additional
arguments to the stubs and monitors, e.g.
start-experiment -s '-d' pid eid
would turn on debugging in the stubs
start-experiment -m '-d' pid eid
would do the same for the monitors (assuming it has a '-d' option).
If you are monitoring real planetlab nodes instead of the emulated
nodes, run start-experiment with '-p'.
4a) If you modified something in the pelab (e.g., the stub) and need to
deploy it to the nodes, first recreate the tarball as in step 1,
and then
install-tarball pid eid
this triggers a program agent on all the nodes telling it to update
the tarballs and RPMs. You will need to run start-experiment again
after this to restart stubs/monitors.
5) Log into the 'elab-*' node or nodes, and run your experiment (ie. one run
of iperf). Make sure to run them with 'instrument.sh'.
......
......@@ -119,10 +119,12 @@ set monitorlist {}
set planetservers {}
set serverlist {}
set clientlist {}
set tflist {}
#
# Create all of the nodes
#
set tfix 1
for {set i 1} {$i <= $num_pcs} {incr i} {
if {$real_plab} {
......@@ -134,6 +136,9 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
tb-set-node-tarfiles $planet($i) $tarfiles
tb-set-node-rpms $planet($i) $rpms
set tfupdate($tfix) [$planet($i) program-agent -command "sudo /usr/local/etc/emulab/update -t"]
lappend tflist $tfupdate($tfix)
incr tfix
if {[llength $plabsites] > 0} {
set why_doesnt_tcl_have_concat "*&"
......@@ -155,6 +160,9 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
tb-set-node-tarfiles $plab($i) $tarfiles
tb-set-node-rpms $plab($i) $rpms
set tfupdate($tfix) [$plab($i) program-agent -command "sudo /usr/local/etc/emulab/update -t"]
lappend tflist $tfupdate($tfix)
incr tfix
}
set elab($i) [$ns node]
......@@ -171,6 +179,9 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
tb-set-node-tarfiles $elab($i) $tarfiles
tb-set-node-rpms $elab($i) $rpms
set tfupdate($tfix) [$elab($i) program-agent -command "sudo /usr/local/etc/emulab/update -t"]
lappend tflist $tfupdate($tfix)
incr tfix
}
#
......@@ -188,6 +199,8 @@ set monitorgroup [$ns event-group $monitorlist]
set allservers [$ns event-group $serverlist]
set allclients [$ns event-group $clientlist]
set tfhosts [$ns event-group $tflist]
#
# Fake 'Internet' cloud for fake plab nodes
#
......
#!/bin/sh
ARGS=$*
. `dirname $0`/../common-env.sh
#
......@@ -11,7 +13,8 @@ barrier_wait "stub";
#
# Start up our own monitor
#
$SH ${MONITOR_DIR}/run-monitor-libnetmon.sh $* &
echo $SH ${MONITOR_DIR}/run-monitor-libnetmon.sh $ARGS
$SH ${MONITOR_DIR}/run-monitor-libnetmon.sh $ARGS &
MONPID=$!
# Kill the monitor if we get killed - TODO: harsher kill?
trap "$AS_ROOT kill $MONPID; $AS_ROOT killall netmond" EXIT
......
......@@ -8,19 +8,26 @@ my $LOGHOLE = "/usr/testbed/bin/loghole";
my $PYTHON = "/usr/local/bin/python";
my $EVENTSYS = "/usr/testbed/bin/eventsys_control";
my $realplab = 0;
my $UNKNOWN = "<unknown>";
my $stub_cmd = "/bin/sh /local/pelab/stub/auto-stub.sh";
my $stub_cmdargs = $UNKNOWN;
my $mon_cmd = "/bin/sh /local/pelab/monitor/auto-monitor.sh";
my $mon_cmdargs = $UNKNOWN;
sub usage()
{
print "Usage: $0 [-C] [ -S command-line ] -s [ command-args ] pid eid\n".
print "Usage: $0 [-C] [ -S command-line ] [ -s command-args ] pid eid\n".
" -p monitor real planetlab nodes\n".
" -S command-line replace the current stub command arguments\n".
" -s command-args append args to stub command line\n".
" -C show current command line\n";
" -M command-line replace the current monitor command arguments\n".
" -m command-args append args to monitor command line\n".
" -C show current command line(s)\n";
exit(1);
}
my $optlist = "CS:s:";
my $optlist = "CS:s:M:m:p";
#
# Parse command arguments.
......@@ -37,28 +44,46 @@ if (@ARGV != 2) {
usage();
}
my ($pid, $eid) = @ARGV;
$stub_cmdargs = get_cmdargs("plab");
$stub_cmdargs = get_cmdargs("plab", $stub_cmd);
$mon_cmdargs = get_cmdargs("elab", $mon_cmd);
if (defined($options{"S"})) {
$stub_cmdargs = $options{"S"};
}
if (defined($options{"s"})) {
$stub_cmdargs .= " " . $options{"s"};
}
if (defined($options{"M"})) {
$mon_cmdargs = $options{"M"};
}
if (defined($options{"m"})) {
$mon_cmdargs .= " " . $options{"m"};
}
if (defined($options{"C"})) {
my $cmdline = $stub_cmd . " " .
(($stub_cmdargs eq $UNKNOWN) ? "" : $stub_cmdargs);
print "Current stub command line: '$cmdline'\n";
$cmdline = $mon_cmd . " " .
(($mon_cmdargs eq $UNKNOWN) ? "" : $mon_cmdargs);
print "Current monitor command line: '$cmdline'\n";
}
if (defined($options{"p"})) {
$realplab = 1;
$mon_cmdargs .= " " . "-p";
}
#
# Make sure any old stubs/monitors are dead
#
print "##### Stopping old stubs and monitors\n";
if (system "$TEVC -e $pid/$eid now plabstubs stop") {
die "Error running tevc\n";
}
if (system "$TEVC -e $pid/$eid now planetstubs stop") {
die "Error running tevc\n";
if ($realplab) {
if (system "$TEVC -e $pid/$eid now planetstubs stop") {
die "Error running tevc\n";
}
} else {
if (system "$TEVC -e $pid/$eid now plabstubs stop") {
die "Error running tevc\n";
}
}
if (system "$TEVC -e $pid/$eid now monitorgroup stop") {
die "Error running tevc\n";
......@@ -111,12 +136,10 @@ print "##### Restarting servers\n";
if (system "$TEVC -e $pid/$eid now allservers stop") {
die "Error running tevc\n";
}
sleep 2;
if (system "$TEVC -e $pid/$eid now allservers start") {
die "Error running tevc\n";
}
#
# Start link tracing
#
......@@ -135,12 +158,23 @@ if ($stub_cmdargs ne $UNKNOWN) {
$startarg = "'COMMAND={$stub_cmd $stub_cmdargs}'";
}
print "\n";
if (system "$TEVC -e $pid/$eid now plabstubs start $startarg") {
die "Error running tevc\n";
if ($realplab) {
if (system "$TEVC -e $pid/$eid now planetstubs start $startarg") {
die "Error running tevc\n";
}
} else {
if (system "$TEVC -e $pid/$eid now plabstubs start $startarg") {
die "Error running tevc\n";
}
}
print "##### Starting monitors\n";
if (system "$TEVC -e $pid/$eid now monitorgroup start") {
if ($mon_cmdargs ne $UNKNOWN) {
print " with: '$mon_cmd $mon_cmdargs'";
$startarg = "'COMMAND={$mon_cmd $mon_cmdargs}'";
}
print "\n";
if (system "$TEVC -e $pid/$eid now monitorgroup start $startarg") {
die "Error running tevc\n";
}
......@@ -152,10 +186,11 @@ exit(0);
# Dig the command line out of the logs from the previous run
# (if there was one)
#
sub get_cmdargs($)
sub get_cmdargs($$)
{
my ($ntype) = @_;
my ($ntype,$cmd) = @_;
my $cmdargs = $UNKNOWN;
my $lfile = ($ntype eq "plab") ? "plabstub" : "monitor";
my @list = `/bin/ls /proj/$pid/exp/$eid/logs/$eid.*.zip`;
return $cmdargs
......@@ -165,11 +200,11 @@ sub get_cmdargs($)
my $file = $list[$#list];
return $cmdargs
if (! -r $file);
my @info = `unzip -p $file "${ntype}-1/local/logs/${ntype}stub-1.status"`;
my @info = `unzip -p $file "${ntype}-1/local/logs/${lfile}-1.status"`;
foreach (@info) {
if (/^COMMAND=(.*)/) {
$cmdargs = $1;
$cmdargs =~ s/$stub_cmd(.*)/$1/;
$cmdargs =~ s/$cmd(.*)/$1/;
last;
}
}
......
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