#!/bin/sh
+set -x
+
if ! which arvbox >/dev/null ; then
export PATH=$PATH:$(readlink -f $(dirname $0)/../../tools/arvbox/bin)
fi
reset_container=1
leave_running=0
+config=dev
+tag=""
while test -n "$1" ; do
arg="$1"
case "$arg" in
--no-reset-container)
reset_container=0
- shift;
+ shift
;;
--leave-running)
leave_running=1
- shift;
+ shift
+ ;;
+ --config)
+ config=$2
+ shift ; shift
+ ;;
+ --tag)
+ tag=$2
+ shift ; shift
;;
- -*)
+ -h|--help)
+ echo "$0 [--no-reset-container] [--leave-running] [--config dev|localdemo] [--tag docker_tag]"
+ exit
+ ;;
+ *)
break
;;
esac
if test $reset_container = 1 ; then
arvbox reset -f
- arvbox build dev
fi
-arvbox start dev
+arvbox start $config $tag
arvbox pipe <<EOF
set -eu -o pipefail
. /usr/local/lib/arvbox/common.sh
-cd /usr/src/arvados/sdk/cwl
-python setup.py sdist
-pip_install \$(ls dist/arvados-cwl-runner-*.tar.gz | tail -n1)
+if test $config = dev ; then
+ cd /usr/src/arvados/sdk/cwl
+ python setup.py sdist
+ pip_install \$(ls -r dist/arvados-cwl-runner-*.tar.gz | head -n1)
+fi
mkdir -p /tmp/cwltest
cd /tmp/cwltest
export ARVADOS_API_HOST=localhost:8000
export ARVADOS_API_HOST_INSECURE=1
export ARVADOS_API_TOKEN=\$(cat /var/lib/arvados/superuser_token)
+
+cat >/tmp/cwltest/arv-cwl-jobs <<EOF2
+#!/bin/sh
+exec arvados-cwl-runner --api=jobs --compute-checksum \\\$@
+EOF2
+chmod +x /tmp/cwltest/arv-cwl-jobs
+
+cat >/tmp/cwltest/arv-cwl-containers <<EOF2
+#!/bin/sh
+exec arvados-cwl-runner --api=containers --compute-checksum \\\$@
+EOF2
+chmod +x /tmp/cwltest/arv-cwl-containers
+
env
-exec ./run_test.sh "$@"
+exec ./run_test.sh $@
EOF
CODE=$?