[ARVADOS] updated: 2d18e31468b269e526cb6e4918912b60a48540b2

Git user git at public.curoverse.com
Wed Apr 6 12:13:45 EDT 2016


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

       via  2d18e31468b269e526cb6e4918912b60a48540b2 (commit)
       via  f37349e9436294472bdbdec820c5ec44ebe64430 (commit)
      from  9c3a1a10b702ec7ee79bb0aa1beb3c227bec95dd (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 2d18e31468b269e526cb6e4918912b60a48540b2
Merge: 9c3a1a1 f37349e
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Apr 6 12:13:06 2016 -0400

    Merge branch '8810-crunch-improve-docker-loading-wip'
    
    Closes #8810, #8888.


commit f37349e9436294472bdbdec820c5ec44ebe64430
Author: Brett Smith <brett at curoverse.com>
Date:   Tue Apr 5 16:21:20 2016 -0400

    8810: crunch-job reports errors when checking if Docker image is loaded.
    
    Since the check was previously in an `if !` condition, errors in it
    would cause us to enter the branch.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 6423c1c..c831be8 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -416,8 +416,17 @@ if ($docker_locator = $Job->{docker_image_locator}) {
   Log (undef, "docker image hash is $docker_hash");
   $docker_stream =~ s/^\.//;
   my $docker_install_script = qq{
-if ! $docker_bin images -q --no-trunc --all | grep -qxF \Q$docker_hash\E; then
-    arv-get \Q$docker_locator$docker_stream/$docker_hash.tar\E | $docker_bin load
+if $docker_bin images -q --no-trunc --all | grep -qxF \Q$docker_hash\E; then
+    exit 0
+fi
+declare -a exit_codes=("\${PIPESTATUS[@]}")
+if [ 0 != "\${exit_codes[0]}" ]; then
+   exit "\${exit_codes[0]}"  # `docker images` failed
+elif [ 1 != "\${exit_codes[1]}" ]; then
+   exit "\${exit_codes[1]}"  # `grep` encountered an error
+else
+   # Everything worked fine, but grep didn't find the image on this host.
+   arv-get \Q$docker_locator$docker_stream/$docker_hash.tar\E | $docker_bin load
 fi
 };
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list