Commit 00f8abf4 authored by Tarun Prabhu's avatar Tarun Prabhu

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

parents fe2f915b a31f1a5b
......@@ -512,7 +512,7 @@ DocumentRoot "@prefix@/www"
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.php3 index.html
DirectoryIndex index.php3 index.php index.html
</IfModule>
#
......
#
# 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.
#
SRCDIR = @srcdir@
......@@ -41,7 +41,7 @@ OBJS += parse_ptop_xml.o parse_vtop_xml.o parse_policy_xml.o parse_error_handler
endif
# Pick either this
CXXFLAGS += -O3
CXXFLAGS += -O3
# or this
#CXXFLAGS += -O0 -g -Wall -DVERBOSE
# and then zero or more of these
......@@ -56,7 +56,7 @@ CXXFLAGS += -O3
# This is added to disable link mapping while we figure out how to get assign
# to deal with interfaces on switches
CXXFLAGS += -DDISABLE_LINK_ANNOTATION
#CXXFLAGS += -DDISABLE_LINK_ANNOTATION
# assign now supports a dizzing array of defines, which are as-yet undocumented
# Here are the ones used for a typical build:
......
......@@ -2706,7 +2706,7 @@ sub CleanLogFiles($)
if ($file =~ /^.*\.ns$/);
push(@delete, "${workdir}/$1")
if ($file =~ /^(.*\.(log|ptop|top|assign|soln))$/);
if ($file =~ /^(.*\.(log|ptop|top|assign|soln|xml))$/);
push(@delete, "${workdir}/$1")
if ($file =~ /^((swap|start|cancel|newrun).*\..*)$/);
......
......@@ -233,8 +233,12 @@ sub MapResources($$$$)
$vtopfh->close();
$ptopfh->close();
system("nice $ASSIGN -uod -c .75 ".
"-f rspec/rspec -W $soln $ptop $vtop > $log 2>&1");
my $cmd = "nice $ASSIGN -uod -c .75 ".
"-f rspec/rspec -W $soln $ptop $vtop > $log 2>&1";
if ($verbose) {
print STDERR "$cmd\n";
}
system($cmd);
if ($?) {
print STDERR "Could not map to physical resources on $resource\n";
......
......@@ -632,7 +632,6 @@ sub GetTicketAuxAux($$$$$$$$$)
my %nodemap = ();
my @nodeids = ();
my %lannodes = ();
my @dealloc;
#
# If this is a ticket update, we want to seed the namemap with
......@@ -1318,18 +1317,10 @@ sub GetTicketAuxAux($$$$$$$$$)
$virtnode->fixed($node->node_id());
}
#
# Shared and virt nodes do not need to be allocated.
#
# XXX This is going to cause breakage since the reservations
# are not recorded anyplace until the ticket is redeemed.
#
if (! ($node->sharing_mode() || $node->isplabphysnode() ||
($node->isremotenode() && !$exclusive))) {
# Need to allocate this node unless already mapped.
push(@nodeids, $node->node_id())
if (!exists($namemap{$virtual_id}));
}
# New node unless already mapped.
push(@nodeids, $node->node_id())
if (!exists($namemap{$virtual_id}));
$namemap{$virtual_id} = $node;
$colomap{$colocate} = $node
if (defined($colocate));
......@@ -1377,25 +1368,6 @@ sub GetTicketAuxAux($$$$$$$$$)
print GeniXML::Serialize($rspec);
# Nalloc might fail if the node gets picked up by someone else.
if (@nodeids && !$impotent) {
system("$NALLOC $pid $eid @nodeids");
if (($? >> 8) < 0) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Allocation failure");
goto bad;
}
elsif (($? >> 8) > 0) {
$response =
GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef,
"Could not allocate some nodes");
goto bad;
}
# In case the code below fails, before ticket is created.
@dealloc = @nodeids;
}
#
# For the version 2 minimal API, just return the annotated rspec.
#
......@@ -1451,9 +1423,9 @@ sub GetTicketAuxAux($$$$$$$$$)
# Delete, not Release (which frees nodes).
$newticket->Delete(TICKET_PURGED);
}
if (@dealloc) {
if (@nodeids) {
system("export NORELOAD=1; ".
"$NFREE -x -q GeniSlices $eid @dealloc");
"$NFREE -x -q GeniSlices $eid @nodeids");
}
if (defined($slice_experiment) && $restorevirt) {
$slice_experiment->RemoveVirtualState();
......@@ -1465,9 +1437,9 @@ sub GetTicketAuxAux($$$$$$$$$)
if (defined($newticket)) {
$newticket->Release(TICKET_PURGED);
}
elsif (@dealloc) {
elsif (@nodeids) {
system("export NORELOAD=1; ".
"$NFREE -x -q GeniSlices $eid @dealloc");
"$NFREE -x -q GeniSlices $eid @nodeids");
}
#
# Lets leave the experiment lying around; it will get cleaned
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
# granted provided that (1) source code retains these copyright, permission,
# and disclaimer notices, and (2) redistributions including binaries
# reproduce the notices in supporting documentation.
#
# THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
# CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
# FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
#
#
#
import sys
import pwd
import getopt
import os
import time
import re
ACCEPTSLICENAME=1
debug = 0
impotent = 1
rspec = None
execfile( "test-common.py" )
if len(REQARGS):
Usage()
sys.exit( 1 )
pass
#
# Get a credential for myself, that allows me to do things at the SA.
#
mycredential = get_self_credential()
print "Got my SA credential"
#
# Lookup slice.
#
params = {}
params["credential"] = mycredential
params["type"] = "Slice"
params["hrn"] = SLICENAME
rval,response = do_method("sa", "Resolve", params)
if rval:
Fatal("No such slice at SA");
pass
else:
#
# Get the slice credential.
#
print "Asking for slice credential for " + SLICENAME
myslice = response["value"]
slicecred = get_slice_credential( myslice, mycredential )
print "Got the slice credential"
pass
#
# Do a resolve to get the sliver urn.
#
print "Resolving the slice at the CM"
params = {}
params["credentials"] = (slicecred,)
params["urn"] = myslice["urn"]
rval,response = do_method("cm", "Resolve", params, version="2.0")
if rval:
Fatal("Could not get resolve slice")
pass
myslice = response["value"]
print str(myslice)
#
# Get the sliver credential.
#
print "Asking for sliver credential"
params = {}
params["slice_urn"] = SLICEURN
params["credentials"] = (slicecred,)
rval,response = do_method("cm", "GetSliver", params, version="2.0")
if rval:
Fatal("Could not get Sliver credential")
pass
slivercred = response["value"]
print "Got the sliver credential"
#
# Do a resolve to get the manifest urn.
#
print "Resolving the sliver at the CM to get the manifest"
params = {}
params["credentials"] = (slicecred,)
params["urn"] = myslice["sliver_urn"]
rval,response = do_method("cm", "Resolve", params, version="2.0")
if rval:
Fatal("Could not get resolve slice")
pass
mysliver = response["value"]
rspec = mysliver["manifest"]
print str(rspec)
This diff is collapsed.
......@@ -51,13 +51,14 @@ sub usage ()
print STDERR " -l - Use rspec v2 instead of the text file format\n";
exit($WRAPPER_FAILED);
}
my $optlist = "dvunfprqczxm:ko:al";
my $optlist = "dvunfprqczxm:ko:alt";
my $verbose = 0;
my $debug = 0;
my $fixmode = 0;
my $updating = 0;
my $impotent = 0;
my $precheck = 0;
my $toponly = 0;
my $prepass = 0;
my $alloconly = 0;
my $outfile;
......@@ -147,6 +148,10 @@ if (defined($options{"d"})) {
if (defined($options{"u"})) {
$updating = 1;
}
if (defined($options{"t"})) {
$toponly = 1;
$quiet = 1;
}
if (defined($options{"n"})) {
$impotent = 1;
}
......@@ -170,7 +175,8 @@ if (defined($options{"r"})) {
fatal("Cannot use regression mode on main DB");
}
$regression = 1;
$clear = 1;
$clear = 1
if (!defined($options{"t"}));
$fixmode = 1;
TBDebugTimeStampsOn();
$usecurrent = 1
......@@ -248,7 +254,13 @@ exit(0);
sub MapperWrapper()
{
chat("Starting the new and improved mapper wrapper.\n");
chat("Starting the new and improved mapper wrapper.\n")
if (!$toponly);
# Need to do this cause libvtop will add them again.
# Must be done before nodes are released.
$experiment->DeleteInternalProgramAgents()
if ($regression);
TBDebugTimeStamp("Create libvtop started");
$vtop = libvtop->Create($experiment, $this_user, $vtopflags);
......@@ -257,7 +269,12 @@ sub MapperWrapper()
}
TBDebugTimeStamp("Create libvtop ended");
if (!$impotent && ($updating || $clear)) {
TBDebugTimeStamp("vtopgen started");
$vtop->CreateVtop() == 0
or fatal("Could not create vtop for $experiment");
TBDebugTimeStamp("vtopgen finished");
if (!$impotent && !$alloconly && !$toponly && ($updating || $clear)) {
if ($clear) {
chat("Freeing reserved nodes ...\n");
system("export NORELOAD=1; $NFREE -x -a $pid $eid") == 0
......@@ -268,10 +285,6 @@ sub MapperWrapper()
exit(0)
if ($clear && !$regression);
}
TBDebugTimeStamp("vtopgen started");
$vtop->CreateVtop() == 0
or fatal("Could not create vtop for $experiment");
TBDebugTimeStamp("vtopgen finished");
AssignLoop();
return 0;
}
......@@ -398,7 +411,7 @@ sub AssignLoop()
$currentrun++;
}
GatherAssignStats($pid, $eid, %{ $vtop->exptstats() })
if (! ($impotent || $alloconly));
if (! ($impotent || $alloconly || $regression || $toponly));
TBDebugTimeStamp("mapper loop finished");
return 0;
}
......@@ -419,6 +432,28 @@ sub RunAssign($$)
}
my $assignexitcode = 0;
#
# Now generate a vtop file and dump it to a file.
#
if (! open(VTOPFILE, "> $vtopfile")) {
tberror("Could not open $vtopfile: $!\n");
return -1;
}
my $reslibvtop;
if ($userspec == 1) {
$reslibvtop = $vtop->PrintRspec(*VTOPFILE);
}
else {
$reslibvtop = $vtop->PrintTop(*VTOPFILE);
}
if ($reslibvtop != 0) {
tberror("Could not print vtop file for $experiment\n");
return -1;
}
close(VTOPFILE);
return 0
if ($toponly);
# Debugging hack for regression mode. Avoid really long assign runs.
if ($regression && $noassign) {
if (! -e "assign.log") {
......@@ -484,7 +519,8 @@ sub RunAssign($$)
if ($userspec == 1) {
$ptopargs .= "-x -g 2 ";
}
$ptopargs .= "-l $typelimitfile";
$ptopargs .= "-l $typelimitfile"
if (scalar(keys(%admission_control)));
chat("ptopargs: '$ptopargs'\n");
TBDebugTimeStamp("ptopgen started");
......@@ -495,26 +531,6 @@ sub RunAssign($$)
}
TBDebugTimeStamp("ptopgen finished");
#
# Now generate a vtop file and dump it to a file.
#
if (! open(VTOPFILE, "> $vtopfile")) {
tberror("Could not open $vtopfile: $!\n");
return -1;
}
my $reslibvtop;
if ($userspec == 1) {
$reslibvtop = $vtop->PrintRspec(*VTOPFILE);
}
else {
$reslibvtop = $vtop->PrintTop(*VTOPFILE);
}
if ($reslibvtop != 0) {
tberror("Could not print vtop file for $experiment\n");
return -1;
}
close(VTOPFILE);
if (! ($impotent || $regression || $alloconly)) {
if ($experiment->Update({"maximum_nodes" => $vtop->maximum_nodes(),
"minimum_nodes" => $vtop->minimum_nodes(),
......@@ -731,6 +747,9 @@ sub FinalizeRegression($)
}
close(VTOPFILE);
}
# Must be done before nodes are released.
$experiment->DeleteInternalProgramAgents();
return 0
if ($noregfree);
......
# -*- tcl -*-
#
# 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.
#
......@@ -487,6 +487,8 @@ Node instproc set_fixed {pnode} {
if {$issubnode} {
$pnode set subnodehost 1
$pnode set subnodechild $self
} elseif ($isvirt) {
# Need to check anything?
} else {
perror "\[set-fixed] Improper fix-node $self to $pnode!"
return
......
......@@ -38,10 +38,12 @@ Path instproc updatedb {DB} {
$self instvar sim
set idx 0
set layer 0
foreach link $mylinklist {
set fields [list "pathname" "segmentname" "segmentindex"]
set values [list $self $link $idx]
set layer [$link set layer]
set fields [list "pathname" "segmentname" "segmentindex" "layer"]
set values [list $self $link $idx $layer]
$sim spitxml_data "virt_paths" $fields $values
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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