[ARVADOS] updated: dbf51c6ab20fab93c3f71910c13de9d4a0501bad

git at public.curoverse.com git at public.curoverse.com
Fri Oct 23 15:00:07 EDT 2015


Summary of changes:
 sdk/cli/bin/crunch-job | 59 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 54 insertions(+), 5 deletions(-)

       via  dbf51c6ab20fab93c3f71910c13de9d4a0501bad (commit)
       via  352b2fa89337c6381aee45d173f95e5c7c0653e0 (commit)
       via  7011a3022e1378fcd3897b42f841726459d2fa13 (commit)
       via  38d8d205385181811235502dbad7c6e27fcea2a7 (commit)
       via  dc3915c4eafa0e7c69278de5df659b2b4338f2d2 (commit)
       via  22c45aed63a8c497508b132ca62dac599e3af06f (commit)
      from  92768ce858673678aa7924f83ad41e2a9f8dd678 (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 dbf51c6ab20fab93c3f71910c13de9d4a0501bad
Merge: 92768ce 352b2fa
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Oct 23 15:00:01 2015 -0400

    Merge branch '7582-run-any-docker-container' refs #7582


commit 352b2fa89337c6381aee45d173f95e5c7c0653e0
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Oct 23 14:57:55 2015 -0400

    7582: Add test for stdbuf in /bin/sh bootstrap script.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 4e50b41..555c4d1 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -880,6 +880,9 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
       qw(-n1 -c1 -N1 -D), $ENV{'TMPDIR'},
       "--job-name=$job_id.$id.$$",
 	);
+
+    my $stdbuf = " stdbuf --output=0 --error=0 ";
+
     my $command =
 	"if [ -e $ENV{TASK_WORK} ]; then rm -rf $ENV{TASK_WORK}; fi; "
         ."mkdir -p $ENV{CRUNCH_TMP} $ENV{JOB_WORK} $ENV{TASK_WORK} $ENV{TASK_KEEPMOUNT} "
@@ -955,15 +958,20 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
       $command .= "\Q$docker_hash\E ";
 
       if ($Job->{arvados_sdk_version}) {
-        $command .= "stdbuf --output=0 --error=0 ";
+        $command .= $stdbuf;
         $command .= "perl - \Q$ENV{CRUNCH_SRC}/crunch_scripts/$Job->{script}\E";
       } else {
-        $command .= "/bin/sh -c \'mkdir -p \"$ENV{JOB_WORK}\" \"$ENV{TASK_WORK}\" && exec \Q$ENV{CRUNCH_SRC}/crunch_scripts/$Job->{script}\E\'";
+        $command .= "/bin/sh -c \'mkdir -p \"$ENV{JOB_WORK}\" \"$ENV{TASK_WORK}\" && " .
+            "if which stdbuf >/dev/null ; then " .
+            "  exec $stdbuf \Q$ENV{CRUNCH_SRC}/crunch_scripts/$Job->{script}\E ;" .
+            " else " .
+            "  exec \Q$ENV{CRUNCH_SRC}/crunch_scripts/$Job->{script}\E ;" .
+            " fi\'";
       }
     } else {
       # Non-docker run
       $command .= "crunchstat -cgroup-root=/sys/fs/cgroup -poll=10000 ";
-      $command .= "stdbuf --output=0 --error=0 ";
+      $command .= $stdbuf;
       $command .= "perl - $ENV{CRUNCH_SRC}/crunch_scripts/" . $Job->{"script"};
     }
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list