From 103578cebe80bd8efe929ff2e1569c2c03c3e91d Mon Sep 17 00:00:00 2001 From: Mick Veldhuis <veldhuis@astron.nl> Date: Thu, 27 Feb 2025 17:14:58 +0100 Subject: [PATCH 1/3] Add commit hash arguments --- docker/pipeline/Dockerfile | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/docker/pipeline/Dockerfile b/docker/pipeline/Dockerfile index 24c7435..537c6bf 100644 --- a/docker/pipeline/Dockerfile +++ b/docker/pipeline/Dockerfile @@ -64,7 +64,9 @@ wget -qO - https://www.astron.nl/iers/WSRT_Measures.ztar | \ tar -C /usr/local/share/casacore/data -xzf - # Install casacore -RUN git shallow-clone https://github.com/casacore/casacore.git +ARG CASACORE_COMMIT=master +RUN git clone --no-checkout https://github.com/casacore/casacore.git +RUN git -C casacore checkout ${CASACORE_COMMIT} RUN cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPORTABLE=${PORTABLE} \ @@ -75,7 +77,9 @@ RUN cmake \ RUN ninja -C /src/casacore/build install # Install LofarStMan -RUN git shallow-clone https://github.com/lofar-astron/LofarStMan +ARG LOFARSTMAN_COMMIT=main +RUN git clone --no-checkout https://github.com/lofar-astron/LofarStMan.git +RUN git -C LofarStMan checkout ${LOFARSTMAN_COMMIT} RUN cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPORTABLE=${PORTABLE} \ @@ -88,7 +92,9 @@ RUN ninja -C /src/LofarStMan/build install # Install EveryBeam # Do not compile python bindings, they will interfere with the ones in the # binary wheel on PyPI. -RUN git shallow-clone https://git.astron.nl/RD/EveryBeam.git +ARG EVERYBEAM_COMMIT=master +RUN git clone --no-checkout https://git.astron.nl/RD/EveryBeam.git +RUN git -C EveryBeam checkout ${EVERYBEAM_COMMIT} RUN cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DBUILD_WITH_PYTHON=OFF \ @@ -101,7 +107,9 @@ RUN cmake \ RUN ninja -C /src/EveryBeam/build install # Install AOFlagger -RUN git shallow-clone https://gitlab.com/aroffringa/aoflagger.git +ARG AOFLAGGER_COMMIT=master +RUN git clone --no-checkout https://gitlab.com/aroffringa/aoflagger.git +RUN git -C aoflagger checkout ${AOFLAGGER_COMMIT} RUN cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPORTABLE=${PORTABLE} \ @@ -112,7 +120,9 @@ RUN cmake \ RUN ninja -C /src/aoflagger/build install # Install SAGECal libdirac -RUN git shallow-clone https://github.com/nlesc-dirac/sagecal.git +ARG SAGECAL_COMMIT=master +RUN git clone --no-checkout https://github.com/nlesc-dirac/sagecal.git +RUN git -C sagecal checkout ${SAGECAL_COMMIT} RUN cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DLIB_ONLY=1 \ @@ -123,7 +133,9 @@ RUN cmake \ RUN ninja -C /src/sagecal/build install # Install DP3 -RUN git shallow-clone https://git.astron.nl/RD/DP3.git +ARG DP3_COMMIT=master +RUN git clone --no-checkout https://git.astron.nl/RD/DP3.git +RUN git -C DP3 checkout ${DP3_COMMIT} RUN cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DBUILD_TESTING=OFF \ @@ -136,6 +148,7 @@ RUN cmake \ RUN ninja -C /src/DP3/build install # Install python-casacore +ARG PYTHON_CASACORE_COMMIT=master RUN git clone https://github.com/casacore/python-casacore.git RUN CASACORE_DATA=/usr/local/share/casacore/data \ python3 -m pip install -v /src/python-casacore -- GitLab From 5ff68599478e6ae0f5708f1deb455273e7fbc84f Mon Sep 17 00:00:00 2001 From: Mick Veldhuis <veldhuis@astron.nl> Date: Thu, 27 Feb 2025 17:21:00 +0100 Subject: [PATCH 2/3] Fix missing python-casacore checkout --- docker/pipeline/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/pipeline/Dockerfile b/docker/pipeline/Dockerfile index 537c6bf..702a056 100644 --- a/docker/pipeline/Dockerfile +++ b/docker/pipeline/Dockerfile @@ -37,7 +37,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ # Prepare the environment for installing the Rapthor source dependencies. WORKDIR /src -RUN git config --global alias.shallow-clone "!git clone --depth 1 --recurse-submodules --shallow-submodules" # By default, build non-portable code, for the oldest CPU that supports AVX2 ARG PORTABLE=FALSE @@ -149,7 +148,8 @@ RUN ninja -C /src/DP3/build install # Install python-casacore ARG PYTHON_CASACORE_COMMIT=master -RUN git clone https://github.com/casacore/python-casacore.git +RUN git clone --no-checkout https://github.com/casacore/python-casacore.git +RUN git -C python-casacore ${PYTHON_CASACORE_COMMIT} RUN CASACORE_DATA=/usr/local/share/casacore/data \ python3 -m pip install -v /src/python-casacore -- GitLab From 1801ce0b0fb3fde0b65987ded555a4356fc19f32 Mon Sep 17 00:00:00 2001 From: Mick Veldhuis <veldhuis@astron.nl> Date: Thu, 27 Feb 2025 22:29:02 +0100 Subject: [PATCH 3/3] Add versions to docker image metadata --- docker/pipeline/Dockerfile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docker/pipeline/Dockerfile b/docker/pipeline/Dockerfile index 702a056..8d7cdb5 100644 --- a/docker/pipeline/Dockerfile +++ b/docker/pipeline/Dockerfile @@ -149,7 +149,7 @@ RUN ninja -C /src/DP3/build install # Install python-casacore ARG PYTHON_CASACORE_COMMIT=master RUN git clone --no-checkout https://github.com/casacore/python-casacore.git -RUN git -C python-casacore ${PYTHON_CASACORE_COMMIT} +RUN git -C python-casacore checkout ${PYTHON_CASACORE_COMMIT} RUN CASACORE_DATA=/usr/local/share/casacore/data \ python3 -m pip install -v /src/python-casacore @@ -171,6 +171,26 @@ FROM ubuntu:22.04 AS runner COPY --from=builder /usr/local /usr/local +# Repeat version arguments for the runner +ARG \ + LOFARSTMAN_COMMIT=main \ + CASACORE_COMMIT=master \ + EVERYBEAM_COMMIT=master \ + AOFLAGGER_COMMIT=master \ + SAGECAL_COMMIT=master \ + DP3_COMMIT=master \ + PYTHON_CASACORE_COMMIT=master + +# Add version information to the metadata of the image +LABEL \ + nl.astron.preprocess.lofarstman.version=${LOFARSTMAN_COMMIT} \ + nl.astron.preprocess.casacore.version=${CASACORE_COMMIT} \ + nl.astron.preprocess.everybeam.version=${EVERYBEAM_COMMIT} \ + nl.astron.preprocess.aoflagger.version=${AOFLAGGER_COMMIT} \ + nl.astron.preprocess.sagecal.version=${SAGECAL_COMMIT} \ + nl.astron.preprocess.dp3.version=${DP3_COMMIT} \ + nl.astron.preprocess.python-casacore.version=${PYTHON_CASACORE_COMMIT} + # Only install run-time required packages RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ -- GitLab