Commit 2ea12718 authored by Leigh Stoller's avatar Leigh Stoller

Allow specification of inner elab experiment eid in the NS file. I'm

so unhappy with my current approach that I decided to drop that idea
for now and just specify the eid of the experiment to run.  Obviously,
it has to be an existing experiment in the same project, whose nsfile
is grabbed from the DB and shipped over to the inner boss.
parent ca9ea012
......@@ -151,6 +151,7 @@ my %experiment_fields = ("multiplex_factor" => 1,
"modelnet_cores" => 1,
"modelnet_edges" => 1,
"elab_in_elab" => 1,
"elabinelab_eid" => 1,
"security_level" => 1);
# New parsing code state machine control.
......
......@@ -669,6 +669,7 @@ REPLACE INTO table_regex VALUES ('firewall_rules','ruleno','int','redirect','def
REPLACE INTO table_regex VALUES ('firewall_rules','rule','text','regex','^\\w[-\\w \\t,/\\{\\}\\(\\)!:\\.]*$',0,1024,NULL);
REPLACE INTO table_regex VALUES ('virt_nodes','inner_elab_role','text','regex','^(boss|ops|node)$',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','elabinelab_eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('images','imageid','text','regex','^[a-zA-Z0-9][-\\w\\.+]+$',0,45,NULL);
REPLACE INTO table_regex VALUES ('images','imagename','text','regex','^[a-zA-Z0-9][-\\w\\.+]+$',2,30,NULL);
......
......@@ -9,7 +9,7 @@ set myboss [$ns node]
set myops [$ns node]
tb-set-hardware $myboss pc2000
tb-set-hardware $myops pc2000
tb-set-hardware $myops pc850
tb-elab-in-elab 1
tb-set-node-inner-elab-role $myboss boss
......@@ -22,7 +22,7 @@ for {set i 1} {$i <= $maxpcs} {incr i} {
append lanstr "[set $name] "
tb-set-node-os [set $name] FBSD-STD
tb-set-node-inner-elab-role [set $name] node
tb-set-hardware [set $name] pc600
# tb-set-hardware [set $name] pc600
}
set publiclan [$ns make-lan $lanstr 100Mb 0ms]
......@@ -41,11 +41,7 @@ if {$security_level >= 2} {
# Set up a firewall
set fw [new Firewall $ns]
$fw set-type ipfw2-vlan
$fw set-style closed
# allow tracroute as well
$fw add-rule "allow udp from 155.98.36.0/22 to any 33434-33524"
$fw add-rule "allow udp from any 33434-33524 to 155.98.36.0/22"
$fw set-style open
}
# No routing!
......
......@@ -256,6 +256,7 @@ namespace eval GLOBALS {
# Is an inner elab experiment.
variable elab_in_elab 0
variable elabinelab_eid {}
# Security level. Defaults to green
variable security_level 0
......
......@@ -270,6 +270,7 @@ Simulator instproc run {} {
var_import ::GLOBALS::modelnet_cores
var_import ::GLOBALS::modelnet_edges
var_import ::GLOBALS::elab_in_elab
var_import ::GLOBALS::elabinelab_eid
var_import ::GLOBALS::security_level
if {$ran == 1} {
......@@ -452,6 +453,11 @@ Simulator instproc run {} {
if {$elab_in_elab} {
lappend fields "elab_in_elab"
lappend values 1
if { $elabinelab_eid != {} } {
lappend fields "elabinelab_eid"
lappend values $elabinelab_eid
}
}
if {$security_level} {
......
......@@ -1438,6 +1438,11 @@ proc tb-elab-in-elab {onoff} {
set elab_in_elab 0
}
}
proc tb-set-inner-elab-eid {eid} {
var_import ::GLOBALS::elabinelab_eid
set elabinelab_eid $eid
}
#
# Set the inner elab role for a node.
......
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