[ARVADOS] updated: e359c70eb7adb66df7c6aae6edb738e5f543d6e4

git at public.curoverse.com git at public.curoverse.com
Wed Jun 17 14:30:06 EDT 2015


Summary of changes:
 sdk/cli/bin/crunch-job | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

       via  e359c70eb7adb66df7c6aae6edb738e5f543d6e4 (commit)
      from  4db7620243da1b74d41a44ef9d1c6a200b6eaae5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e359c70eb7adb66df7c6aae6edb738e5f543d6e4
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Jun 17 14:30:02 2015 -0400

    4410: crunch-job fixups from code review.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index f8b7e16..2246c86 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -1053,6 +1053,7 @@ if (!defined $main::success)
   if (!@jobstep_todo) {
     $main::success = 1;
   } elsif ($working_slot_count < 1) {
+    save_output_collection();
     save_meta();
     exit(EX_RETRY_UNLOCKED);
   } elsif ($thisround_succeeded == 0 &&
@@ -1068,16 +1069,7 @@ goto ONELEVEL if !defined $main::success;
 
 release_allocation();
 freeze();
-my $collated_output = &create_output_collection();
-
-if (!$collated_output) {
-  Log (undef, "Failed to write output collection");
-}
-else {
-  Log(undef, "job output $collated_output");
-  $Job->update_attributes('output' => $collated_output);
-}
-
+my $collated_output = save_output_collection();
 Log (undef, "finish");
 
 save_meta();
@@ -1512,6 +1504,20 @@ print (arvados.api("v1").collections().
   return $joboutput;
 }
 
+# Calls create_output_collection, logs the result, and returns it.
+# If that was successful, save that as the output in the job record.
+sub save_output_collection {
+  my $collated_output = create_output_collection();
+
+  if (!$collated_output) {
+    Log(undef, "Failed to write output collection");
+  }
+  else {
+    Log(undef, "job output $collated_output");
+    $Job->update_attributes('output' => $collated_output);
+  }
+  return $collated_output;
+}
 
 sub killem
 {
@@ -1719,9 +1725,8 @@ sub save_meta
       owner_uuid => $Job->{owner_uuid},
       name => sprintf("Log from %s job %s", $Job->{script}, $Job->{uuid}),
     });
-  Log(undef, "log manifest is " . $log_coll->{portable_data_hash});
-  $Job->{'log'} = $log_coll->{portable_data_hash};
-  $Job->update_attributes('log', $log_coll->{portable_data_hash});
+  Log(undef, "log collection is " . $log_coll->{portable_data_hash});
+  $Job->update_attributes('log' => $log_coll->{portable_data_hash});
 }
 
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list