Commit 9cef83de authored by Leigh Stoller's avatar Leigh Stoller

Some quickie hacks for helping me get elab-in-elab off the ground.

Add elab_in_elab boolean to experiments table. Add inner_elab_role
to virt_nodes table, which is one of boss,ops,node.
parent 934eeece
......@@ -149,7 +149,8 @@ my %experiment_fields = ("multiplex_factor" => 1,
"ipassign_args" => 1,
"usemodelnet" => 1,
"modelnet_cores" => 1,
"modelnet_edges" => 1);
"modelnet_edges" => 1,
"elab_in_elab" => 1);
# New parsing code state machine control.
my $PARSING_NOTYET = 0;
......
......@@ -348,6 +348,7 @@ CREATE TABLE experiments (
modelnet_edges tinyint(4) unsigned NOT NULL default '0',
modelnetcore_osname varchar(20) default NULL,
modelnetedge_osname varchar(20) default NULL,
elab_in_elab tinyint(1) NOT NULL default '0',
PRIMARY KEY (eid,pid),
KEY idx (idx),
KEY batchmode (batchmode)
......@@ -1878,6 +1879,7 @@ CREATE TABLE virt_nodes (
failureaction enum('fatal','nonfatal','ignore') NOT NULL default 'fatal',
routertype enum('none','ospf','static','manual','static-ddijk','static-old') NOT NULL default 'none',
fixed text NOT NULL,
inner_elab_role enum('boss','ops','node') default NULL,
KEY pid (pid,eid,vname)
) TYPE=MyISAM;
......
......@@ -549,6 +549,7 @@ REPLACE INTO table_regex VALUES ('virt_nodes','startupcmd','text','redirect','de
REPLACE INTO table_regex VALUES ('virt_nodes','tarfiles','text','regex','^([-\\w\\.\\/\\+]+\\s+[-\\w\\.\\/\\+:~]+;{0,1})*$',0,1024,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','vname','text','regex','^[-\\w]+$',1,32,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','type','text','regex','^[-\\w]*$',0,30,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','inner_elab_role','text','regex','^(boss|ops|node)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','failureaction','text','regex','^(fatal|nonfatal|ignore)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','routertype','text','regex','^(none|ospf|static|manual|static-ddijk|static-old)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','fixed','text','regex','^[-\\w]*$',0,32,NULL);
......@@ -637,6 +638,7 @@ REPLACE INTO table_regex VALUES ('virt_lans','vnode','text','redirect','virt_nod
REPLACE INTO table_regex VALUES ('virt_lans','vport','int','redirect','default:tinyint',0,99,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','ip','text','regex','^(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})$',0,15,NULL);
REPLACE INTO table_regex VALUES ('experiments','usemodelnet','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','elab_in_elab','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','modelnet_cores','int','redirect','default:tinyint',0,5,NULL);
REPLACE INTO table_regex VALUES ('experiments','modelnet_edges','int','redirect','default:tinyint',0,5,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','mustdelay','int','redirect','default:boolean',0,0,NULL);
......
......@@ -2038,3 +2038,14 @@ last_net_act,last_cpu_act,last_ext_act);
UPDATE os_info SET nextosid='MAP:osid_map' \
WHERE osname IN ('RHL-STD','FBSD-STD');
1.276: Add inner_elab_role for elab-in-elab. Add elab_in_elab boolean
to the experiments table. Not sure these will survive.
alter table experiments add elab_in_elab tinyint(1) NOT NULL \
default '0' after modelnetedge_osname;
alter table virt_nodes add \
inner_elab_role enum('boss', 'ops', 'node') \
default NULL after fixed;
......@@ -75,6 +75,7 @@ Node instproc init {s} {
$self set startup ""
$self set tarfiles ""
$self set failureaction "fatal"
$self set inner_elab_role ""
$self set fixed ""
$self set nseconfig ""
......@@ -120,6 +121,7 @@ Node instproc updatedb {DB} {
$self instvar iplist
$self instvar tarfiles
$self instvar failureaction
$self instvar inner_elab_role
$self instvar routertype
$self instvar fixed
$self instvar agentlist
......@@ -216,8 +218,16 @@ Node instproc updatedb {DB} {
$self add_routes_to_DB $DB
# Update the DB
$sim spitxml_data "virt_nodes" [list "vname" "type" "ips" "osname" "cmd_line" "rpms" "startupcmd" "tarfiles" "failureaction" "routertype" "fixed" ] [list $self $type $ipraw $osid $cmdline $rpms $startup $tarfiles $failureaction $default_ip_routing_type $fixed ]
set fields [list "vname" "type" "ips" "osname" "cmd_line" "rpms" "startupcmd" "tarfiles" "failureaction" "routertype" "fixed" ]
set values [list $self $type $ipraw $osid $cmdline $rpms $startup $tarfiles $failureaction $default_ip_routing_type $fixed ]
if { $inner_elab_role != "" } {
lappend fields "inner_elab_role"
lappend values $inner_elab_role
}
$sim spitxml_data "virt_nodes" $fields $values
# Put in the desires, too
foreach desire [lsort [array names desirelist]] {
set weight $desirelist($desire)
......
......@@ -253,6 +253,9 @@ namespace eval GLOBALS {
# wants thrown at the problem.
variable modelnet_cores 0
variable modelnet_edges 0
# Is an inner elab experiment.
variable elab_in_elab 0
}
# Load all our classes
......
......@@ -269,6 +269,7 @@ Simulator instproc run {} {
var_import ::TBCOMPAT::eventtypes
var_import ::GLOBALS::modelnet_cores
var_import ::GLOBALS::modelnet_edges
var_import ::GLOBALS::elab_in_elab
# Fill out IPs
if {! $use_ipassign } {
......@@ -442,6 +443,11 @@ Simulator instproc run {} {
lappend values $modelnet_edges
}
if {$elab_in_elab} {
lappend fields "elab_in_elab"
lappend values 1
}
$self spitxml_data "experiments" $fields $values
# This could probably be elsewhere.
......
......@@ -1346,3 +1346,32 @@ proc tb-set-modelnet-physnodes {cores edges} {
set modelnet_cores $cores
set modelnet_edges $edges
}
#
# Mark this experiment as an elab in elab.
#
proc tb-elab-in-elab {onoff} {
var_import ::GLOBALS::elab_in_elab
if {$onoff} {
set elab_in_elab 1
} else {
set elab_in_elab 0
}
}
#
# Set the inner elab role for a node.
#
proc tb-set-node-inner-elab-role {node role} {
if {[$node info class] != "Node"} {
perror "\[tb-set-node-inner-elab-role] $node is not a node."
return
}
if {[lsearch -exact {boss ops node} $role] == -1} {
perror "\[tb-set-node-inner-elab-role] type must be one of boss|ops|node"
return
}
$node set inner_elab_role $role
}
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