X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/505c8fa50631201e289cc55230d46fdf52fa2055..f7499eb0eeb8f9cbfad1545f7e196f8939fb0f05:/build/run-build-docker-jobs-image.sh diff --git a/build/run-build-docker-jobs-image.sh b/build/run-build-docker-jobs-image.sh index d1fb2ac670..94a05671a2 100755 --- a/build/run-build-docker-jobs-image.sh +++ b/build/run-build-docker-jobs-image.sh @@ -139,6 +139,8 @@ if [[ -z "$ARVADOS_BUILDING_VERSION" ]] && ! [[ -z "$version_tag" ]]; then ARVADOS_BUILDING_ITERATION="1" fi +# This defines python_sdk_version and cwl_runner_version with python-style +# package suffixes (.dev/rc) calculate_python_sdk_cwl_package_versions echo cwl_runner_version $cwl_runner_version python_sdk_version $python_sdk_version @@ -149,7 +151,22 @@ else python_sdk_version="${ARVADOS_BUILDING_VERSION}-${ARVADOS_BUILDING_ITERATION}" fi -cwl_runner_version_orig=$cwl_runner_version +# For development and release candidate packages, the OS package has a "~dev" +# or "~rc" suffix, but Python requires a ".dev" or "rc" suffix. +# +# Arvados-cwl-runner will be expecting the Python-compatible version string +# when it tries to pull the Docker image, so we use that to tag the Docker +# image. +# +# The --build-arg docker invocation arguments are expecting the OS package +# version. +python_sdk_version_os=$(echo -n $python_sdk_version | sed s/.dev/~dev/g | sed s/rc/~rc/g) +cwl_runner_version_os=$(echo -n $cwl_runner_version | sed s/.dev/~dev/g | sed s/rc/~rc/g) + +if [[ -z "$cwl_runner_version" ]]; then + echo "ERROR: cwl_runner_version is empty"; + exit 1 +fi if [[ "${cwl_runner_version}" != "${ARVADOS_BUILDING_VERSION}" ]]; then cwl_runner_version="${cwl_runner_version}-1" @@ -159,10 +176,10 @@ fi cd docker/jobs docker build $NOCACHE \ - --build-arg python_sdk_version=${python_sdk_version} \ - --build-arg cwl_runner_version=${cwl_runner_version} \ + --build-arg python_sdk_version=${python_sdk_version_os} \ + --build-arg cwl_runner_version=${cwl_runner_version_os} \ --build-arg repo_version=${REPO} \ - -t arvados/jobs:$cwl_runner_version_orig . + -t arvados/jobs:$cwl_runner_version . ECODE=$? @@ -185,18 +202,6 @@ if docker --version |grep " 1\.[0-9]\." ; then FORCE=-f fi -if ! [[ -z "$version_tag" ]]; then - docker tag $FORCE arvados/jobs:$cwl_runner_version_orig arvados/jobs:"$version_tag" - ECODE=$? - - if [[ "$ECODE" != "0" ]]; then - EXITCODE=$(($EXITCODE + $ECODE)) - fi - - checkexit $ECODE "docker tag" - title "docker tag complete (`timer`)" -fi - title "uploading images" timer_reset @@ -208,11 +213,7 @@ else ## 20150526 nico -- *sometimes* dockerhub needs re-login ## even though credentials are already in .dockercfg docker login -u arvados - if ! [[ -z "$version_tag" ]]; then - docker_push arvados/jobs:"$version_tag" - else - docker_push arvados/jobs:$cwl_runner_version_orig - fi + docker_push arvados/jobs:$cwl_runner_version title "upload arvados images finished (`timer`)" else title "upload arvados images SKIPPED because no --upload option set (`timer`)"