Commit f1863cfd authored by Leigh Stoller's avatar Leigh Stoller

Add support for specifying the CVS tag to use when getting the source code

for the inner elab.

	tb-set-elabinelab-cvstag dist-foo

Will result in this branch getting checked out from the mirrored repository
(updated nightly) on boss and sent back to the node, instead of the usual
source tarball that we keep in /usr/testbed/src (still the default
behaviour if no tag is specified. You can also do this if you like:

	tb-set-elabinelab-cvstag HEAD

which of course is a special tag to CVS.
parent 1cfc4a28
......@@ -164,6 +164,7 @@ my %experiment_fields = ("multiplex_factor" => 1,
"modelnet_edges" => 1,
"elab_in_elab" => 1,
"elabinelab_eid" => 1,
"elabinelab_cvstag" => 1,
"security_level" => 1,
"delay_capacity" => 1);
......
......@@ -399,6 +399,7 @@ CREATE TABLE experiments (
modelnetedge_osname varchar(20) default NULL,
elab_in_elab tinyint(1) NOT NULL default '0',
elabinelab_eid varchar(32) default NULL,
elabinelab_cvstag varchar(64) default NULL,
security_level tinyint(1) NOT NULL default '0',
lockdown tinyint(1) NOT NULL default '0',
paniced tinyint(1) NOT NULL default '0',
......
......@@ -700,6 +700,7 @@ REPLACE INTO table_regex VALUES ('images','imageid','text','regex','^[a-zA-Z0-9]
REPLACE INTO table_regex VALUES ('images','imagename','text','regex','^[a-zA-Z0-9][-\\w\\.+]+$',2,30,NULL);
REPLACE INTO table_regex VALUES ('experiments','security_level','int','redirect','default:tinyuint',0,4,NULL);
REPLACE INTO table_regex VALUES ('experiments','elabinelab_eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('experiments','elabinelab_cvstag','text','regex','^[-\\w\\@\\/\\.]+$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_node_startloc','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_node_startloc','eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_node_startloc','vname','text','redirect','virt_nodes:vname',0,0,NULL);
......
......@@ -2638,3 +2638,9 @@ last_net_act,last_cpu_act,last_ext_act);
alter table firewalls drop type;
alter table firewalls drop style;
1.135: Add elabinelab_cvstag to experiments table so people can
specify a specific tag to use when building the inner elab.
alter table experiments add elabinelab_cvstag varchar(64) \
default NULL after elabinelab_eid;
......@@ -260,6 +260,7 @@ namespace eval GLOBALS {
# Is an inner elab experiment.
variable elab_in_elab 0
variable elabinelab_eid {}
variable elabinelab_cvstag {}
# Security level. Defaults to green
variable security_level 0
......
......@@ -361,6 +361,7 @@ Simulator instproc run {} {
var_import ::GLOBALS::modelnet_edges
var_import ::GLOBALS::elab_in_elab
var_import ::GLOBALS::elabinelab_eid
var_import ::GLOBALS::elabinelab_cvstag
var_import ::GLOBALS::security_level
if {$ran == 1} {
......@@ -571,6 +572,11 @@ Simulator instproc run {} {
lappend fields "elabinelab_eid"
lappend values $elabinelab_eid
}
if { $elabinelab_cvstag != {} } {
lappend fields "elabinelab_cvstag"
lappend values $elabinelab_cvstag
}
}
if {$security_level} {
......
......@@ -1444,6 +1444,11 @@ proc tb-set-inner-elab-eid {eid} {
set elabinelab_eid $eid
}
proc tb-set-elabinelab-cvstag {cvstag} {
var_import ::GLOBALS::elabinelab_cvstag
set elabinelab_cvstag $cvstag
}
#
# Set the inner elab role for a node.
......
......@@ -5532,7 +5532,7 @@ COMMAND_PROTOTYPE(doemulabconfig)
mysql_free_result(res);
/*
* Finally, some package info
* Some package info and other stuff from sitevars.
*/
res = mydb_query("select name,value from sitevariables "
"where name like 'elabinelab/%%'", 2);
......@@ -5562,6 +5562,27 @@ COMMAND_PROTOTYPE(doemulabconfig)
}
}
mysql_free_result(res);
/*
* Stuff from the experiments table.
*/
res = mydb_query("select elabinelab_cvstag from experiments "
"where pid='%s' and eid='%s'",
1, reqp->pid, reqp->eid);
if (!res) {
error("EMULABCONFIG: %s: DB Error getting experiments info\n",
reqp->nodeid);
return 1;
}
if ((int)mysql_num_rows(res)) {
row = mysql_fetch_row(res);
if (row[0] && row[0][0]) {
bufp += OUTPUT(bufp, ebufp - bufp, "CVSSRCTAG=%s\n",
row[0]);
}
}
mysql_free_result(res);
client_writeback(sock, buf, strlen(buf), tcp);
return 0;
}
......
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