Skip to content
Snippets Groups Projects
Select Git revision
  • b8256a43391f3f203ab8431aaba5a2d5ce817453
  • master default protected
  • RAP-1185_do-not-compile-tests
  • RAP-1176_switch-git-image
  • mammoth_august
  • mammoth_september
  • flag_on_polarisation
  • 3c48_logSI
  • optimize_workflow
  • ingest_info
  • poppy_integration_v50
  • releases/v5.1 protected
  • releases/v5.1rc1 protected
  • reverse_versions
  • poppy_integration
  • releases/v5.0 protected
  • use-versioned-releases
  • releases/v5.0rc2 protected
  • releases/v5.0rc1 protected
  • releases/ldv_v407_atdb protected
  • ldv_v407_debug
  • v5.1
  • v5.0
  • v5.0rc2
  • v5.0rc1
  • ldv_v406_debug
  • ldv_v405_debug
  • ldv_v404
  • ldv_v403
  • ldv_v402
  • v4.0
  • ldv_v401
  • ldv_v40
  • ldv_v031
  • ldv_v03
  • ldv_v01
36 results

Dockerfile

Blame
  • user avatar
    André Offringa authored
    Former-commit-id: c72556e3 [formerly 7e4163ee]
    Former-commit-id: f449a137
    Former-commit-id: 1c40a6dd
    b8256a43
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Dockerfile 6.24 KiB
    FROM ubuntu:20.04 as builder
    
    ARG portable=True
    
    RUN export DEBIAN_FRONTEND=noninteractive && \ 
        apt-get update && \
        apt-get install -y \
            bison \
            build-essential \
            casacore-data \
            casacore-dev \
            cmake \
            flex \
            gfortran \ 
            git \
    	libblas-dev \
            libcfitsio-dev \
            libfftw3-dev \
            libgsl-dev \
    	liblapack-dev \
            liblua5.3-dev \
            libhdf5-serial-dev \
            libboost-filesystem-dev \
            libboost-system-dev \
            libboost-date-time-dev \
            libboost-program-options-dev \
            libboost-test-dev \
            libgtkmm-3.0-dev \
            libncurses5-dev \
            libpng-dev \
            libpython3-dev \
            pkg-config \
            python3-numpy \
            wcslib-dev \        
            wget && \
        mkdir -p /src/
    
    WORKDIR /src/
    
    RUN \
      git clone https://github.com/lofar-astron/LofarStMan --depth 1 && \
      mkdir LofarStMan/build && \
      cd LofarStMan/build && \
      cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=${portable} && \
      make install -j`nproc`
    
    RUN \
      git clone https://github.com/aroffringa/dysco.git --depth 1 && \
      mkdir dysco/build && \
      cd dysco/build && \
      cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=${portable} && \
      make install -j`nproc`
        
    # IDG doesn't work with --depth 1, because it needs all branches to
    # determine its version :-(
    RUN \
      git clone https://git.astron.nl/RD/idg.git && \
      mkdir idg/build && \
      cd idg/build && \
      cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/ && \
      make install -j`nproc`
    
    RUN \
      git clone https://gitlab.com/aroffringa/aoflagger.git --depth 1 && \
      mkdir aoflagger/build && \
      cd aoflagger/build && \
      cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=${portable} && \
      make install -j`nproc`
    
    RUN \
      apt-get install -y libboost-python-dev libboost-numpy-dev && \
      git clone https://github.com/lofar-astron/LOFARBeam.git --depth 1 && \
      mkdir LOFARBeam/build && \
      cd LOFARBeam/build && \
      cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/ && \
      make install -j`nproc`
    
    RUN \
      git clone https://git.astron.nl/RD/EveryBeam.git --depth 1 && \
      mkdir EveryBeam/build && \
      cd EveryBeam/build && \
      cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/ && \
      make install -j`nproc`
    
    RUN \
      git clone https://git.astron.nl/RD/DP3.git --depth 1 && \
      mkdir DP3/build && \
      cd DP3/build && \
      cmake ../ \
        -DCMAKE_INSTALL_PREFIX=/usr/local/ \
        -DPORTABLE=${portable} \
        -DAOFlagger_DIR=/usr/local/ && \
      make install -j`nproc`
    
    RUN \
      git clone https://gitlab.com/aroffringa/wsclean.git --depth 1 && \
      mkdir wsclean/build && \
      cd wsclean/build && \
      cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DPORTABLE=${portable} && \
      make install -j`nproc`
    
    #---------------------------------------------------------------------------
    # The image is now rebuild without adding the source, to get a smaller image
    # Further binary and/or Python dependencies are also added here.
    #---------------------------------------------------------------------------
    FROM ubuntu:20.04 as runner
    
    COPY --from=builder /usr/local/ /usr/local
    RUN chmod +rx /usr/local/bin/*
    
    SHELL ["/bin/bash", "-c"]
    
    RUN export DEBIAN_FRONTEND=noninteractive && \
        apt-get update && \
        apt-get install -y \
            bison \
        	git \
            casacore-data \
    	casacore-tools \
            flex \
    	gfortran \
            libboost-date-time1.71 \
            libboost-filesystem1.71 \
            libboost-numpy1.71 \
            libboost-program-options1.71 \
            libboost-python1.71 \
            libboost-system1.71 \
            libboost-test1.71 \
            libcasa-casa4 \
    	libcasa-fits4 \
    	libcasa-measures4 \
    	libcasa-ms4 \
    	libcasa-tables4 \
            libcfitsio8 \
            libfftw3-3 \
    	libgsl23 \
            liblua5.3-0 \
            libncurses5 \ 
            libgtkmm-3.0 \
            libhdf5-cpp-103 \
            libpng16-16 \
    	nodejs \
            pybind11-dev   \
            python3 \
            python3-casacore \
    	python3-h5py \
    	python3-matplotlib \
            python3-numpy \
    	python3-pip \
            python3-scipy \
    	python3-sphinx \
    	tar \
    	wget \
            wcslib-dev && \
        rm -rf /var/lib/apt/lists/*
    
    ARG TOIL_VERSION=3.20.0
    ARG CASACORE_TAG=master   
    ARG LSMTool_TAG=master
    ARG LoSoTo_TAG=master
    ARG STMAN_TAG=master
    ARG Dysco_TAG=master
    ARG LofarBeam_TAG=master
    ARG DP3_TAG=master
    ARG IDG_TAG=master
    ARG Everybeam_TAG
    ARG AOFlagger_TAG
    ARG RMextract_TAG=master
    ARG WSClean_TAG
    
    LABEL \
      casacore.version.tag=${CASACORE_TAG} \
      toil.version=${TOIL_VERSION} \
      LSMTool.version.tag=${LSMTool_TAG} \
      LoSoTo.version.tag=${LoSoTo_TAG} \
      STMAN.version.tag=${STMAN_TAG} \
      Dysco.version.tag=${Dysco_TAG} \
      LOFARBeam.version.tag=${LofarBeam_TAG} \
      DP3.version.tag=${DP3_TAG} \
      IDG.version.tag=${IDG_TAG} \
      Everybeam.version.tag=${Everybeam_TAG} \
      AOFlagger.version.tag=${AOFlagger_TAG} \
      RMextract.version.tag=${RMextract_TAG} \
      WSClean.version.tag=${WSClean_TAG}
    
    ENV PREFACTOR_VERSION='master' \
        PREFACTOR_NAME=prefactor \
        LC_ALL=C.UTF-8 \
        PREFACTOR_DATA_ROOT=/usr/local/share/prefactor \
        PYTHONPATH="/usr/local/bin:/usr/local/lib/python3.8/site-packages"
    
    RUN \
    # Install WSRT Measures (extra casacore data)
    # Note: The file on the ftp site is updated daily. When warnings regarding leap
    # seconds appear, ignore them or regenerate the docker image.
      wget -q -O /WSRT_Measures.ztar ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar \
        && cd /var/lib/casacore/data \
        && tar xfz /WSRT_Measures.ztar \
        && rm /WSRT_Measures.ztar && \
      \
    # Install cwtool & cwl-runner
      python3 -m pip install --upgrade pip && \
      python3 -m pip install cwltool cwl-runner && \
      \
    # Install Prefactor
      git clone https://git.astron.nl/eosc/prefactor3-cwl.git ${PREFACTOR_NAME} --branch ${PREFACTOR_VERSION} --depth 1 && \
      cd ${PREFACTOR_NAME} && \
      pip3 install --upgrade $PWD && \
      cd .. && \
      rm -rfv ${PREFACTOR_NAME} && \
      \
    # A user 'lofaruser' is added (this might be legacy -- not sure this is
    # still relevant).
      mkdir /home/lofaruser/ && \ 
      groupadd -r lofaruser && \
      useradd --no-log-init -r -g lofaruser lofaruser && \
      chown lofaruser:lofaruser /home/lofaruser && \
      \
    # Try to run the compiled tools to make sure they run without
    # a problem (e.g. no missing libraries).
      aoflagger --version && \
      DP3 --version && \
      wsclean --version
    
    WORKDIR /home/lofaruser
    
    USER lofaruser