GitLab will be in maintenance on October the 8th from 18:00 CET until 23:59 CET.

Skip to content
Snippets Groups Projects
Select Git revision
  • f0980ea409f6a5d65c967eca737b2c0b69ba864d
  • master default protected
  • TMSS-3279
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

Dockerfile.tmpl

  • user avatar
    ROHD-1980: Add --depth 1 --shallow-submodiles to git clone commands
    Thomas Jürges authored
    This limist the clone to just the branch that is requested and won't
    clone an entire repository.
    f0980ea4
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Dockerfile.tmpl 11.82 KiB
    #
    # base
    #
    
    # Allow to specify a specific base image version.
    ARG LOFAR_BASE_IMAGE_VERSION=latest
    FROM lofar-base:${LOFAR_BASE_IMAGE_VERSION}
    ENV LOFAR_BASE_IMAGE_VERSION=${LOFAR_BASE_IMAGE_VERSION}
    
    # Add build date to the environment
    ARG DOCKER_IMAGE_BUILD_DATE="The build date has to be set by a --build-arg parameter!"
    ENV DOCKER_IMAGE_BUILD_DATE=${DOCKER_IMAGE_BUILD_DATE}
    
    # Allow to specify the LOFAR branch at build time of the image.
    # Use master as the default if nothing is specified.
    ARG LOFAR_VERSION=latest
    ENV LOFAR_VERSION=${LOFAR_VERSION}
    
    
    ENV AOFLAGGER_VERSION=v2.14.0 \
        PYBDSF_VERSION=v1.9.0 \
        DYSCO_VERSION=v1.2 \
        BLITZ_VERSION=1.0.1 \
        LIBLAPACK_VERSION=3 \
        LIBLOG4CPLUS_VERSION=1.1-9 \
        LIBSIGCPP_VERSION=2.0 \
        LIBXMLPP_VERSION=2.6 \
        LIBGSL_VERSION=23 \
        LIBPQXX_VERSION=4.0v5 \
        DAL_VERSION=v3.3.1 \
        XMLRUNNER_VERSION=1.7.7 \
        MONETDB_VERSION=11.19.3.2
    
    
    # Run-time dependencies
    RUN aptitude install -y liblog4cplus-${LIBLOG4CPLUS_VERSION} libxml2-utils libpng-tools libsigc++-${LIBSIGCPP_VERSION}-0v5 libxml++${LIBXMLPP_VERSION}-2v5 libgsl${LIBGSL_VERSION} openssh-client gettext-base rsync python3-matplotlib ipython3 libhdf5-${LIBHDF5_VERSION} libcfitsio-bin libwcs5 && \
        aptitude clean && \
        aptitude autoclean
    
    # Install
    RUN export BUILD_PACKAGES="python3-pip python3-dev python3-setuptools liblog4cplus-dev libpng-dev libsigc++-${LIBSIGCPP_VERSION}-dev libxml++${LIBXMLPP_VERSION}-dev libgsl-dev libcfitsio-dev wcslib-dev libhdf5-dev" && \
        aptitude install -y ${BUILD_PACKAGES} && \
        pip3 install xmlrunner==${XMLRUNNER_VERSION} python-monetdb==${MONETDB_VERSION} && \
        aptitude purge -y ${BUILD_PACKAGES} && \
        aptitude clean && \
        aptitude autoclean
    
    #
    # *******************
    #   PyBDSF
    # *******************
    #
    # 2018-05-30, Thomas:
    # ATTENTION!  PyBDSF <= 1.8.14 needs Boost < 1.65!
    # There is an unresolved symbol thing when importing bdsf in Python:
    #
    # root@768bb78135d4:/# PYTHONPATH=/opt/pybdsf/lib/python2.7/site-packages/ python
    # Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2
    # Type "help", "copyright", "credits" or "license" for more information.
    # >>> import bdsf
    # Traceback (most recent call last):
    #   File "<stdin>", line 1, in <module>
    #   File "/opt/pybdsf/lib/python2.7/site-packages/bdsf-1.8.14-py2.7-linux-x86_64.egg/bdsf/__init__.py", line 19, in <module>
    #     from collapse import Op_collapse
    #   File "/opt/pybdsf/lib/python2.7/site-packages/bdsf-1.8.14-py2.7-linux-x86_64.egg/bdsf/collapse.py", line 10, in <module>
    #     import _cbdsm
    # ImportError: /opt/pybdsf/lib/python2.7/site-packages/bdsf-1.8.14-py2.7-linux-x86_64.egg/bdsf/_cbdsm.so: undefined symbol: _ZN5boost6python5numpy6detail13get_int_dtypeILi64ELb0EEENS1_5dtypeEv
    # >>>
    #
    # Run-time dependencies
    RUN aptitude install -y libboost-python${BOOST_VERSION}.1 libboost-numpy${BOOST_VERSION}.1 && \
        aptitude clean && \
        aptitude autoclean
    
    # Install
    RUN export BUILD_PACKAGES="git g++ gfortran libboost-python${BOOST_VERSION}-dev libboost-numpy${BOOST_VERSION}-dev python3-setuptools python3-numpy-dev swig3.0" && \
        aptitude install -y ${BUILD_PACKAGES} && \
        mkdir ${INSTALLDIR}/pybdsf && \
        git clone --depth 1 --shallow-submodules --branch ${PYBDSF_VERSION//latest/master} https://github.com/lofar-astron/pybdsf.git ${INSTALLDIR}/pybdsf/pybdsf-${PYBDSF_VERSION} && \
        cd ${INSTALLDIR}/pybdsf/pybdsf-${PYBDSF_VERSION} && \
        mkdir -p ${INSTALLDIR}/pybdsf/lib/python${PYTHON_VERSION}/site-packages/ && \
        export PYTHONPATH=${INSTALLDIR}/pybdsf/lib/python${PYTHON_VERSION}/site-packages:${INSTALLDIR}/pybdsf/lib64/python${PYTHON_VERSION}/site-packages:${PYTHONPATH} && \
        cd ${INSTALLDIR}/pybdsf/pybdsf-${PYBDSF_VERSION} && \
        python3 setup.py install --prefix=${INSTALLDIR}/pybdsf/ && \
        cd .. && \
        rm -rf ${INSTALLDIR}/pybdsf/pybdsf-${PYBDSF_VERSION} && \
        aptitude purge -y ${BUILD_PACKAGES} && \
        aptitude clean && \
        aptitude autoclean
    
    
    #
    # *******************
    #   AOFlagger
    # *******************
    #
    # Run-time dependencies
    RUN aptitude install -y libxml++${LIBXMLPP_VERSION}-2v5 libpng-tools libfftw3-bin libboost-python${BOOST_VERSION}.1 libboost-filesystem${BOOST_VERSION}.1 libboost-date-time${BOOST_VERSION}.1 libboost-signals${BOOST_VERSION}.1 libboost-thread${BOOST_VERSION}.1 libpython2.7 && \
        aptitude clean && \
        aptitude autoclean
    
    # Install
    RUN export BUILD_PACKAGES="doxygen git cmake g++ libxml++${LIBXMLPP_VERSION}-dev libpng-dev libfftw3-dev libboost-python${BOOST_VERSION}-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-signals${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev libcfitsio-dev libopenblas-dev" && \
        aptitude install -y ${BUILD_PACKAGES} && \
        mkdir -p ${INSTALLDIR}/aoflagger && \
        git clone --depth 1 --shallow-submodules https://git.code.sf.net/p/aoflagger/code ${INSTALLDIR}/aoflagger/aoflagger-${AOFLAGGER_VERSION} && \
        cd ${INSTALLDIR}/aoflagger/aoflagger-${AOFLAGGER_VERSION} && git checkout ${AOFLAGGER_VERSION//latest/master} && \
        mkdir ${INSTALLDIR}/aoflagger/build && \
        cd ${INSTALLDIR}/aoflagger/build && \
        cmake -DCASACORE_ROOT_DIR=${INSTALLDIR}/casacore/ -DPORTABLE=True -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS} -DNDEBUG" -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/aoflagger ${INSTALLDIR}/aoflagger/aoflagger-${AOFLAGGER_VERSION} && \
        make -j ${J} && \
        make install && \
        cd .. && \
        rm -rf ${INSTALLDIR}/aoflagger/{build,aoflagger-${AOFLAGGER_VERSION}} && \
        bash -c "strip ${INSTALLDIR}/aoflagger/{lib,bin}/* || true" && \
        aptitude purge -y ${BUILD_PACKAGES} && \
        aptitude clean && \
        aptitude autoclean
    
    
    #
    # *******************
    #   DYSCO
    # *******************
    #
    # Run-time dependencies
    RUN aptitude install -y libgsl${LIBGSL_VERSION} libhdf5-${LIBHDF5_VERSION} && \
        aptitude clean && \
        aptitude autoclean
    
    RUN export BUILD_PACKAGES="git cmake g++ python3-setuptools doxygen libgsl0-dev libopenblas-dev libboost-date-time${BOOST_VERSION}-dev libhdf5-dev" && \
        aptitude install -y ${BUILD_PACKAGES} && \
        mkdir ${INSTALLDIR}/dysco && \
        git clone --depth 1 --shallow-submodules --branch ${DYSCO_VERSION//latest/master} https://github.com/aroffringa/dysco.git ${INSTALLDIR}/dysco/dysco-${DYSCO_VERSION} && \
        cd ${INSTALLDIR}/dysco && \
        mkdir build && \
        cd build && \
        cmake -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DPORTABLE=True -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/dysco/ -DCASACORE_ROOT_DIR=${INSTALLDIR}/casacore/ ${INSTALLDIR}/dysco/dysco-${DYSCO_VERSION} && \
        make -j ${J} && \
        make install && \
        #mkdir -p ${INSTALLDIR}/dysco/lib/python${PYTHON_VERSION}/site-packages/ && \
        #export PYTHONPATH=${INSTALLDIR}/dysco/lib/python${PYTHON_VERSION}/site-packages:${INSTALLDIR}/dysco/lib64/python${PYTHON_VERSION}/site-packages:${PYTHONPATH} && \
        rm -rf ${INSTALLDIR}/dysco/{build,dysco-${DYSCO_VERSION}} && \
        aptitude purge -y ${BUILD_PACKAGES} && \
        aptitude clean && \
        aptitude autoclean
    
     ENV LD_LIBRARY_PATH=${INSTALLDIR}/dysco/lib:${LD_LIBRARY_PATH}
     ENV PATH=${INSTALLDIR}/dysco/bin:${PATH}
    
    
    #
    # *******************
    #   Blitz++
    # *******************
    #
    # Run-time dependencies
    RUN aptitude install -y libboost-mpi-dev libboost-serialization${BOOST_VERSION}-dev libboost-serialization${BOOST_VERSION}.1 && \
        aptitude clean && \
        aptitude autoclean
    
    RUN export BUILD_PACKAGES="git g++ gfortran autoconf automake make python" && \
        aptitude install -y ${BUILD_PACKAGES} && \
        mkdir -p ${INSTALLDIR}/blitz && \
        git clone --depth 1 --shallow-submodules --branch ${BLITZ_VERSION//latest/master} https://github.com/blitzpp/blitz.git ${INSTALLDIR}/blitz/blitz-${BLITZ_VERSION} && \
        cd ${INSTALLDIR}/blitz/blitz-${BLITZ_VERSION} && \
        autoreconf -fiv && ./configure --prefix=${INSTALLDIR}/blitz/ && \
        make -j ${J} lib && \
        make install && \
        rm -rf ${INSTALLDIR}/blitz/blitz-${BLITZ_VERSION} && \
        aptitude purge -y ${BUILD_PACKAGES} && \
        aptitude clean && \
        aptitude autoclean
    
    ENV LD_LIBRARY_PATH=${INSTALLDIR}/blitz/lib:${LD_LIBRARY_PATH}
    ENV PATH=${INSTALLDIR}/blitz/bin:${PATH}
    
    
    #
    # *******************
    #   DAL
    # *******************
    #
    #
    # Run-time dependencies
    RUN aptitude install -y libhdf5-${LIBHDF5_VERSION} python3 && \
        aptitude clean && \
        aptitude autoclean
    
    RUN export BUILD_PACKAGES="git cmake g++ swig3.0 python3-setuptools python3-dev libhdf5-dev" && \
        aptitude install -y ${BUILD_PACKAGES} && \
        mkdir -p ${INSTALLDIR}/DAL/build && \
        git clone --depth 1 --shallow-submodules --branch ${DAL_VERSION//latest/master} https://github.com/nextgen-astrodata/DAL.git ${INSTALLDIR}/DAL/DAL.src && \
        cd ${INSTALLDIR}/DAL/build && \
        cmake -DPYTHON_INCLUDE_DIR=/usr/include/python${PYTHON_VERSION} -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}m.so -DBUILD_TESTING=OFF -DCMAKE_CXX_FLAGS="${CXX_FLAGS} -fpermissive" -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/DAL ${INSTALLDIR}/DAL/DAL.src && \
        make -j ${J} && \
        make install && \
        bash -c "rm -rf ${INSTALLDIR}/DAL/{DAL.src,build}" && \
        aptitude purge -y ${BUILD_PACKAGES} && \
        aptitude clean && \
        aptitude autoclean
    
    
    #
    # *******************
    #   LOFAR
    # *******************
    #
    # Run-time dependencies
    RUN aptitude install -y libncurses${NCURSES_VERSION} liblog4cplus-${LIBLOG4CPLUS_VERSION} libhdf5-${LIBHDF5_VERSION} libboost-chrono${BOOST_VERSION}.1 libboost-program-options${BOOST_VERSION}.1 libboost-python${BOOST_VERSION}.1 libboost-regex${BOOST_VERSION}.1 python3 libxml2 libpng-tools liblapack${LIBLAPACK_VERSION} libfftw3-bin libxml++${LIBXMLPP_VERSION}-2v5 libgsl${LIBGSL_VERSION} libreadline${READLINE_VERSION} binutils libcfitsio-bin libwcs5 libopenblas-base libpqxx-${LIBPQXX_VERSION} libqpid-proton8 libqpid-proton-cpp8 python3-qpid-proton python3-pg python3-psycopg2 python3-requests && \
        aptitude clean && \
        aptitude autoclean
    
    # Apply a finger print to force a rebuild if the source code changes. Supply a unique ID here to force a rebuild.
    ARG LOFAR_FINGERPRINT=whatever
    ENV LOFAR_FINGERPRINT=${LOFAR_FINGERPRINT}
    
    # Install
    RUN export BUILD_PACKAGES="git cmake g++ gfortran python3-setuptools bison flex libncurses-dev liblog4cplus-dev libboost${BOOST_VERSION}-all-dev libboost-python${BOOST_VERSION}-dev python3-dev libxml2-dev pkg-config libpng-dev liblapack-dev libfftw3-dev libunittest++-dev libxml++${LIBXMLPP_VERSION}-dev libgsl-dev libreadline-dev binutils-dev libcfitsio-dev wcslib-dev libopenblas-dev libqpid-proton-dev libqpid-proton-cpp-dev libpqxx-dev libhdf5-dev" && \
        aptitude install -y ${BUILD_PACKAGES} && \
        mkdir -p ${INSTALLDIR}/lofar/build/${LOFAR_BUILDVARIANT} && \
        git clone --depth 1 --shallow-submodules --branch ${LOFAR_VERSION//latest/master} https://git.astron.nl/ro/lofar.git ${INSTALLDIR}/lofar/src && \
        cd ${INSTALLDIR}/lofar/build/${LOFAR_BUILDVARIANT} && \
        sed -i "s/ABI=0/ABI=${CXX_ABI}/g" ../../src/CMake/variants/GNUCXX11.cmake && \
        cmake -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DBUILD_PACKAGES=Offline -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/lofar/ -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCASAREST_ROOT_DIR=${INSTALLDIR}/casarest/ -DCASACORE_ROOT_DIR=${INSTALLDIR}/casacore/ -DBLITZ_ROOT_DIR=${INSTALLDIR}/blitz -DAOFLAGGER_ROOT_DIR=${INSTALLDIR}/aoflagger/ -DBDSF_ROOT_DIR=${INSTALLDIR}/pybdsf/lib/python${PYTHON_VERSION}/site-packages/ -DQPID_ROOT_DIR=/opt/qpid/ -DUSE_OPENMP=True ${INSTALLDIR}/lofar/src/ && \
        sed -i '29,31d' include/ApplCommon/PosixTime.h && \
        make -j ${J} && \
        make install && \
        mkdir -p ${INSTALLDIR}/lofar/var/{log,run} && \
        chmod a+rwx  ${INSTALLDIR}/lofar/var/{log,run} && \
        bash -c "strip ${INSTALLDIR}/lofar/{bin,sbin,lib64}/* || true" && \
        rm -rf ${INSTALLDIR}/lofar/{build,src} && \
        aptitude purge -y ${BUILD_PACKAGES} && \
        aptitude clean && \
        aptitude autoclean
    
    # install additional bashrc files
    COPY ["bashrc.d",  "${INSTALLDIR}/bashrc.d/"]
    RUN find /opt/ ! -perm -a+r -exec chmod a+r {} +