Commit 16490145 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 156b2910 3af38298
......@@ -108,6 +108,7 @@ my $EXPT_RESOURCESHOSED = 0;
"event_groups",
"virt_firewalls",
"firewall_rules",
"elabinelab_attributes",
"virt_tiptunnels",
"ipsubnets");
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2009 University of Utah and the Flux Group.
# Copyright (c) 2009-2010 University of Utah and the Flux Group.
# All rights reserved.
#
package VirtExperiment;
......@@ -69,6 +69,7 @@ my $debug = 0;
"event_groups" => [ "group_name", "agent_name" ],
"virt_firewalls" => [ "fwname", "type", "style" ],
"firewall_rules" => [ "fwname", "ruleno", "rule" ],
"elabinelab_attributes" => [ "role", "attrkey", "ordering" ],
"virt_tiptunnels" => [ "host", "vnode" ],
"virt_parameters" => [ "name", "value" ],
);
......@@ -627,7 +628,7 @@ sub NewRow($$)
$argref->{$key} = $self->{'COUNTER'}++;
}
else {
carp("Missing table key for new table in $tablename");
carp("Missing table key $key for new table in $tablename");
return undef;
}
}
......@@ -1178,5 +1179,10 @@ use vars qw(@ISA);
@ISA = "VirtExperiment::VirtTableRow";
use VirtExperiment;
package VirtExperiment::VirtTableRow::elabinelab_attributes;
use vars qw(@ISA);
@ISA = "VirtExperiment::VirtTableRow";
use VirtExperiment;
# _Always_ make sure that this 1 is at the end of the file...
1;
......@@ -111,7 +111,7 @@ mysystem("$TB/sbin/mkproj -s $pid");
#
# Get the list of users and admin status. Admin users get a real shell
# on boss. Create the users, and not that we have to do this before the
# on boss. Create the users, and note that we have to do this before the
# groups are created (tbacct add does not do a setgroups).
#
my $users_result =
......@@ -153,7 +153,7 @@ while (my ($gid_idx) = $query_result->fetchrow_array()) {
# Now do a setgroups.
#
$users_result->dataseek(0);
while (my ($uid,$admin,$status) = $users_result->fetchrow_array()) {
while (my ($uid,$uid_idx,$admin,$status) = $users_result->fetchrow_array()) {
next
if ($uid eq "elabman");
next
......@@ -177,7 +177,20 @@ mysystem("$TB/sbin/exports_setup");
# So for the moment, we tweak the DB to rewrite everything to use the BSD
# tools.
#
# XXX this should go away if we once again settle on a single set of tools.
# Note that re-writing the pxe_boot_path doesn't have any effect for elabs
# NOT using the SINGLE_CONTROLNET setting. This is because as long as
# outer (real) boss responds first, the filename it returns is what gets
# used. We could rewrite pxe_boot_path in the real boss DB for nodes
# that are in an elabinelab, but then we could lose custom per-node settings
# for that field. To fix that, we could introduce a temporary field for
# holding any custom value, but I don't want to go there...
#
# Anyway, the way we work around the non-SINGLE_CONTROLNET problem is to
# find all the custom pxe_boot_path values (in nodes or node_type_attributes)
# and "create" them on the inner boss by symlinking them to the standard
# pxeboot. SWEET!
#
# XXX this should go away if/when we settle on a single set of tools.
#
if (1) {
# first find the OSIDs for the "standard" MFSes
......@@ -199,6 +212,21 @@ if (1) {
# make sure newnode MFS points to the correct place
DBQueryFatal("update os_info set path='$nmfspath' where osid=$nmfs");
# collect up non-standard PXE boot paths, first from node_type_attributes..
my @bogoboots = ();
$qr = DBQueryFatal("select attrvalue from node_type_attributes ".
"where attrkey='pxe_boot_path' and attrvalue!='' ".
"group by attrvalue");
while (my ($path) = $qr->fetchrow_array()) {
push @bogoboots, $path;
}
# ..and then from nodes
$qr = DBQueryFatal("select pxe_boot_path from nodes ".
"where pxe_boot_path is not NULL and role='testnode'");
while (my ($path) = $qr->fetchrow_array()) {
push @bogoboots, $path;
}
# and find all the node types and update their attributes.
$qr = DBQueryFatal("select type from node_types where class='pc'");
while (my ($ntype) = $qr->fetchrow_array()) {
......@@ -211,6 +239,27 @@ if (1) {
" where attrkey='diskloadmfs_osid' and type='$ntype'");
}
# fixup any nodes table entries with non-standard pxe_boot_path's
DBQueryFatal("update nodes set pxe_boot_path=NULL ".
" where pxe_boot_path is not NULL");
#
# Now symlink all the alternate boots to pxeboot.emu
# XXX we assume everything is at the top level of /tftpboot right now.
#
foreach my $boot (@bogoboots) {
if ($boot =~ /^\/tftpboot\/([^\/]+)$/) {
$boot = $1;
if (! -e "/tftpboot/$boot") {
if (system("ln -s pxeboot.emu /tftpboot/$boot")) {
print STDERR
"*** could not symlink non-standard boot '$boot';",
" some inner nodes will not boot properly!\n";
}
}
}
}
#
# Remake the dhcpd.conf file to reflect any pxeboot change.
# XXX dhcpd is not running yet so don't need this.
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -655,6 +655,7 @@ sub TBDB_PHYSICAL_NODE_TABLES() {
'nodeuidlastlogin' => [ 'node_id' ],
'ntpinfo' => [ 'node_id' ],
'outlets' => [ 'node_id' ],
'outlets_remoteauth' => [ 'node_id' ],
'partitions' => [ 'node_id' ],
'plab_slice_nodes' => [ 'node_id' ],
'port_counters' => [ 'node_id' ],
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -110,6 +110,9 @@ my %virtual_tables =
"firewall_rules" => { rows => undef,
tag => "firewall_rules",
row => "firewall_rule"},
"elabinelab_attributes" => { rows => undef,
tag => "elabinelab_attributes",
row => "attribute"},
"virt_tiptunnels" => { rows => undef,
tag => "tiptunnels",
row => "tiptunnel"},
......
#
# This is the definitions file for Mike on Emulab.Net.
#
. defs-default
TBOPSEMAIL=mike@flux.utah.edu
TBLOGSEMAIL=mike@flux.utah.edu
TBWWWEMAIL=mike@flux.utah.edu
TBAPPROVALEMAIL=mike@flux.utah.edu
TBLOGSEMAIL=mike@flux.utah.edu
TBAUDITEMAIL=mike@flux.utah.edu
TBSTATEDEMAIL=mike@flux.utah.edu
TBTESTSUITEEMAIL=mike@flux.utah.edu
WWW=www.emulab.net/dev/mike
THISHOMEBASE=Mike.Emulab.Net
......@@ -29,6 +29,7 @@ my $WINSUPPORT = @WINSUPPORT@;
my $MAILMANSUPPORT = @MAILMANSUPPORT@;
my $BUGDBSUPPORT = @BUGDBSUPPORT@;
my $ARCHSUPPORT = @ARCHIVESUPPORT@;
my $PGENISUPPORT = @PROTOGENI_SUPPORT@;
my $OURDOMAIN = '@OURDOMAIN@';
my $EXPOSETEMPLATES = $ELABINELAB;
......@@ -159,7 +160,6 @@ my $TFTPD_PKG = "emulab-tftp-hpa-0.48";
# XXX temporary for perl DBD mysql access
my $P5DBD_PKG = "p5-DBD-mysql50-3.0002";
# XXX temporary until fix dependencies in emulab-boss package
my $P5GD_PKG = "p5-GD-2.07";
my $PYM2_PKG = "py25-m2crypto-0.19.1";
#
......@@ -503,20 +503,6 @@ Phase "ports", "Installing ports", sub {
if ($pname);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $P5DBD_PKG");
};
# XXX cannot seem to get these dependencies into emulab-boss
Phase "p5-GD", "Installing GD graphics package", sub {
my $pname = `$PKG_INFO -E 'p5-GD-*' 2>/dev/null`;
chomp($pname);
if ($pname eq $P5GD_PKG) {
PhaseSkip("p5-GD already up to date");
}
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_DEL -f $pname")
if ($pname);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $P5GD_PKG");
};
if ($FBSD_MAJOR > 6) {
Phase "py-m2crypto", "Installing python m2crypto package", sub {
my $pname = `$PKG_INFO -E 'py25-m2crypto-*' 2>/dev/null`;
......@@ -545,6 +531,19 @@ Phase "ports", "Installing ports", sub {
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
}
}
if ($PGENISUPPORT) {
Phase "protogeni", "Installing protogeni packages", sub {
if ($FBSD_MAJOR > 6 || ($FBSD_MAJOR == 6 && $FBSD_MINOR > 2)) {
if (!ExecQuiet("$PKG_INFO -x emulab-protogeni")) {
PhaseSkip("Protogeni package already installed");
}
my $pname = GetPackage("emulab-protogeni", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
} else {
PhaseSkip("OS install too old for Protogeni");
}
};
}
};
PhaseSkip("Package directory provided; not installing from sources")
if ($packagedir);
......@@ -567,6 +566,8 @@ Phase "ports", "Installing ports", sub {
"interactive. Run: \n" .
" cd $PORTSMISCDIR/emulab-boss && make install\n" .
" cd $PORTSMISCDIR/emulab-php4 && make install\n" .
($PGENISUPPORT ?
" cd $PORTSMISCDIR/emulab-protogeni && make install\n" : "") .
"then re-run this script.");
};
......@@ -846,6 +847,8 @@ Phase "database", "Setting up database", sub {
if (!ExecQuiet("$MYSQLADMIN ping")) {
PhaseSkip("mysqld already running");
}
# XXX make sure client startup was done (setting ldpath)
ExecQuietFatal("$RCDIR/1.mysql-client.sh start");
ExecQuietFatal("$RCDIR/2.mysql-server.sh start");
# Give mysqld some time to start, then make sure it did
sleep 5;
......
......@@ -110,7 +110,6 @@ RUN_DEPENDS= \
anytopnm:${PORTSDIR}/graphics/netpbm \
tclsh8.4:${PORTSDIR}/lang/tcl84 \
otclsh:${PORTSDIR}/lang/otcl \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/GD.pm:${PORTSDIR}/misc/p5-GD-old \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/SNMP.pm:${PORTSDIR}/net-mgmt/p5-SNMP \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/SNMP_Session.pm:${PORTSDIR}/net-mgmt/p5-SNMP_Session \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/BSD/Resource.pm:${PORTSDIR}/devel/p5-BSD-Resource \
......@@ -154,7 +153,12 @@ RUN_DEPENDS+= \
# not getting installed via dependencies?
RUN_DEPENDS+= \
${X11BASE}/libdata/xorg/libraries:${PORTSDIR}/x11/xorg-libraries \
${LOCALBASE}/libexec/apache/libphp4.so:${PORTSDIR}/misc/emulab-php4
${LOCALBASE}/libexec/apache/libphp4.so:${PORTSDIR}/misc/emulab-php4 \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/GD.pm:${PORTSDIR}/graphics/p5-GD
.else
# for old versions there used to be a problem with newer GD + older perl
RUN_DEPENDS+= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/GD.pm:${PORTSDIR}/misc/p5-GD-old
.endif
.if ${OSMAJOR} >= 6
......
......@@ -8,12 +8,16 @@ OSMINOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/
PORTNAME= emulab-clrhouse
.if ${OSMAJOR} >= 6
.if ${OSMAJOR} > 6
PORTVERSION= 1.2
.else
.if ${OSMINOR} >= 3
PORTVERSION= 1.1
.else
PORTVERSION= 1.0
.endif
.endif
.endif
CATEGORIES= misc
MASTER_SITES= #none
DISTFILES= #none
......@@ -31,6 +35,9 @@ MAINTAINER= stoller@cs.utah.edu
# We must make sure PERL is built with this.
#
.MAKEFLAGS+= ENABLE_SUIDPERL=yes
.if ${PORTVERSION} == "1.2"
.MAKEFLAGS+= PERL_VERSION=5.10.0 PERL_VER=5.10.0 PERL_ARCH=mach
.endif
#
# For SWIG, so that it doesn't feel the need to suck in php and apache
......@@ -66,7 +73,7 @@ LIB_DEPENDS= mhash.2:${PORTSDIR}/security/mhash \
RUN_DEPENDS= \
${LOCALBASE}/etc/apache/ssl.crl:${PORTSDIR}/www/apache13-modssl \
${LOCALBASE}/libexec/apache/libauth_mysql.so:${PORTSDIR}/www/mod_auth_mysql \
mod_auth_mysql>1:${PORTSDIR}/www/mod_auth_mysql \
${LOCALBASE}/libexec/apache/libphp4.so:${PORTSDIR}/misc/emulab-php4 \
rsync:${PORTSDIR}/net/rsync \
${LOCALBASE}/libexec/mysqld:${PORTSDIR}/databases/mysql50-server \
......@@ -78,11 +85,20 @@ RUN_DEPENDS= \
wget:${PORTSDIR}/ftp/wget \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/XML/Parser:${PORTSDIR}/textproc/p5-XML-Parser \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/RPC/XML.pm:${PORTSDIR}/net/p5-RPC-XML \
${PYTHON_SITELIBDIR}/M2Crypto/ASN1.py:${PORTSDIR}/security/py-m2crypto \
gmake:${PORTSDIR}/devel/gmake \
${PYTHON_SITELIBDIR}/MySQLdb/times.py:${PORTSDIR}/databases/py-MySQLdb \
mysqlhotcopy:${PORTSDIR}/databases/mysql50-scripts
.if ${PORTVERSION} == "1.2"
# must handle patching of m2crypto when the port is built
RUN_DEPENDS+= \
${PYTHON_PKGNAMEPREFIX}m2crypto>0:${PORTSDIR}/misc/emulab-py-m2crypto
.else
# for older version we can patch the standard m2crypto once installed
RUN_DEPENDS+= \
${PYTHON_PKGNAMEPREFIX}m2crypto>0:${PORTSDIR}/security/py-m2crypto
.endif
RUN_DEPENDS+= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBI.pm:${PORTSDIR}/databases/p5-DBI \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/XML/Simple.pm:${PORTSDIR}/textproc/p5-XML-Simple \
......@@ -91,9 +107,9 @@ RUN_DEPENDS+= \
RUN_DEPENDS+= \
${LOCALBASE}/lib/libxml2.so:${PORTSDIR}/textproc/libxml2 \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Frontier/Client.pm:${PORTSDIR}/net/p5-Frontier-RPC \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}${PERL_ARCH}/XML/LibXML.pm:${PORTSDIR}/textproc/p5-XML-LibXML \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/XML/LibXML.pm:${PORTSDIR}/textproc/p5-XML-LibXML \
xmlsec1:${PORTSDIR}/security/xmlsec1 \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}${PERL_ARCH}/Crypt/SSLeay.pm:${PORTSDIR}/security/p5-Crypt-SSLeay
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Crypt/SSLeay.pm:${PORTSDIR}/security/p5-Crypt-SSLeay
USE_PERL5= yes
USE_PYTHON= yes
......
......@@ -92,7 +92,15 @@ my $API_VERSION = 2;
#
sub GetVersion()
{
return GeniResponse->Create( GENIRESPONSE_SUCCESS, $API_VERSION );
my @input_rspec_versions = ( "0.1", "2" );
my $blob = {
"api" => $API_VERSION,
"level" => 1,
"input_rspec" => \@input_rspec_versions,
"output_rspec" => "0.1"
};
return GeniResponse->Create( GENIRESPONSE_SUCCESS, $blob );
}
#
......
......@@ -11,7 +11,7 @@ use Exporter;
use vars qw(@ISA @EXPORT);
@ISA = "Exporter";
@EXPORT = qw(Parse ParseFile FindNodes FindFirst FindElement FindAttr IsLanNode IsLocalNode GetNodeId GetVirtualId GetManagerId SetText GetText CreateDocument AddElement);
@EXPORT = qw(Parse ParseFile FindNodes FindNodesNS FindFirst FindElement FindAttr IsLanNode IsLocalNode GetNodeId GetVirtualId GetManagerId SetText GetText CreateDocument AddElement);
use English;
use XML::LibXML;
......@@ -88,6 +88,33 @@ sub FindNodes($$)
}
}
# Returns a NodeList for a given XPath using a given namespace as
# context. 'n' is defined to be the prefix for the given namespace.
sub FindNodesNS($$$)
{
my ($path, $node, $nsURI) = @_;
my $result = undef;
eval {
my $xc = XML::LibXML::XPathContext->new();
if (defined($nsURI)) {
$xc->registerNs('n', $nsURI);
} else {
$path =~ s/\bn://g;
}
$result = $xc->findnodes($path, $node);
};
if ($@) {
if (! defined($nsURI)) {
$nsURI = "undefined";
}
cluck "Failed to find nodes using XPath path='$path', nsURI='$nsURI': $@\n";
return XML::LibXML::NodeList->new();
} else {
return $result;
}
}
# Returns the first Node which matches a given XPath against a given
# node. If that node is not of the specified type, returns
# undefined. Works like FindNodes.
......
......@@ -421,6 +421,21 @@ CREATE TABLE `deltas` (
PRIMARY KEY (`delta_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `elabinelab_attributes`
--
CREATE TABLE `elabinelab_attributes` (
`pid` varchar(12) NOT NULL default '',
`eid` varchar(32) NOT NULL default '',
`exptidx` int(11) NOT NULL default '0',
`role` enum('boss','router','ops','fs','node') NOT NULL default 'node',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`ordering` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`exptidx`,`role`,`attrkey`,`ordering`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `elabinelab_vlans`
--
......
......@@ -963,6 +963,11 @@ REPLACE INTO table_regex VALUES ('user_pubkeys','verify','text','redirect','defa
REPLACE INTO table_regex VALUES ('user_pubkeys','user','text','redirect','users:uid',0,0,NULL);
REPLACE INTO table_regex VALUES ('user_pubkeys','keyfile','text','regex','^[-_\\w\\.\\/:+]*$',1,256,NULL);
REPLACE INTO table_regex VALUES ('elabinelab_attributes','role','text','regex','^(boss|router|ops|fs|node)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('elabinelab_attributes','attrkey','text','regex','^[-\\w\\.]+$',1,32,NULL);
REPLACE INTO table_regex VALUES ('elabinelab_attributes','attrvalue','text','regex','^[-\\w\\.\\+,\\s\\/]+$',0,255,NULL);
REPLACE INTO table_regex VALUES ('elabinelab_attributes','ordering','int','redirect','default:tinyint',0,0,NULL);
REPLACE INTO table_regex VALUES ('default','tinytext_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,256,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','text_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','fulltext_utf8','text','regex','^(?:[\\x09\\x0A\\x0D\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
......
......@@ -77,6 +77,8 @@ INSERT INTO sitevariables VALUES ('general/joinproject/admincheck','1','0','When
INSERT INTO sitevariables VALUES ('protogeni/allow_externalusers','1','1','When set, external users may allocate slivers on your testbed.',0);
INSERT INTO sitevariables VALUES ('protogeni/max_externalnodes',NULL,'1024','When set, external users may allocate slivers on your testbed.',0);
INSERT INTO sitevariables VALUES ('protogeni/cm_uuid','28a10955-aa00-11dd-ad1f-001143e453fe','','The UUID of the local Component Manager.',0);
INSERT INTO sitevariables VALUES ('protogeni/max_ticket_lifetime','90','90','The maximum ticket lifetime. When set limits the lifetime of a ticket.',0);
INSERT INTO sitevariables VALUES ('protogeni/max_components','-1','-1','Maximum number of components that can be allocated. -1 indicates any number of components can be allocated.',0);
INSERT INTO sitevariables VALUES ('general/minpoolsize','3','1','The Minimum size of the shared pool',0);
INSERT INTO sitevariables VALUES ('general/maxpoolsize','5','1','The maximum size of the shared pool',0);
INSERT INTO sitevariables VALUES ('protogeni/sa_uuid','2b437faa-aa00-11dd-ad1f-001143e453fe','','The UUID of the local Slice Authority.',0);
......
#
# Add the elabinelab_attributes table.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBTableExists("elabinelab_attributes")) {
DBQueryFatal("CREATE TABLE `elabinelab_attributes` ( ".
" `pid` varchar(12) NOT NULL default '', ".
" `eid` varchar(32) NOT NULL default '', ".
" `exptidx` int(11) NOT NULL default '0', ".
" `role` enum('boss','router','ops','fs','node') NOT NULL default 'node', ".
" `attrkey` varchar(32) NOT NULL default '', ".
" `attrvalue` tinytext NOT NULL, ".
" `ordering` smallint(5) unsigned NOT NULL default '0', ".
" PRIMARY KEY (`exptidx`,`role`,`attrkey`,`ordering`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
# Fill in check fields
DBQueryFatal("REPLACE INTO table_regex VALUES".
" ('elabinelab_attributes','role','text','regex',".
" '^(boss|router|ops|fs|node)\$',0,0,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES".
" ('elabinelab_attributes','attrkey','text','regex',".
" '^[-\\\\w\\\\.]+\$',1,32,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES".
" ('elabinelab_attributes','attrvalue','text','regex',".
" '^[-\\\\w\\\\.\\\\+,\\\\s\\\\/]+\$',0,255,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES".
" ('elabinelab_attributes','ordering','int','redirect',".
" 'default:tinyint',0,0,NULL)");
# Initialize new table.
return 0;
}
1;
#
# Fix a quoting error in 175. If you want a '\' in the DB, you have to
# use FOUR backslashes here.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("replace into table_regex values ".
" ('virt_nodes','sharing_mode','text','regex', ".
" '^[-\\\\w]+\$',1,32,NULL)");
return 0;
}
1;
......@@ -277,17 +277,23 @@ $UID = 0;
# This is temporary. I think I will switch this over to grabbing the latest
# version from the web server.
#
# XXX ugh, copy over a newer mkextrafs.pl as well (one that supports -2).
#
my $mkelab = "$TB/etc/rc.mkelab";
if (-e "$expdir/rc.mkelab") {
$mkelab = "$expdir/rc.mkelab";
}
print "Copying $mkelab to ${bossnode}/${opsnode}";
my $mkextrafs = "";
if (-e "$TB/etc/mkextrafs.pl") {
$mkextrafs = "$TB/etc/mkextrafs.pl";
}
print "Copying $mkelab $mkextrafs to ${bossnode}/${opsnode}";
print "/${fsnode}"
if (defined($fsnode));
print "\n";
system("scp $mkelab ${bossnode}:/tmp");
system("scp $mkelab ${opsnode}:/tmp");
system("scp $mkelab ${fsnode}:/tmp")
system("scp $mkelab $mkextrafs ${bossnode}:/tmp");
system("scp $mkelab $mkextrafs ${opsnode}:/tmp");
system("scp $mkelab $mkextrafs ${fsnode}:/tmp")
if (defined($fsnode));
if (defined($fsnode)) {
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -132,10 +132,10 @@ process_nodes($db_result);
# Get the list of currently-reserved nodes so that we can make CNAMEs for them
#
$db_result =
DBQueryFatal("select node_id,pid,eid,vname from reserved");
DBQueryFatal("select node_id,pid,eid,vname,inner_elab_role from reserved");
my %cnames;
while (my ($node_id,$pid,$eid,$vname) = $db_result->fetchrow_array()) {
while (my ($node_id,$pid,$eid,$vname,$erole) = $db_result->fetchrow_array()) {
#
# Handle some rare cases where a node can get reserved without a vname -
......@@ -144,8 +144,15 @@ while (my ($node_id,$pid,$eid,$vname) = $db_result->fetchrow_array()) {
if (!defined($vname)) {
$vname = $node_id;
}
push @{$cnames{$node_id}}, "$vname.$eid.$pid";
#
# Special case for inner elab boss; add CNAME for www.
#
if (defined($erole) &&
($erole eq "boss" || $erole eq "boss+router")) {
push @{$cnames{$node_id}}, "www.$eid.$pid";
}
}
......
# -*- tcl -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# Copyright (c) 2004-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -148,8 +148,6 @@ Firewall instproc child-of {pfw} {
# updatedb DB
Firewall instproc updatedb {DB} {
var_import ::GLOBALS::pid
var_import ::GLOBALS::eid
$self instvar rules
$self instvar sim
$self instvar type
......
# -*- tcl -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004, 2006, 2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -80,6 +80,10 @@ proc tb-elab-in-elab-topology {topo} {}
proc tb-set-inner-elab-eid {eid} {}
proc tb-set-elabinelab-cvstag {cvstag} {}
proc tb-elabinelab-singlenet {} {}
proc tb-set-elabinelab-attribute {key val {order 0}} {}
proc tb-unset-elabinelab-attribute {key} {}
proc tb-set-elabinelab-role-attribute {role key val {order 0}} {}
proc tb-unset-elabinelab-role-attribute {role key} {}
proc tb-set-node-inner-elab-role {node role} {}
proc tb-set-node-id {vnode myid} {}
proc tb-set-link-est-bandwidth {srclink args} {}
......