2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: Apache-2.0
8 if ! which arvbox >/dev/null ; then
9 export PATH=$PATH:$(readlink -f $(dirname $0)/../../tools/arvbox/bin)
21 while test -n "$1" ; do
61 echo "$0 [--no-reset-container] [--leave-running] [--config dev|localdemo] [--tag docker_tag] [--build] [--pythoncmd python(2|3)] [--suite (integration|conformance-v1.0|conformance-*)]"
70 if test -z "$ARVBOX_CONTAINER" ; then
71 export ARVBOX_CONTAINER=cwltest
74 if test "$suite" = "conformance" ; then
75 suite=conformance-v1.0
78 if test $reset_container = 1 ; then
80 docker rm $ARVBOX_CONTAINER
84 arvbox start $config $tag
89 . /usr/local/lib/arvbox/common.sh
91 export PYCMD=$pythoncmd
93 if test $config = dev ; then
94 cd /usr/src/arvados/sdk/cwl
95 \$PYCMD setup.py sdist
96 pip_install \$(ls -r dist/arvados-cwl-runner-*.tar.gz | head -n1)
101 if [ "\$PYCMD" = "python3" ]; then
107 mkdir -p /tmp/cwltest
110 if [[ "$suite" = "conformance-v1.0" ]] ; then
111 if ! test -d common-workflow-language ; then
112 git clone https://github.com/common-workflow-language/common-workflow-language.git
114 cd common-workflow-language
115 elif [[ "$suite" =~ conformance-(.*) ]] ; then
116 version=\${BASH_REMATCH[1]}
117 if ! test -d cwl-\${version} ; then
118 git clone https://github.com/common-workflow-language/cwl-\${version}.git
121 elif [[ "$suite" != "integration" ]] ; then
122 echo "ERROR: unknown suite '$suite'"
126 if [[ "$suite" != "integration" ]] ; then
130 export ARVADOS_API_HOST=localhost:8000
131 export ARVADOS_API_HOST_INSECURE=1
132 export ARVADOS_API_TOKEN=\$(cat /var/lib/arvados-arvbox/superuser_token)
134 if test -n "$build" ; then
135 /usr/src/arvados/build/build-dev-docker-jobs-image.sh
136 elif test "$tag" = "latest" ; then
137 arv-keepdocker --pull arvados/jobs $tag
140 export WORKSPACE=/usr/src/arvados
141 . /usr/src/arvados/build/run-library.sh
145 # This defines python_sdk_version and cwl_runner_version with python-style
146 # package suffixes (.dev/rc)
147 calculate_python_sdk_cwl_package_versions
152 arv-keepdocker --pull arvados/jobs \$cwl_runner_version
153 docker tag arvados/jobs:\$cwl_runner_version arvados/jobs:latest
154 arv-keepdocker arvados/jobs latest
157 cat >/tmp/cwltest/arv-cwl-jobs <<EOF2
159 exec arvados-cwl-runner --api=jobs \\\$@
161 chmod +x /tmp/cwltest/arv-cwl-jobs
163 cat >/tmp/cwltest/arv-cwl-containers <<EOF2
165 exec arvados-cwl-runner --api=containers \\\$@
167 chmod +x /tmp/cwltest/arv-cwl-containers
169 EXTRA=--compute-checksum
171 if [[ $devcwl -eq 1 ]] ; then
172 EXTRA="\$EXTRA --enable-dev"
176 if [[ "$suite" = "integration" ]] ; then
177 cd /usr/src/arvados/sdk/cwl/tests
178 exec ./arvados-tests.sh $@
180 exec ./run_test.sh RUNNER=/tmp/cwltest/arv-cwl-${runapi} EXTRA="\$EXTRA" $@
186 if test $leave_running = 0 ; then