X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0561bd0c3c07257fd58ded6c7cfa5feeae97af57..bc4f35573b38ccde0756209057c8bce6947a38bc:/build/build-dev-docker-jobs-image.sh diff --git a/build/build-dev-docker-jobs-image.sh b/build/build-dev-docker-jobs-image.sh index 46e525bfa7..52df80f582 100755 --- a/build/build-dev-docker-jobs-image.sh +++ b/build/build-dev-docker-jobs-image.sh @@ -15,16 +15,16 @@ Syntax: WORKSPACE=path Path to the Arvados source tree to build packages from CWLTOOL=path (optional) Path to cwltool git repository. +SALAD=path (optional) Path to schema_salad git repository. +PYCMD=pythonexec (optional) Specify the python executable to use in the docker image. Defaults to "python". EOF set -e if [[ -z "$WORKSPACE" ]] ; then - echo "$helpmessage" - echo - echo "Must set WORKSPACE" - exit 1 + export WORKSPACE=$(readlink -f $(dirname $0)/..) + echo "Using WORKSPACE $WORKSPACE" fi if [[ -z "$ARVADOS_API_HOST" || -z "$ARVADOS_API_TOKEN" ]] ; then @@ -36,12 +36,29 @@ fi cd "$WORKSPACE" +py=python +pipcmd=pip +if [[ -n "$PYCMD" ]] ; then + py="$PYCMD" + if [[ $py = python3 ]] ; then + pipcmd=pip3 + fi +fi + (cd sdk/python && python setup.py sdist) sdk=$(cd sdk/python/dist && ls -t arvados-python-client-*.tar.gz | head -n1) (cd sdk/cwl && python setup.py sdist) runner=$(cd sdk/cwl/dist && ls -t arvados-cwl-runner-*.tar.gz | head -n1) +rm -rf sdk/cwl/salad_dist +mkdir -p sdk/cwl/salad_dist +if [[ -n "$SALAD" ]] ; then + (cd "$SALAD" && python setup.py sdist) + salad=$(cd "$SALAD/dist" && ls -t schema-salad-*.tar.gz | head -n1) + cp "$SALAD/dist/$salad" $WORKSPACE/sdk/cwl/salad_dist +fi + rm -rf sdk/cwl/cwltool_dist mkdir -p sdk/cwl/cwltool_dist if [[ -n "$CWLTOOL" ]] ; then @@ -55,12 +72,13 @@ fi python_sdk_ts=$(cd sdk/python && timestamp_from_git) cwl_runner_ts=$(cd sdk/cwl && timestamp_from_git) +python_sdk_version=$(cd sdk/python && nohash_version_from_git 0.1) +cwl_runner_version=$(cd sdk/cwl && nohash_version_from_git 1.0) + if [[ $python_sdk_ts -gt $cwl_runner_ts ]]; then - gittag=$(git log --first-parent --max-count=1 --format=format:%H sdk/python) -else - gittag=$(git log --first-parent --max-count=1 --format=format:%H sdk/cwl) + cwl_runner_version=$(cd sdk/python && nohash_version_from_git 1.0) fi -docker build --build-arg sdk=$sdk --build-arg runner=$runner --build-arg cwltool=$cwltool -f "$WORKSPACE/sdk/dev-jobs.dockerfile" -t arvados/jobs:$gittag "$WORKSPACE/sdk" -echo arv-keepdocker arvados/jobs $gittag -arv-keepdocker arvados/jobs $gittag +docker build --build-arg sdk=$sdk --build-arg runner=$runner --build-arg salad=$salad --build-arg cwltool=$cwltool --build-arg pythoncmd=$py --build-arg pipcmd=$pipcmd -f "$WORKSPACE/sdk/dev-jobs.dockerfile" -t arvados/jobs:$cwl_runner_version "$WORKSPACE/sdk" +echo arv-keepdocker arvados/jobs $cwl_runner_version +arv-keepdocker arvados/jobs $cwl_runner_version