[ARVADOS] updated: 103c12a42d5fef4d88dfae9264fe23949595bcd1
git at public.curoverse.com
git at public.curoverse.com
Fri Oct 23 13:53:41 EDT 2015
Summary of changes:
sdk/cli/bin/crunch-job | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
via 103c12a42d5fef4d88dfae9264fe23949595bcd1 (commit)
from 7011a3022e1378fcd3897b42f841726459d2fa13 (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 103c12a42d5fef4d88dfae9264fe23949595bcd1
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Oct 23 13:41:37 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..c755f53 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -954,16 +954,23 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
$command .= "--env=\QHOME=$ENV{HOME}\E ";
$command .= "\Q$docker_hash\E ";
+ my $stdbuf = " stdbuf --output=0 --error=0 ";
+
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