-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
81 lines (65 loc) · 2.07 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# KATObitPipe Dockerfile
#
# MAINTAINER: Tom Mauch (tmauch@ska.ac.za)
FROM ubuntu:18.04
# Suppress debconf warnings
ENV DEBIAN_FRONTEND noninteractive
ENV PACKAGES \
build-essential \
ca-certificates \
curl \
git \
gosu \
libfreetype6 \
libgfortran3 \
libxml2 \
pigz \
pkg-config \
python3-dev \
rsync \
virtualenv
# Update, upgrade and install packages
RUN apt-get -y update && \
apt-get --no-install-recommends -y install $PACKAGES
# Set up python 3 virtualenv
RUN virtualenv -p /usr/bin/python3 /ve3 && \
. /ve3/bin/activate && \
pip install pip --upgrade
ENV PATH="/ve3/bin:${PATH}"
ENV VIRTUAL_ENV="/ve3"
# Install the pipeline
COPY . /KATObitPipe
WORKDIR /KATObitPipe
RUN pip install -r requirements.txt
RUN pip install .
# Retrieve Obit and set up environment
ENV OBIT_BASE_PATH="/Obit"
ENV OBIT_REVISION="648"
ENV OBIT_TARBALL="Obit.AVX-1.1.${OBIT_REVISION}.tar.gz"
RUN mkdir -p $OBIT_BASE_PATH && cd $OBIT_BASE_PATH && \
curl https://www.cv.nrao.edu/~bcotton/ObitBin/linux_distro/${OBIT_TARBALL} | tar xzf -
ENV OBIT_ROOT="${OBIT_BASE_PATH}/obit-distro-1.1.${OBIT_REVISION}"
ENV OBIT="${OBIT_ROOT}/lib/obit"
ENV OBIT_EXEC="${OBIT}"
ENV PATH="${OBIT}/bin:${PATH}"
ENV LD_LIBRARY_PATH="${OBIT_ROOT}/lib:${LD_LIBRARY_PATH}"
ENV PYTHONPATH="${OBIT_ROOT}/share/obittalk/python:${OBIT_ROOT}/share/python:${PYTHONPATH}"
# Get rid of Obit's gfortran because AIPS doesn't like it
RUN rm ${OBIT_ROOT}/lib/libgfortran*
RUN ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.3 ${OBIT_ROOT}/lib
# Copy metadata to Obit share
RUN cp ./FITS/* ${OBIT_ROOT}/share/obit/data
RUN cd ${OBIT_ROOT}/share/obit/data && gunzip *.fits.gz
RUN chmod -R 777 ${OBIT_ROOT}/share/obit/data
# Point the pipeline to the obit share
RUN echo "metadata_dir = ${OBIT_ROOT}/share/obit/data" >> katimrc.docker
# Copy the required AIPS to /aips
RUN tar zxvf 31DEC22.tar.gz
RUN mkdir /aips
RUN mv 31DEC22 /aips/31DEC22
RUN mkdir /scratch
VOLUME /scratch
WORKDIR /scratch
RUN chmod +x /KATObitPipe/entrypoint.sh
ENTRYPOINT ["/KATObitPipe/entrypoint.sh"]
CMD ["/bin/bash"]