1ec225ca128c60c2587ebcd950a7661f1ce4aa12
[arvados.git] / tools / arvbox / lib / arvbox / docker / service / sdk / run-service
1 #!/bin/bash
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 exec 2>&1
7 set -eux -o pipefail
8
9 . /usr/local/lib/arvbox/common.sh
10
11 mkdir -p ~/.pip /var/lib/pip
12 cat > ~/.pip/pip.conf <<EOF
13 [global]
14 download_cache = /var/lib/pip
15 EOF
16
17 cd /usr/src/arvados/sdk/cli
18 run_bundler --binstubs=$PWD/binstubs
19 ln -sf /usr/src/arvados/sdk/cli/binstubs/arv /usr/local/bin/arv
20
21 export PYCMD=python3
22
23 # Need to install the upstream version of pip because the python-pip package
24 # shipped with Debian 9 is patched to change behavior in a way that breaks our
25 # use case.
26 # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876145
27 # When a non-root user attempts to install system packages, it makes the
28 # --ignore-installed flag the default (and there is no way to turn it off),
29 # this has the effect of making it very hard to share dependencies shared among
30 # multiple packages, because it will blindly install the latest version of each
31 # dependency requested by each package, even if a compatible package version is
32 # already installed.
33 if ! pip3 install --no-index --find-links /var/lib/pip pip==9.0.3 ; then
34     pip3 install pip==9.0.3
35 fi
36
37 pip_install wheel
38
39 cd /usr/src/arvados/sdk/python
40 $PYCMD setup.py sdist
41 pip_install $(ls dist/arvados-python-client-*.tar.gz | tail -n1)
42
43 cd /usr/src/arvados/services/fuse
44 $PYCMD setup.py sdist
45 pip_install $(ls dist/arvados_fuse-*.tar.gz | tail -n1)
46
47 cd /usr/src/arvados/sdk/cwl
48 $PYCMD setup.py sdist
49 pip_install $(ls dist/arvados-cwl-runner-*.tar.gz | tail -n1)