From 80c3a3f604b6af0b6a6f173dad0ec28755b3936e Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Wed, 23 Apr 2025 12:20:48 +0200
Subject: [PATCH 1/6] build docker image with portable true, and no specific
 targetcpu

---
 docker/pipeline/Dockerfile | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/docker/pipeline/Dockerfile b/docker/pipeline/Dockerfile
index 8e7d931..7cadc5a 100644
--- a/docker/pipeline/Dockerfile
+++ b/docker/pipeline/Dockerfile
@@ -39,8 +39,8 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
 WORKDIR /src
 
 # By default, build non-portable code, for the oldest CPU that supports AVX2
-ARG PORTABLE=FALSE
-ARG TARGET_CPU=haswell
+ARG PORTABLE=TRUE
+#ARG TARGET_CPU=haswell
 
 # 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
@@ -69,7 +69,6 @@ RUN git -C casacore checkout ${CASACORE_COMMIT}
 RUN cmake \
     -DCMAKE_BUILD_TYPE:STRING=Release \
     -DPORTABLE=${PORTABLE} \
-    -DTARGET_CPU=${TARGET_CPU} \
     -H/src/casacore \
     -B/src/casacore/build \
     -G Ninja
@@ -82,7 +81,6 @@ RUN git -C LofarStMan checkout ${LOFARSTMAN_COMMIT}
 RUN cmake \
     -DCMAKE_BUILD_TYPE:STRING=Release \
     -DPORTABLE=${PORTABLE} \
-    -DTARGET_CPU=${TARGET_CPU} \
     -H/src/LofarStMan \
     -B/src/LofarStMan/build \
     -G Ninja
@@ -99,7 +97,6 @@ RUN cmake \
     -DBUILD_WITH_PYTHON=OFF \
     -DBUILD_TESTING=OFF \
     -DPORTABLE=${PORTABLE} \
-    -DTARGET_CPU=${TARGET_CPU} \
     -H/src/EveryBeam \
     -B/src/EveryBeam/build \
     -G Ninja
@@ -112,7 +109,6 @@ RUN git -C aoflagger checkout ${AOFLAGGER_COMMIT}
 RUN cmake \
     -DCMAKE_BUILD_TYPE:STRING=Release \
     -DPORTABLE=${PORTABLE} \
-    -DTARGET_CPU=${TARGET_CPU} \
     -H/src/aoflagger \
     -B/src/aoflagger/build \
     -G Ninja
@@ -139,7 +135,6 @@ RUN cmake \
     -DCMAKE_BUILD_TYPE:STRING=Release \
     -DBUILD_TESTING=OFF \
     -DPORTABLE=${PORTABLE} \
-    -DTARGET_CPU=${TARGET_CPU} \
     -DLIBDIRAC_PREFIX=/usr/local/ \
     -DMETADATA_COMPRESSION_DEFAULT=True \
     -H/src/DP3 \
-- 
GitLab


From 942577f785384eb14149a573582f526770736b50 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Wed, 23 Apr 2025 13:29:37 +0200
Subject: [PATCH 2/6] build docker image with commit-hash tag

---
 .gitlab-ci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2441fc7..4a48935 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -49,5 +49,5 @@ docker_build:
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_REF_PROTECTED == "true"'
   script:
     - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-    - docker build -f docker/pipeline/Dockerfile . --tag $CI_REGISTRY_IMAGE/preprocess:latest
-    - docker push $CI_REGISTRY_IMAGE/preprocess:latest
+    - docker build -f docker/pipeline/Dockerfile . --tag $CI_REGISTRY_IMAGE/preprocess:$CI_COMMIT_SHORT_SHA
+    - docker push $CI_REGISTRY_IMAGE/preprocess:$CI_COMMIT_SHORT_SHA
-- 
GitLab


From 426af39dae7ec4648eb0c219dd73be1befd90714 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Wed, 23 Apr 2025 13:39:26 +0200
Subject: [PATCH 3/6] build docker image on branches

---
 .gitlab-ci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4a48935..3c96261 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -45,8 +45,8 @@ docker_build:
   image: docker:latest
   tags:
     - dind
-  rules:
-    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_REF_PROTECTED == "true"'
+#  rules:
+#    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_REF_PROTECTED == "true"'
   script:
     - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
     - docker build -f docker/pipeline/Dockerfile . --tag $CI_REGISTRY_IMAGE/preprocess:$CI_COMMIT_SHORT_SHA
-- 
GitLab


From 8ee5e14245ada2db8ea48b2f231db3d4674f5ffa Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Wed, 23 Apr 2025 14:07:29 +0200
Subject: [PATCH 4/6] added pybind11 depenency, as aoflagger seems to require
 it

---
 requirements.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/requirements.txt b/requirements.txt
index ad89d2f..de6af90 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,3 +3,4 @@ toil[cwl]
 lsmtool
 pandas
 python-casacore
+pybind11
\ No newline at end of file
-- 
GitLab


From c76804d4a3a123f156dc3e750ba5df7f5718ffcd Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Wed, 23 Apr 2025 16:10:48 +0200
Subject: [PATCH 5/6] added pybind11 depenency, as aoflagger seems to require
 it

---
 docker/pipeline/Dockerfile | 3 ++-
 requirements.txt           | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docker/pipeline/Dockerfile b/docker/pipeline/Dockerfile
index 7cadc5a..692edb4 100644
--- a/docker/pipeline/Dockerfile
+++ b/docker/pipeline/Dockerfile
@@ -51,7 +51,8 @@ RUN wget -q https://bootstrap.pypa.io/get-pip.py && \
 
 # Install required python packages
 RUN python3 -m pip install \
-    'numpy<2'
+    'numpy<2' \
+    pybind11
 
 # Install the casacore measures data. We purposely do not install these from
 # the Ubuntu repository, but download the latest version directly from the
diff --git a/requirements.txt b/requirements.txt
index de6af90..ad89d2f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,4 +3,3 @@ toil[cwl]
 lsmtool
 pandas
 python-casacore
-pybind11
\ No newline at end of file
-- 
GitLab


From c690e4c9ecd23fc2bb7c023269833e88766b093b Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Tue, 6 May 2025 16:24:12 +0200
Subject: [PATCH 6/6] removed pip pybind11 depenency

---
 docker/pipeline/Dockerfile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/docker/pipeline/Dockerfile b/docker/pipeline/Dockerfile
index 75f983b..827655e 100644
--- a/docker/pipeline/Dockerfile
+++ b/docker/pipeline/Dockerfile
@@ -52,8 +52,7 @@ RUN wget -q https://bootstrap.pypa.io/get-pip.py && \
 
 # Install required python packages
 RUN python3 -m pip install \
-    'numpy<2' \
-    pybind11
+    'numpy<2'
 
 # Install the casacore measures data. We purposely do not install these from
 # the Ubuntu repository, but download the latest version directly from the
-- 
GitLab