15
15
16
16
# this dockerfile builds a test environment for HTMap
17
17
18
- FROM ubuntu:bionic
18
+ ARG PYTHON_VERSION=3.6
19
+ FROM python:${PYTHON_VERSION}
20
+
21
+ # build config
22
+ ARG HTCONDOR_VERSION=8.8
19
23
20
24
# switch to root to do root-level config
21
25
USER root
22
26
23
- # build config
24
- ARG PYTHON_VERSION=3.7
25
- ARG HTCONDOR_VERSION=8.9
26
- ARG MINICONDA_VERSION=latest
27
-
28
27
# environment setup
29
28
ENV DEBIAN_FRONTEND=noninteractive
30
29
31
30
# install utils and dependencies
32
31
RUN apt-get update \
33
- && apt-get -y install --no-install-recommends vim less git gnupg wget ca-certificates locales \
32
+ && apt-get -y install --no-install-recommends vim less git gnupg wget ca-certificates locales graphviz \
34
33
&& apt-get -y clean \
35
34
&& rm -rf /var/lib/apt/lists/* \
36
35
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
@@ -41,50 +40,38 @@ ENV LC_ALL=en_US.UTF-8 \
41
40
LANGUAGE=en_US.UTF-8
42
41
43
42
# install HTCondor version specified in config
44
- RUN wget -qO - https://research.cs.wisc.edu/htcondor/ubuntu /HTCondor-Release.gpg.key | apt-key add - \
45
- && echo "deb http://research.cs.wisc.edu/htcondor/ubuntu /${HTCONDOR_VERSION}/bionic bionic contrib" >> /etc/apt/sources.list \
43
+ RUN wget -qO - https://research.cs.wisc.edu/htcondor/debian /HTCondor-Release.gpg.key | apt-key add - \
44
+ && echo "deb http://research.cs.wisc.edu/htcondor/debian /${HTCONDOR_VERSION}/buster buster contrib" >> /etc/apt/sources.list.d/htcondor .list \
46
45
&& apt-get -y update \
47
46
&& apt-get -y install --no-install-recommends htcondor \
48
47
&& apt-get -y clean \
49
48
&& rm -rf /var/lib/apt/lists/*
50
49
51
- # create a user to be our submitter and set conda install location
52
- ENV SUBMIT_USER=mapper
53
- ENV CONDA_DIR=/home/${SUBMIT_USER}/conda
54
- ENV PATH=${CONDA_DIR}/bin:${PATH}
50
+ # copy entrypoint into place and make executable
51
+ COPY tests/_inf/entrypoint.sh /.entrypoint.sh
52
+ RUN chmod +x /.entrypoint.sh
53
+
54
+ # create a user, set their PATH and PYTHONPATH
55
+ ENV SUBMIT_USER=mapper \
56
+ PATH="/home/mapper/.local/bin:${PATH}" \
57
+ PYTHONPATH="/home/mapper/htmap:${PYTHONPATH}"
55
58
RUN groupadd ${SUBMIT_USER} \
56
59
&& useradd -m -g ${SUBMIT_USER} ${SUBMIT_USER}
57
60
58
- # switch to submit user, don't need root anymore
61
+ # switch to the user, don't need root anymore
59
62
USER ${SUBMIT_USER}
60
63
61
- # install miniconda and python version specified in config
62
- # (and ipython, which is nice for debugging inside the container)
63
- RUN cd /tmp \
64
- && wget --quiet https://repo.continuum.io/miniconda/Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh \
65
- && bash Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh -f -b -p $CONDA_DIR \
66
- && rm Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh \
67
- && conda install python=${PYTHON_VERSION} ipython \
68
- && conda clean -y --all
69
-
70
- # install htmap dependencies early for docker build caching
71
- COPY requirements* /home/${SUBMIT_USER}/
72
- RUN pip install --no-cache-dir -r /home/${SUBMIT_USER}/requirements-dev.txt \
73
- && pip install --no-cache-dir --upgrade htcondor==${HTCONDOR_VERSION}.* \
74
- && rm /home/${SUBMIT_USER}/requirements*
75
-
76
- # set default entrypoint and command
77
- # the entrypoint is critical: it starts HTCondor in the container
78
- ENTRYPOINT ["tests/_inf/entrypoint.sh" ]
79
- CMD ["pytest" ]
64
+ # install htmap dependencies and debugging tools early for docker build caching
65
+ COPY requirements* /tmp/
66
+ RUN pip install --user --no-cache-dir -r /tmp/requirements-dev.txt \
67
+ && pip install --user --no-cache-dir ipython \
68
+ && pip install --user --no-cache-dir --upgrade htcondor==${HTCONDOR_VERSION}.*
80
69
81
70
# copy HTCondor and HTMap testing configs into place
82
71
COPY tests/_inf/condor_config.local /etc/condor/condor_config.local
83
- COPY tests/_inf/.htmaprc /home/${SUBMIT_USER}/.htmaprc
84
72
85
- # copy htmap package into container and install it
86
- # this is the only part that can't be cached against editing the package
87
- COPY --chown=mapper:mapper . /home/${SUBMIT_USER}/htmap
88
- RUN chmod +x /home/${SUBMIT_USER}/htmap/tests/_inf/entrypoint.sh /home/${SUBMIT_USER}/htmap/tests/_inf/travis.sh \
89
- && pip install --no-cache-dir --no-deps -e /home/${SUBMIT_USER}/htmap
73
+ # set default entrypoint and command
74
+ # the entrypoint is critical: it starts HTCondor in the container
90
75
WORKDIR /home/${SUBMIT_USER}/htmap
76
+ ENTRYPOINT ["/.entrypoint.sh" ]
77
+ CMD ["pytest" ]
0 commit comments