Newer
Older
Stefano Alberto Russo
committed
FROM lofarit/base4.0.16
USER root
Stefano Alberto Russo
committed
# Package dependencies
COPY apt.sources.list /etc/apt/sources.list
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
# Support large mlocks
RUN echo "* - memlock unlimited" > /etc/security/limits.conf
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
ENV GNUCOMPILER 7
ENV DEB_SETUP_DEPENDENCIES \
dpkg-dev \
g++-$GNUCOMPILER \
gcc-$GNUCOMPILER \
libc-dev \
cmake \
gfortran-$GNUCOMPILER \
git \
wget \
subversion
ENV DEB_DEPENCENDIES \
python3-pip \
libfftw3-dev \
python3-numpy \
libfreetype6 \
libfreetype6-dev \
libpng-dev \
pkg-config \
python3-dev \
libboost-all-dev \
libcfitsio-dev \
libhdf5-dev \
wcslib-dev \
libatlas-base-dev \
liblapack-dev \
python3-tk \
libreadline6-dev \
subversion \
liblog4cplus-dev \
libhdf5-dev \
libncurses5-dev \
libsofa1-dev \
flex \
bison \
libbison-dev \
# Reference image generation dependencies
make
RUN apt-get update
RUN apt-get install -y $DEB_SETUP_DEPENDENCIES
RUN apt-get install -y $DEB_DEPENCENDIES
ENV PATH /usr/local/bin:$PATH
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
ENV PYTHONPATH /usr/local/lib/python2.7/site-packages:$PYTHONPATH
# Latest GCC segfaults when compiling casacore
RUN rm /usr/bin/gcc /usr/bin/g++ /usr/bin/cpp /usr/bin/cc
RUN ln -s /usr/bin/gcc-$GNUCOMPILER /usr/bin/gcc
RUN ln -s /usr/bin/g++-$GNUCOMPILER /usr/bin/g++
RUN ln -s /usr/bin/gcc-$GNUCOMPILER /usr/bin/cc
RUN ln -s /usr/bin/g++-$GNUCOMPILER /usr/bin/cpp
RUN ln -s /usr/bin/gfortran-$GNUCOMPILER /usr/bin/gfortran
Stefano Alberto Russo
committed
#####################################################################
# Add deployment keys
#####################################################################
RUN mkdir -p /root/.ssh/
COPY keys/lofarit_ddf2_rsa /root/.ssh/lofarit_ddf2_rsa
COPY keys/lofarit_killms_rsa /root/.ssh/lofarit_killms_rsa
RUN chmod 600 /root/.ssh/lofarit_ddf2_rsa && chmod 600 /root/.ssh/lofarit_killms_rsa
#####################################################################
Stefano Alberto Russo
committed
# Get DDF from private repo
#####################################################################
Stefano Alberto Russo
committed
# Add github key(s)
RUN ssh-keyscan github.com >> ~/.ssh/known_hosts
# Clone
RUN ssh-agent bash -c 'ssh-add /root/.ssh/lofarit_ddf2_rsa && cd /root/ && git clone git@github.com:cyriltasse/DDFacet'
# Checkout
RUN ssh-agent bash -c 'ssh-add /root/.ssh/lofarit_ddf2_rsa && cd /root/DDFacet && git pull && git checkout e98968d'
#####################################################################
# Build DDF from source
#####################################################################
RUN mkdir /opt/DDFacet
# Copy DDFacet and SkyModel into the image
RUN cp -a /root/DDFacet/DDFacet /opt/DDFacet/DDFacet && \
cp -a /root/DDFacet/SkyModel /opt/DDFacet/SkyModel && \
cp -a /root/DDFacet/MANIFEST.in /opt/DDFacet/MANIFEST.in && \
cp -a /root/DDFacet/setup.py /opt/DDFacet/setup.py && \
cp -a /root/DDFacet/setup.cfg /opt/DDFacet/setup.cfg && \
cp -a /root/DDFacet/README.rst /opt/DDFacet/README.rst && \
cp -a /root/DDFacet/pyproject.toml /opt/DDFacet/pyproject.toml && \
cp -a /root/DDFacet/.git /opt/DDFacet/.git && \
cp -a /root/DDFacet/.gitignore /opt/DDFacet/.gitignore && \
cp -a /root/DDFacet/.gitmodules /opt/DDFacet/.gitmodules
# Finally install DDFacet
RUN rm -rf /opt/DDFacet/DDFacet/cbuild
RUN pip3 install -U pip setuptools wheel
RUN python3 -m pip install pybind11
RUN python3 -m pip install tensorflow==1.8.0
RUN python3 -m pip install -U "/opt/DDFacet/[dft-support,moresane-support,testing-requirements,fits-beam-support]"
RUN cd /opt/DDFacet/ && python3 setup.py build && cd /
Stefano Alberto Russo
committed
# Set MeqTrees Cattery path to installation directory
ENV MEQTREES_CATTERY_PATH /usr/local/lib/python3.6/dist-packages/Cattery/
ENV PYTHONPATH $MEQTREES_CATTERY_PATH:$PYTHONPATH
RUN python3 -m pip install numpy==1.17.0
RUN python3 -c "import Siamese"
RUN python3 -c "import bdsf"
Stefano Alberto Russo
committed
# Perform some basic tests
RUN DDF.py --help
RUN MakeMask.py --help
RUN MakeCatalog.py --help
RUN MakeModel.py --help
RUN MaskDicoModel.py --help
RUN ClusterCat.py --help
Stefano Alberto Russo
committed
#####################################################################
Stefano Alberto Russo
committed
# Get and build killMs
#####################################################################
Stefano Alberto Russo
committed
# Clone
RUN ssh-agent bash -c 'ssh-add /root/.ssh/lofarit_killms_rsa && cd /opt/ && git clone git@github.com:cyriltasse/killMS'
# Checkout
RUN ssh-agent bash -c 'ssh-add /root/.ssh/lofarit_killms_rsa && cd /opt/killMS && git pull && git checkout 0607798'
RUN pip3 install /opt/killMS
RUN cd /opt/killMS; python3 setup.py build
Stefano Alberto Russo
committed
#####################################################################
# Remove deploymnet keys
#####################################################################
RUN rm -f /root/.ssh/lofarit_ddf2_rsa && rm -f /root/.ssh/lofarit_killms_rsa
#####################################################################
Stefano Alberto Russo
committed
# DDF-PIPELINE
#####################################################################
RUN pip3 install pyregion sshtunnel pymysql
RUN cd /opt; git clone https://github.com/mhardcastle/ddf-pipeline
RUN sed -e "s|INSTALLDIR|/opt|" /opt/ddf-pipeline/misc/DDF.sh > /opt/DDFacet/init.sh
RUN cd /opt && git clone https://www.ict.inaf.it/gitlab/lofarit/container-data.git
Stefano Alberto Russo
committed
#####################################################################
# Switch back to lofar user and set env
#####################################################################
USER lofar
ENV DDF_PIPELINE_CATALOGS='/opt/container-data/bootstrap-cats/'
Stefano Alberto Russo
committed
ENV CONTAINER_NAME='ddfacet_ssd-py3_kms-lofar-release-4_0_16'