2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
6 read -rd "\000" helpmessage <<EOF
7 Build an arvados/jobs Docker image from local git tree.
9 Intended for use by developers working on arvados-python-client or
10 arvados-cwl-runner and need to run a crunch job with a custom package
11 version. Also supports building custom cwltool if CWLTOOL is set.
14 WORKSPACE=/path/to/arvados $(basename $0)
16 WORKSPACE=path Path to the Arvados source tree to build packages from
17 CWLTOOL=path (optional) Path to cwltool git repository.
18 SALAD=path (optional) Path to schema_salad git repository.
19 CWL_UTILS=path (optional) Path to cwl-utils git repository.
25 if [[ -z "$WORKSPACE" ]] ; then
26 export WORKSPACE=$(readlink -f $(dirname $0)/..)
27 echo "Using WORKSPACE $WORKSPACE"
30 context_dir="$(mktemp --directory --tmpdir dev-jobs.XXXXXXXX)"
31 trap 'rm -rf "$context_dir"' EXIT INT TERM QUIT
33 for src_dir in "$WORKSPACE/sdk/python" "${CWLTOOL:-}" "${CWL_UTILS:-}" "${SALAD:-}" "$WORKSPACE/tools/crunchstat-summary" "$WORKSPACE/sdk/cwl"; do
34 if [[ -z "$src_dir" ]]; then
37 env -C "$src_dir" python3 setup.py sdist --dist-dir="$context_dir"
41 . build/run-library.sh
42 # This defines python_sdk_version and cwl_runner_version with python-style
43 # package suffixes (.dev/rc)
44 calculate_python_sdk_cwl_package_versions
47 docker build --no-cache \
48 -f "$WORKSPACE/sdk/dev-jobs.dockerfile" \
49 -t arvados/jobs:$cwl_runner_version \
52 arv-keepdocker arvados/jobs $cwl_runner_version