diff --git a/Docker/Dockerfile-base b/Docker/Dockerfile-base index b24a5a54d60f107543b5c3f645eebe02f24ba0ae..61cb68a95bcaa9740334990eb16eed5251d4098c 100644 --- a/Docker/Dockerfile-base +++ b/Docker/Dockerfile-base @@ -9,8 +9,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get install -y \ bison \ build-essential \ - casacore-data \ - casacore-dev \ cmake \ flex \ gfortran \ @@ -39,14 +37,34 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ python3-numpy \ python3-pip \ wcslib-dev \ - wget && \ - mkdir -p /src + wget WORKDIR /src +# Do not use `pip` from the Debian repository, but fetch it from PyPA. +# This way, we are sure that the latest versions of `pip`, `setuptools`, and +# `wheel` are installed in /usr/local, the only directory we're going to copy +# over to the next build stage. +RUN wget -q https://bootstrap.pypa.io/get-pip.py && \ + python3 get-pip.py + +# Install required python packages +RUN python3 -m pip install --no-cache-dir --upgrade \ + nodejs-wheel \ + toil[cwl] + # Build portable binaries by default ARG TARGET_CPU=haswell +ARG CASACORE_COMMIT=master +RUN git clone --no-checkout \ + https://github.com/casacore/casacore.git && \ + mkdir casacore/build && \ + cd casacore && git checkout ${CASACORE_COMMIT} && \ + cd build && \ + cmake .. -DTARGET_CPU=${TARGET_CPU} && \ + make install -j`nproc` + ARG LOFARSTMAN_COMMIT=main RUN git clone --no-checkout \ https://github.com/lofar-astron/LofarStMan && \ @@ -132,17 +150,11 @@ RUN git clone --no-checkout \ cmake .. -DTARGET_CPU=${TARGET_CPU} && \ make install -j`nproc` -# Do not use `pip` from the Debian repository, but fetch it from PyPA. -# This way, we are sure that the latest versions of `pip`, `setuptools`, and -# `wheel` are installed in /usr/local, the only directory we're going to copy -# over to the next build stage. -RUN wget -q https://bootstrap.pypa.io/get-pip.py && \ - python3 get-pip.py - -# Install required python packages -RUN python3 -m pip install --no-cache-dir --upgrade \ - nodejs-wheel \ - toil[cwl] +ARG PYTHONCASACORE_COMMIT=master +RUN git clone --no-checkout \ + https://github.com/casacore/python-casacore.git && \ + cd python-casacore && git checkout ${PYTHONCASACORE_COMMIT} && \ + python3 -m pip install --verbose . # Install current version of LINC. By adding this to the base image # we can speed up the build of the final image, because all of LINC's @@ -153,7 +165,7 @@ COPY . linc # Note: LINC_VERSION should be provided as build argument ARG LINC_VERSION=0.0.0 RUN SETUPTOOLS_SCM_PRETEND_VERSION_FOR_LINC=${LINC_VERSION} \ - python3 -m pip install --no-cache-dir --upgrade ./linc + python3 -m pip install --upgrade ./linc #--------------------------------------------------------------------------- @@ -168,18 +180,22 @@ RUN chmod +rx /usr/local/bin/* SHELL ["/bin/bash", "-c"] # Set default versions. Can be overridden from the command-line +ARG CASACORE_COMMIT=master ARG LOFARSTMAN_COMMIT=main ARG DYSCO_COMMIT=master -ARG SAGECAL_COMMIT=master ARG IDG_COMMIT=master ARG AOFLAGGER_COMMIT=master ARG LOFARBEAM_COMMIT=master ARG EVERYBEAM_COMMIT=master +ARG SAGECAL_COMMIT=master ARG DP3_COMMIT=master ARG WSCLEAN_COMMIT=master +ARG PYTHONCASACORE_COMMIT=master # Add version information to the metadata of the image LABEL \ + nl.astron.nl.linc.casacore.version=${CASACORE_COMMIT} \ + nl.astron.nl.linc.python-casacore.version=${PYTHONCASACORE_COMMIT} \ nl.astron.linc.lofarstman.version=${LOFARSTMAN_COMMIT} \ nl.astron.linc.dysco.version=${DYSCO_COMMIT} \ nl.astron.linc.sagecal.version=${SAGECAL_COMMIT} \ @@ -194,7 +210,6 @@ LABEL \ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ apt-get install -y \ - casacore-tools \ gdb \ git \ libatkmm-1.6-1v5 \ @@ -203,13 +218,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libboost-program-options1.74.0 \ libboost-python1.74.0 \ libcairomm-1.0-1v5 \ - libcasa-casa6 \ - libcasa-fits6 \ - libcasa-measures6 \ - libcasa-ms6 \ - libcasa-python3-6 \ - libcasa-scimath6 \ - libcasa-tables6 \ libcfitsio9 \ libfftw3-double3 \ libfftw3-single3 \ @@ -229,7 +237,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsigc++-2.0-0v5 \ libstdc++6 \ python3 \ - python3-casacore \ python3-distutils \ rsync \ wget && \ @@ -238,11 +245,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ # 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. -RUN 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 +RUN mkdir -p /usr/local/share/casacore/data && \ + wget -qO - ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar | \ + tar -C /usr/local/share/casacore/data -xzf - # Try to run the compiled tools to make sure they run without # a problem (e.g. no missing libraries). diff --git a/Docker/fetch_latest_commits.sh b/Docker/fetch_latest_commits.sh index 101fc136281229f0c7f3dc69df069baa5e088365..b0af8ede3d632c9ab2f742459fd54991514900b8 100755 --- a/Docker/fetch_latest_commits.sh +++ b/Docker/fetch_latest_commits.sh @@ -1,11 +1,13 @@ #!/bin/sh -git ls-remote https://github.com/lofar-astron/LofarStMan HEAD | awk '{ print "LOFARSTMAN_COMMIT="$1 }' -git ls-remote https://github.com/aroffringa/dysco.git HEAD | awk '{ print "DYSCO_COMMIT="$1 }' -git ls-remote https://git.astron.nl/RD/idg.git HEAD | awk '{ print "IDG_COMMIT="$1 }' -git ls-remote https://gitlab.com/aroffringa/aoflagger.git HEAD | awk '{ print "AOFLAGGER_COMMIT="$1 }' -git ls-remote https://github.com/nlesc-dirac/sagecal HEAD | awk '{ print "SAGECAL_COMMIT="$1 }' -git ls-remote https://github.com/lofar-astron/LOFARBeam.git HEAD | awk '{ print "LOFARBEAM_COMMIT="$1 }' -git ls-remote https://git.astron.nl/RD/EveryBeam.git HEAD | awk '{ print "EVERYBEAM_COMMIT="$1 }' -git ls-remote https://git.astron.nl/RD/DP3.git HEAD | awk '{ print "DP3_COMMIT="$1 }' -git ls-remote https://gitlab.com/aroffringa/wsclean.git HEAD | awk '{ print "WSCLEAN_COMMIT="$1 }' +git ls-remote https://github.com/casacore/casacore.git v3.6.1 | awk '{ print "CASACORE_COMMIT="$1 }' +git ls-remote https://github.com/lofar-astron/LofarStMan HEAD | awk '{ print "LOFARSTMAN_COMMIT="$1 }' +git ls-remote https://github.com/aroffringa/dysco.git HEAD | awk '{ print "DYSCO_COMMIT="$1 }' +git ls-remote https://git.astron.nl/RD/idg.git HEAD | awk '{ print "IDG_COMMIT="$1 }' +git ls-remote https://gitlab.com/aroffringa/aoflagger.git HEAD | awk '{ print "AOFLAGGER_COMMIT="$1 }' +git ls-remote https://github.com/lofar-astron/LOFARBeam.git HEAD | awk '{ print "LOFARBEAM_COMMIT="$1 }' +git ls-remote https://git.astron.nl/RD/EveryBeam.git HEAD | awk '{ print "EVERYBEAM_COMMIT="$1 }' +git ls-remote https://github.com/nlesc-dirac/sagecal HEAD | awk '{ print "SAGECAL_COMMIT="$1 }' +git ls-remote https://git.astron.nl/RD/DP3.git HEAD | awk '{ print "DP3_COMMIT="$1 }' +git ls-remote https://gitlab.com/aroffringa/wsclean.git HEAD | awk '{ print "WSCLEAN_COMMIT="$1 }' +git ls-remote https://github.com/casacore/python-casacore.git v3.6.1 | awk '{ print "PYTHONCASACORE_COMMIT="$1 }'