X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d911d9335fe92615ee479349952eff150f25e354..0c98c5c9c5902a94dc614736a46b43fd43faba6e:/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 7d7e1fc8ab..d2c9f7274b 100755 --- a/build/run-build-docker-jobs-image.sh +++ b/build/run-build-docker-jobs-image.sh @@ -9,7 +9,7 @@ function usage { echo >&2 echo >&2 "$0 options:" echo >&2 " -t, --tags version tag for docker" - echo >&2 " -r, --repo Arvados package repot to use: dev, testing, stable (default: dev)" + echo >&2 " -r, --repo Arvados package repo to use: dev (default), testing, stable" echo >&2 " -u, --upload Upload the images (docker push)" echo >&2 " --no-cache Don't use build cache" echo >&2 " -h, --help Display this help and exit" @@ -22,7 +22,7 @@ REPO=dev # NOTE: This requires GNU getopt (part of the util-linux package on Debian-based distros). TEMP=`getopt -o hut:r: \ - --long help,upload,no-cache,tags,repo: \ + --long help,upload,no-cache,tags:,repo: \ -n "$0" -- "$@"` if [ $? != 0 ] ; then echo "Use -h for help"; exit 1 ; fi @@ -139,15 +139,7 @@ if [[ -z "$ARVADOS_BUILDING_VERSION" ]] && ! [[ -z "$version_tag" ]]; then ARVADOS_BUILDING_ITERATION="1" 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 - cwl_runner_version=$(cd sdk/python && nohash_version_from_git 1.0) -fi +calculate_python_sdk_cwl_package_versions echo cwl_runner_version $cwl_runner_version python_sdk_version $python_sdk_version @@ -157,7 +149,13 @@ else python_sdk_version="${ARVADOS_BUILDING_VERSION}-${ARVADOS_BUILDING_ITERATION}" fi -cwl_runner_version_orig=$cwl_runner_version +# What we use to tag the Docker image. 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, but --build-arg is expecting the OS package +# version. +cwl_runner_version_tag=$(echo -n $cwl_runner_version | sed s/~dev/.dev/g | sed s/~rc/rc/g) if [[ "${cwl_runner_version}" != "${ARVADOS_BUILDING_VERSION}" ]]; then cwl_runner_version="${cwl_runner_version}-1" @@ -170,7 +168,7 @@ docker build $NOCACHE \ --build-arg python_sdk_version=${python_sdk_version} \ --build-arg cwl_runner_version=${cwl_runner_version} \ --build-arg repo_version=${REPO} \ - -t arvados/jobs:$cwl_runner_version_orig . + -t arvados/jobs:$cwl_runner_version_tag . ECODE=$? @@ -193,40 +191,18 @@ if docker --version |grep " 1\.[0-9]\." ; then FORCE=-f fi -#docker export arvados/jobs:$cwl_runner_version_orig | docker import - arvados/jobs:$cwl_runner_version_orig - -if ! [[ -z "$version_tag" ]]; then - docker tag $FORCE arvados/jobs:$cwl_runner_version_orig arvados/jobs:"$version_tag" -else - docker tag $FORCE arvados/jobs:$cwl_runner_version_orig arvados/jobs:latest -fi - -ECODE=$? - -if [[ "$ECODE" != "0" ]]; then - EXITCODE=$(($EXITCODE + $ECODE)) -fi - -checkexit $ECODE "docker tag" -title "docker tag complete (`timer`)" - title "uploading images" timer_reset -if [[ "$ECODE" != "0" ]]; then +if [[ "$EXITCODE" != "0" ]]; then title "upload arvados images SKIPPED because build or tag failed" else if [[ $upload == true ]]; then ## 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 - docker_push arvados/jobs:latest - fi + docker_push arvados/jobs:$cwl_runner_version_tag title "upload arvados images finished (`timer`)" else title "upload arvados images SKIPPED because no --upload option set (`timer`)"