13306: test_with_arvbox.sh can test either python2 or python3
[arvados.git] / sdk / dev-jobs.dockerfile
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 # Dockerfile for building an arvados/jobs Docker image from local git tree.
6 #
7 # Intended for use by developers working on arvados-python-client or
8 # arvados-cwl-runner and need to run a crunch job with a custom package
9 # version.
10 #
11 # Use arvados/build/build-dev-docker-jobs-image.sh to build.
12 #
13 # (This dockerfile file must be located in the arvados/sdk/ directory because
14 #  of the docker build root.)
15
16 FROM debian:jessie
17 MAINTAINER Ward Vandewege <ward@curoverse.com>
18
19 ENV DEBIAN_FRONTEND noninteractive
20
21 ARG pythoncmd=python
22
23 RUN apt-get update -q && apt-get install -qy --no-install-recommends \
24     git ${pythoncmd}-pip ${pythoncmd}-virtualenv ${pythoncmd}-dev libcurl4-gnutls-dev \
25     libgnutls28-dev nodejs ${pythoncmd}-pyasn1-modules build-essential
26
27 RUN if [ "$pythoncmd" = "python3" ]; then \
28        pip3 install -U setuptools six requests ; \
29     else \
30        pip install -U setuptools six requests ; \
31     fi
32
33 ARG sdk
34 ARG runner
35 ARG salad
36 ARG cwltool
37
38 ADD python/dist/$sdk /tmp/
39 ADD cwl/salad_dist/$salad /tmp/
40 ADD cwl/cwltool_dist/$cwltool /tmp/
41 ADD cwl/dist/$runner /tmp/
42
43 RUN cd /tmp/arvados-python-client-* && $pythoncmd setup.py install
44 RUN if test -d /tmp/schema-salad-* ; then cd /tmp/schema-salad-* && $pythoncmd setup.py install ; fi
45 RUN if test -d /tmp/cwltool-* ; then cd /tmp/cwltool-* && $pythoncmd setup.py install ; fi
46 RUN cd /tmp/arvados-cwl-runner-* && $pythoncmd setup.py install
47
48 # Install dependencies and set up system.
49 RUN /usr/sbin/adduser --disabled-password \
50       --gecos 'Crunch execution user' crunch && \
51     /usr/bin/install --directory --owner=crunch --group=crunch --mode=0700 /keep /tmp/crunch-src /tmp/crunch-job
52
53 USER crunch