[ARVADOS] updated: f044dbbcab5f4fcefaf2952fa1b71eb68aba7999
Git user
git at public.curoverse.com
Tue Apr 12 16:20:57 EDT 2016
Summary of changes:
sdk/cli/bin/crunch-job | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
via f044dbbcab5f4fcefaf2952fa1b71eb68aba7999 (commit)
via f8e1022669f0ab5d5db10d0e043b17be83d879b0 (commit)
from 1ef981e08fb9905fbe4fdd294197368a3a9e5bbb (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 f044dbbcab5f4fcefaf2952fa1b71eb68aba7999
Merge: 1ef981e f8e1022
Author: Brett Smith <brett at curoverse.com>
Date: Tue Apr 12 16:20:39 2016 -0400
Merge branch '8893-crunch-job-volumes-array-wip'
Closes #8893, #8921.
commit f8e1022669f0ab5d5db10d0e043b17be83d879b0
Author: Brett Smith <brett at curoverse.com>
Date: Fri Apr 8 10:56:34 2016 -0400
8893: Safer quoting of crunch-job's conditional volume switches.
Packing arguments into an array allows us to both have a variable
number of switches, with correct word splitting, even when the
indivdiual arguments in the array have whitespace.
diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index b4cb214..149d20b 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -862,12 +862,10 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
.q{&& SWAP=$(awk '($1 == "SwapTotal:"){print $2}' </proc/meminfo) }
."&& MEMLIMIT=\$(( (\$MEM * 95) / ($ENV{CRUNCH_NODE_SLOTS} * 100) )) "
."&& let SWAPLIMIT=\$MEMLIMIT+\$SWAP "
- # $VOLUME_CRUNCHRUNNER and $VOLUME_CERTS will be passed unquoted as
- # arguments to `docker run`. They must contain their own quoting.
- .q{&& VOLUME_CRUNCHRUNNER="" VOLUME_CERTS="" }
- .q{&& if which crunchrunner >/dev/null ; then VOLUME_CRUNCHRUNNER=--volume=$(which crunchrunner):/usr/local/bin/crunchrunner ; fi }
- .q{&& if test -f /etc/ssl/certs/ca-certificates.crt ; then VOLUME_CERTS=--volume=/etc/ssl/certs/ca-certificates.crt:/etc/arvados/ca-certificates.crt ; }
- .q{elif test -f /etc/pki/tls/certs/ca-bundle.crt ; then VOLUME_CERTS=--volume=/etc/pki/tls/certs/ca-bundle.crt:/etc/arvados/ca-certificates.crt ; fi };
+ .q{&& declare -a VOLUMES=() }
+ .q{&& if which crunchrunner >/dev/null ; then VOLUMES+=("--volume=$(which crunchrunner):/usr/local/bin/crunchrunner") ; fi }
+ .q{&& if test -f /etc/ssl/certs/ca-certificates.crt ; then VOLUMES+=("--volume=/etc/ssl/certs/ca-certificates.crt:/etc/arvados/ca-certificates.crt") ; }
+ .q{elif test -f /etc/pki/tls/certs/ca-bundle.crt ; then VOLUMES+=("--volume=/etc/pki/tls/certs/ca-bundle.crt:/etc/arvados/ca-certificates.crt") ; fi };
$command .= "&& exec arv-mount --read-write --mount-by-pdh=by_pdh --mount-tmp=tmp --crunchstat-interval=10 --allow-other $arv_file_cache \Q$keep_mnt\E --exec ";
$ENV{TASK_KEEPMOUNT} = "$keep_mnt/by_pdh";
@@ -934,7 +932,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
# Bind mount the crunchrunner binary and host TLS certificates file into
# the container.
- $command .= "\$VOLUME_CRUNCHRUNNER \$VOLUME_CERTS ";
+ $command .= '"${VOLUMES[@]}" ';
while (my ($env_key, $env_val) = each %ENV)
{
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list