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

Move image download to StartSliver() so that it happens after the

fork and return to client; when I tested this it was on the Utah
network so it was really fast, but more generally it is really slow
and we do not want the RPC to time out.
parent dcacc000
......@@ -84,6 +84,7 @@ my $SNMPIT = "$TB/bin/snmpit_test";
my $NAMEDSETUP = "$TB/sbin/named_setup";
my $EXPORTS_SETUP = "$TB/sbin/exports_setup";
my $GENTOPOFILE = "$TB/libexec/gentopofile";
my $IMAGE_SETUP = "$TB/sbin/image_setup";
# Cache of instances to avoid regenerating them.
my %aggregates = ();
......@@ -831,6 +832,18 @@ sub Start($$$)
# See "bad" label below; want to know what sliver failed (if any).
my $sliver;
#
# Download the images. If this fails, we have wasted our time,
# but we want to do this after we have forked off from the parent
# and we have returned to the client (rpc).
#
my $output = GeniUtil::ExecQuiet("$IMAGE_SETUP -g $pid,$eid");
if ($?) {
$msg = "Could not setup images:\n$output";
goto bad;
}
print STDERR $output;
foreach $sliver (@slivers) {
if (ref($sliver) ne "GeniSliver::Node") {
next
......
......@@ -3050,18 +3050,6 @@ sub SliverWorkAux($$$$$$$)
}
$experiment->CleanLogFiles();
#
# Download the images. Do this before we assign nodes, to avoid
# pointless cleanup.
#
my $output = GeniUtil::ExecQuiet("$IMAGE_SETUP -g $pid,$eid");
if ($?) {
$message = "Could not setup images:\n$output";
print STDERR $message;
goto bad;
}
print STDERR $output;
#
# The mapper is going to update the resource record, so we have to
# call PreSwap() first, since it generates a new record.
......@@ -3077,7 +3065,7 @@ sub SliverWorkAux($$$$$$$)
$didpreswap = 1;
# Add -u for update mode, but not -f (fixnode).
$output = GeniUtil::ExecQuiet("$MAPPER -d -v -z -u $pid $eid");
my $output = GeniUtil::ExecQuiet("$MAPPER -d -v -z -u $pid $eid");
if ($?) {
my $logstuff = "";
$message = "Could not map to resources";
......
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