Commit abed5101 authored by Leigh Stoller's avatar Leigh Stoller

Add -a (only alloc nodes) option, to be used by protogeni. A lot like

impotent, except that actually nalloc the nodes, and retry if the
nodes are sucked up by someone else inthe meantime.

Also, in the CM, add better ssh key checking.
parent 3531609f
......@@ -1201,7 +1201,7 @@ sub GetTicketAuxAux($$$$$$$$$)
"Could not verify topo");
goto bad;
}
system("$MAPPER -n -d -v -u -o $tmpfile $pid $eid");
system("$MAPPER -a -d -v -u -o $tmpfile $pid $eid");
if ($?) {
my $logstuff = undef;
......@@ -1632,6 +1632,10 @@ sub SliverWorkAux($$$$$$$)
return GeniResponse->Create(GENIRESPONSE_ERROR);
}
if (defined($keys)) {
$response = CheckKeys($keys);
return $response
if (GeniResponse::IsResponse($response));
$owner->Modify(undef, undef, $keys);
}
......@@ -3023,6 +3027,10 @@ sub BindToSlice($)
return GeniResponse->Create(GENIRESPONSE_ERROR);
}
if (defined($keys)) {
my $response = CheckKeys($keys);
return $response
if (GeniResponse::IsResponse($response));
$user->Modify(undef, undef, $keys);
}
if ($slice->Lock() != 0) {
......@@ -4135,5 +4143,28 @@ sub CheckTicket($)
return $ticket;
}
sub CheckKeys($)
{
my ($keys) = @_;
goto bad
if (!ref($keys));
foreach my $keyref (@{ $keys }) {
goto bad
if (!ref($keyref));
my $key = $keyref->{'key'};
my $type = $keyref->{'type'};
goto bad
if (! (defined($key) && defined($type) &&
$key ne "" && $type ne ""));
}
return 0;
bad:
return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Malformed keys")
}
# _Always_ make sure that this 1 is at the end of the file...
1;
This diff is collapsed.
......@@ -50,7 +50,7 @@ sub usage ()
"implies -n\n";
exit($WRAPPER_FAILED);
}
my $optlist = "dvunfprqczxm:ko:";
my $optlist = "dvunfprqczxm:ko:a";
my $verbose = 0;
my $debug = 0;
my $fixmode = 0;
......@@ -58,6 +58,7 @@ my $updating = 0;
my $impotent = 0;
my $precheck = 0;
my $prepass = 0;
my $alloconly = 0;
my $outfile;
my $mfactor;
my $regression = 0;
......@@ -135,6 +136,9 @@ if (defined($options{"v"})) {
TBDebugTimeStampsOn();
$verbose++;
}
if (defined($options{"a"})) {
$alloconly++;
}
if (defined($options{"d"})) {
$debug++;
}
......@@ -215,6 +219,8 @@ $vtopflags |= $libvtop::VTOP_FLAGS_FIXNODES
if ($fixmode || $usecurrent);
$vtopflags |= $libvtop::VTOP_FLAGS_IMPOTENT
if ($impotent);
$vtopflags |= $libvtop::VTOP_FLAGS_ALLOCONLY
if ($alloconly);
$vtopflags |= $libvtop::VTOP_FLAGS_REGRESSION
if ($regression);
......@@ -387,7 +393,7 @@ sub AssignLoop()
$currentrun++;
}
GatherAssignStats($pid, $eid, %{ $vtop->exptstats() })
if (!$impotent);
if (! ($impotent || $alloconly));
TBDebugTimeStamp("mapper loop finished");
return 0;
}
......@@ -487,7 +493,7 @@ sub RunAssign($$)
}
close(VTOPFILE);
if (! ($impotent || $regression)) {
if (! ($impotent || $regression || $alloconly)) {
if ($experiment->Update({"maximum_nodes" => $vtop->maximum_nodes(),
"minimum_nodes" => $vtop->minimum_nodes(),
"virtnode_count"=> $vtop->virtnodecount() })){
......@@ -653,7 +659,7 @@ sub RunAssign($$)
return -1;
}
TBDebugTimeStamp("InitializePhysNodes ended");
if (! ($impotent || $regression)) {
if (! ($impotent || $regression || $alloconly)) {
TBDebugTimeStamp("ReserveSharedBandwidth started");
if ($experiment->ReserveSharedBandwidth($updating) != 0) {
print("Could not reserve shared bandwidth\n");
......
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