All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit fa3d78b7 authored by Leigh B Stoller's avatar Leigh B Stoller

More work on issue #422, almost ready for prime time.

parent 8d1d2ee7
......@@ -147,16 +147,7 @@ sub Lookup($$)
#
# Lookup existing aggregates.
#
my $aggregates = APT_Instance::Aggregate->LookupForInstance($self);
if (!keys(%{$aggregates}) && defined($self->aggregate_urn())) {
#
# Make up a fake one; eventually the old ones will die or
# I will create entries for them. Not worrying about it now.
#
$aggregates = {$self->aggregate_urn() =>
APT_Instance::Aggregate->GenTemp($self)};
}
$self->{'AGGREGATES'} = $aggregates;
$self->{'AGGREGATES'} = APT_Instance::Aggregate->LookupForInstance($self);
# Add to cache.
$instances{$self->uuid()} = $self;
......
......@@ -877,8 +877,7 @@ foreach my $aggregate_urn (@aggregate_urns) {
# We do not do this if the experiment start is deferred.
if (!defined($start_at)) {
if ($aptaggregate->CheckStatus(\$errmsg)) {
if ($usestitcher || scalar(@aggregate_urns) == 1 ||
!$aptaggregate->deferrable()) {
if ($usestitcher || !$aptaggregate->deferrable()) {
$slice->Delete();
$instance->Delete();
UserError($errmsg);
......
......@@ -150,7 +150,9 @@ my $instance = APT_Instance->Lookup($ARGV[0]);
if (!defined($instance)) {
fatal("No such instance");
}
my $genislice = $instance->GetGeniSlice();
my $webtask = $instance->webtask();
my $webtask_id = $webtask->task_id();
my $genislice = $instance->GetGeniSlice();
if (!defined($genislice)) {
fatal("Could not get genislice for $instance\n");
}
......@@ -169,28 +171,56 @@ else {
# that is already being worked on.
#
foreach my $agg ($instance->AggregateList()) {
my $aptagg = $agg->GetAptAggregate();
next
if (! ($agg->status() eq "created" || $agg->status() eq "deferred"));
# Coming from create_instance.
if ($agg->status() eq "created") {
push(@aggregate_list, $agg);
next;
}
#
# See if the aggregate is back online, lets not go to a ton of
# trouble if the aggregate is still dead.
# See if the aggregate is online, lets not go to a ton of trouble
# if the aggregate is dead.
#
if ($agg->GetAptAggregate()->CheckStatus(\$errmsg)) {
if ($aptagg->CheckStatus(\$errmsg)) {
print STDERR "$errmsg\n";
#
# If the cluster is not deferrable, then its an error and the
# instance has failed.
#
if (!$aptagg->deferrable()) {
$instance->SetStatus("failed");
if (defined($webtask)) {
$webtask->output($errmsg);
$webtask->Exited(1);
}
$instance->RecordError(1, $errmsg);
exit(1);
}
# Mark as deferred (it might still be "created" if not scheduled).
$agg->SetStatus("deferred")
if ($agg->status() eq "created");
next;
}
push(@aggregate_list, $agg);
# We send email when all deferred aggregates are started.
$sendemail = 1;
#
# We send email when all deferred aggregates are started. Note
# that if the status is still "created", we are coming from
# create_instance() (not a scheduled experiment), so do not send
# email, no need to since the user is looking at the web interface.
#
$sendemail = 1
if ($instance->status() ne "created");
}
if (!@aggregate_list) {
print "No uncreated aggregates to process.\n";
#
# If not a scheduled experiment, we need to set the instance status
# to something that makes sense for the web interface since we were
# not able to start anything at all. Later, if we get some started,
#
if ($instance->status() eq "created") {
$instance->SetStatus("pending");
}
$genislice->UnLock();
exit(0);
}
......@@ -204,8 +234,6 @@ my $slice_urn = $genislice->urn();
my $uuid = $instance->uuid();
my $project = $instance->GetProject();
my $rspecstr = $instance->rspec();
my $webtask = $instance->webtask();
my $webtask_id = $webtask->task_id();
$webtask->AutoStore(1);
#
......
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