projects
/
arvados-dev.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d870a5
)
Improve error handling and reporting in run-cwl-test.sh script. no issue #
author
Peter Amstutz <peter.amstutz@curoverse.com>
Fri, 4 Nov 2016 14:06:09 +0000
(10:06 -0400)
committer
Peter Amstutz <peter.amstutz@curoverse.com>
Fri, 4 Nov 2016 14:06:32 +0000
(10:06 -0400)
jenkins/run-cwl-test.sh
patch
|
blob
|
history
diff --git
a/jenkins/run-cwl-test.sh
b/jenkins/run-cwl-test.sh
index 068acd8cb775c7f7ca30f116f67cfb2406137bf6..f5ffefe8f591323f0b88a552ad88e3ddcdd0526e 100755
(executable)
--- a/
jenkins/run-cwl-test.sh
+++ b/
jenkins/run-cwl-test.sh
@@
-1,7
+1,10
@@
#!/bin/bash
#!/bin/bash
+set -o pipefail
+
DEBUG=0
SSH_PORT=22
DEBUG=0
SSH_PORT=22
+ACCT=ci
function usage {
echo >&2
function usage {
echo >&2
@@
-11,6
+14,7
@@
function usage {
echo >&2
echo >&2 "$0 options:"
echo >&2 " -p, --port <ssh port> SSH port to use (default 22)"
echo >&2
echo >&2 "$0 options:"
echo >&2 " -p, --port <ssh port> SSH port to use (default 22)"
+ echo >&2 " --acct <username> Account to log in with"
echo >&2 " -d, --debug Enable debug output"
echo >&2 " -h, --help Display this help and exit"
echo >&2
echo >&2 " -d, --debug Enable debug output"
echo >&2 " -h, --help Display this help and exit"
echo >&2
@@
-27,7
+31,7
@@
function usage {
echo >&2 "\"POST /arvados/v1/collections\","
echo >&2 "\"POST /arvados/v1/links\","
echo >&2 "\"GET /arvados/v1/users/current\","
echo >&2 "\"POST /arvados/v1/collections\","
echo >&2 "\"POST /arvados/v1/links\","
echo >&2 "\"GET /arvados/v1/users/current\","
- echo >&2 "\"POST /arvados/v1/users/current\","
+ echo >&2 "\"POST /arvados/v1/users/current\","
echo >&2 "\"GET /arvados/v1/jobs\","
echo >&2 "\"POST /arvados/v1/jobs\","
echo >&2 "\"GET /arvados/v1/pipeline_instances\","
echo >&2 "\"GET /arvados/v1/jobs\","
echo >&2 "\"POST /arvados/v1/jobs\","
echo >&2 "\"GET /arvados/v1/pipeline_instances\","
@@
-35,13
+39,13
@@
function usage {
echo >&2 "\"POST /arvados/v1/pipeline_instances\","
echo >&2 "\"GET /arvados/v1/collections/\","
echo >&2 "\"POST /arvados/v1/collections/\","
echo >&2 "\"POST /arvados/v1/pipeline_instances\","
echo >&2 "\"GET /arvados/v1/collections/\","
echo >&2 "\"POST /arvados/v1/collections/\","
- echo >&2 "\"GET /arvados/v1/logs\" ]"
+ echo >&2 "\"GET /arvados/v1/logs\" ]"
echo >&2
}
# NOTE: This requires GNU getopt (part of the util-linux package on Debian-based distros).
TEMP=`getopt -o hdp: \
echo >&2
}
# NOTE: This requires GNU getopt (part of the util-linux package on Debian-based distros).
TEMP=`getopt -o hdp: \
- --long help,debug,port: \
+ --long help,debug,port:
,acct:
\
-n "$0" -- "$@"`
if [ $? != 0 ] ; then echo "Use -h for help"; exit 1 ; fi
-n "$0" -- "$@"`
if [ $? != 0 ] ; then echo "Use -h for help"; exit 1 ; fi
@@
-54,6
+58,9
@@
do
-p | --port)
SSH_PORT="$2"; shift 2
;;
-p | --port)
SSH_PORT="$2"; shift 2
;;
+ --acct)
+ ACCT="$2"; shift 2
+ ;;
-d | --debug)
DEBUG=1
shift
-d | --debug)
DEBUG=1
shift
@@
-105,16
+112,16
@@
function run_command() {
return_var=$2
command=$3
return_var=$2
command=$3
- title "Running '${command/ARVADOS_API_TOKEN=
??????????????????????????????????????????????????
/ARVADOS_API_TOKEN=suppressed}' on $node"
+ title "Running '${command/ARVADOS_API_TOKEN=
*
/ARVADOS_API_TOKEN=suppressed}' on $node"
TMP_FILE=`mktemp`
if [[ "$DEBUG" != "0" ]]; then
TMP_FILE=`mktemp`
if [[ "$DEBUG" != "0" ]]; then
- ssh -t -p$SSH_PORT -o "StrictHostKeyChecking no" -o "ConnectTimeout 125" ci@$node -C "$command" | tee $TMP_FILE
+ ssh -t -p$SSH_PORT -o "StrictHostKeyChecking no" -o "ConnectTimeout 125" $ACCT@$node -C "$command" | tee $TMP_FILE
+ ECODE=$?
else
else
- ssh -t -p$SSH_PORT -o "StrictHostKeyChecking no" -o "ConnectTimeout 125" ci@$node -C "$command" > $TMP_FILE 2>&1
+ ssh -t -p$SSH_PORT -o "StrictHostKeyChecking no" -o "ConnectTimeout 125" $ACCT@$node -C "$command" > $TMP_FILE 2>&1
+ ECODE=$?
fi
fi
- ECODE=$?
-
if [[ "$ECODE" != "255" && "$ECODE" != "0" ]]; then
# Ssh exists 255 if the connection timed out. Just ignore that, it's possible that this node is
# a shell node that is down.
if [[ "$ECODE" != "255" && "$ECODE" != "0" ]]; then
# Ssh exists 255 if the connection timed out. Just ignore that, it's possible that this node is
# a shell node that is down.
@@
-125,8
+132,7
@@
function run_command() {
fi
fi
if [[ "$ECODE" == "255" ]]; then
fi
fi
if [[ "$ECODE" == "255" ]]; then
- title "Connection timed out"
- ECODE=0
+ title "Connection denied or timed out"
fi
rm -f $TMP_FILE
eval "$return_var=$ECODE"
fi
rm -f $TMP_FILE
eval "$return_var=$ECODE"
@@
-153,11
+159,10
@@
fi
run_command shell.$IDENTIFIER ECODE "if [[ ! -e arvados-cwl-runner-with-checksum.sh ]]; then printf \"%s\n%s\n\" '#!/bin/sh' 'exec arvados-cwl-runner --compute-checksum \"\$@\"' > arvados-cwl-runner-with-checksum.sh; chmod 755 arvados-cwl-runner-with-checksum.sh; fi"
if [[ "$ECODE" != "0" ]]; then
run_command shell.$IDENTIFIER ECODE "if [[ ! -e arvados-cwl-runner-with-checksum.sh ]]; then printf \"%s\n%s\n\" '#!/bin/sh' 'exec arvados-cwl-runner --compute-checksum \"\$@\"' > arvados-cwl-runner-with-checksum.sh; chmod 755 arvados-cwl-runner-with-checksum.sh; fi"
if [[ "$ECODE" != "0" ]]; then
- echo "Failed to create ~
ci
/arvados-cwl-runner-with-checksum.sh"
+ echo "Failed to create ~
$ACCT
/arvados-cwl-runner-with-checksum.sh"
exit $ECODE
fi
exit $ECODE
fi
-run_command shell.$IDENTIFIER ECODE "cd common-workflow-language; git pull; ARVADOS_API_HOST=$ARVADOS_API_HOST ARVADOS_API_TOKEN=$ARVADOS_API_TOKEN ./run_test.sh RUNNER=/home/
ci
/arvados-cwl-runner-with-checksum.sh "
+run_command shell.$IDENTIFIER ECODE "cd common-workflow-language; git pull; ARVADOS_API_HOST=$ARVADOS_API_HOST ARVADOS_API_TOKEN=$ARVADOS_API_TOKEN ./run_test.sh RUNNER=/home/
$ACCT
/arvados-cwl-runner-with-checksum.sh "
exit $ECODE
exit $ECODE
-