Commit eed85271 authored by Leigh Stoller's avatar Leigh Stoller

Add a "nosetup" option to elabinelab experiments. In the experiments

table, if elabinelab_nosetup is non-zero, boss and ops setup will do
just enough to get the nodes into a state that hopefully approximates
what a real installation might look like before installing our stuff.
I do install the packages cause there is no point in waiting for that
to finish interactively.

From this point, you can log into the console(s) and run the setup
instructions verbatim, although I have not actually tried that yet.

The nice thing is that if you manage to get things properly setup, it
can function as a real elabinelab since the outer environment has been
setup. This is quite a bit different then how we tested during the
last release frenzy.

Its not quite perfect of course, since the images are not "clean", but
I think this is okay for testing.
parent 2b6b8ff0
......@@ -400,6 +400,7 @@ CREATE TABLE experiments (
elab_in_elab tinyint(1) NOT NULL default '0',
elabinelab_eid varchar(32) default NULL,
elabinelab_cvstag varchar(64) default NULL,
elabinelab_nosetup tinyint(1) NOT NULL default '0',
security_level tinyint(1) NOT NULL default '0',
lockdown tinyint(1) NOT NULL default '0',
paniced tinyint(1) NOT NULL default '0',
......
......@@ -2652,3 +2652,9 @@ last_net_act,last_cpu_act,last_ext_act);
alter table experiments add locpiper_port int(11) default '0' \
after locpiper_pid;
1.137: Add a boolean to the experiments table to turn off full
elabinelab setup.
alter table experiments add elabinelab_nosetup tinyint(1) \
NOT NULL default '0' after elabinelab_cvstag;
......@@ -97,6 +97,9 @@ my $RPCCERT = "/usr/testbed/etc/outer_emulab.pem";
# This gets turned on/off below
my $WINSUPPORT = 0;
# This also gets turned on/off below
my $NOSETUP = 0;
#
# Find out our domain name, so that we can qualify the localhost entry
#
......@@ -193,6 +196,7 @@ sub doboot()
$emulabconfig{"MFSVERSION"} = "53";
$emulabconfig{"MFSCONSOLE"} = "sio";
$emulabconfig{"WINSUPPORT"} = 0;
$emulabconfig{"NOSETUP"} = 0;
#
# Turn the tmcc results into a hash first. Then call the boss or ops
......@@ -215,6 +219,10 @@ sub doboot()
if ($emulabconfig{"WINSUPPORT"}) {
$WINSUPPORT = 1;
}
# Ditto nosetup.
if ($emulabconfig{"NOSETUP"}) {
$NOSETUP = 1;
}
if ($emulabconfig{"ROLE"} eq "ops") {
SetupOpsNode();
......@@ -404,8 +412,13 @@ sub SetupOpsNode()
print RC "route_vnodes=\"-net ". $emulabconfig{"JAILIPBASE"} .
" -netmask " . $emulabconfig{"JAILIPMASK"} .
" -iface $inner_controlif\"\n";
print RC "defaultrouter=\"$bossnode_ip\"\n";
# Leave default route pointing to control network until setup complete.
if ($NOSETUP) {
print RC "defaultrouter=\"$outer_routerip\"\n";
}
else {
print RC "defaultrouter=\"$bossnode_ip\"\n";
}
print RC "hostname=\"" . $emulabconfig{"OPSNODE"} . "." . $domain . "\"\n";
close(RC);
......@@ -421,6 +434,9 @@ sub SetupOpsNode()
#
CreateDefsFile("${TBDIR}/testbed/src/testbed/defs-elabinelab");
goto skipsetup
if ($NOSETUP);
#
# Configure an object tree.
#
......@@ -480,6 +496,7 @@ sub SetupOpsNode()
print RC "nameserver $bossnode_ip\n";
close(RC);
skipsetup:
#
# Hmm, need to run this at startup though.
#
......@@ -490,6 +507,9 @@ sub SetupOpsNode()
mysystem("cp ${TBDIR}/testbed/src/testbed/tmcd/common/rc.inelab ".
" /usr/local/etc/emulab/rc/rc.inelab");
return
if ($NOSETUP);
#
# Remove source code from ops so that mere users do not get access to it.
# Something to do with licensing ...
......@@ -698,6 +718,9 @@ sub SetupBossNode()
#
CreateDefsFile("${TBDIR}/testbed/src/testbed/defs-elabinelab");
goto skipsetup
if ($NOSETUP);
#
# Configure an object tree.
#
......@@ -813,6 +836,7 @@ sub SetupBossNode()
#
mysystem("/usr/testbed/sbin/named_setup");
skipsetup:
#
# Tack the frisbee mcast addr ipfw rule onto end of /etc/rc.local.
#
......
......@@ -5567,9 +5567,10 @@ COMMAND_PROTOTYPE(doemulabconfig)
/*
* Stuff from the experiments table.
*/
res = mydb_query("select elabinelab_cvstag from experiments "
res = mydb_query("select elabinelab_cvstag,elabinelab_nosetup "
" from experiments "
"where pid='%s' and eid='%s'",
1, reqp->pid, reqp->eid);
2, reqp->pid, reqp->eid);
if (!res) {
error("EMULABCONFIG: %s: DB Error getting experiments info\n",
reqp->nodeid);
......@@ -5582,6 +5583,9 @@ COMMAND_PROTOTYPE(doemulabconfig)
bufp += OUTPUT(bufp, ebufp - bufp, "CVSSRCTAG=%s\n",
row[0]);
}
if (row[1] && strcmp(row[1], "0")) {
bufp += OUTPUT(bufp, ebufp - bufp, "NOSETUP=1\n");
}
}
mysql_free_result(res);
client_writeback(sock, buf, strlen(buf), tcp);
......
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