From 640d2b08eeae2a549bbef56c1030983b54d3d7e0 Mon Sep 17 00:00:00 2001
From: Remi Cresson <remi.cresson@inrae.fr>
Date: Mon, 21 Aug 2023 20:56:51 +0200
Subject: [PATCH 01/11] CI: add autoinstall testing

---
 .gitlab-ci.yml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 27cb2d6..e4ce695 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -113,6 +113,25 @@ pipeline_permutations:
     - curl -fsLI $SPOT_IMG_URL
     - python3 -m pytest -vv --junitxml=test-pipeline-permutations.xml tests/test_pipeline.py
 
+.autoinstall:
+  stage: Test Autoinstall
+  allow_failure: false
+  image: docker:latest
+  variables:
+    DOCKERFILE: tests/autoinstall_dockerfile
+  services:
+    - name: docker:dind
+
+test_ubuntu_2204:
+  extends: .autoinstall
+  script:
+   - docker build --build-arg IMG=ubuntu:22.04 --build-arg BRANCH=$CI_COMMIT_BRANCH -f $DOCKERFILE
+
+test_ubuntu_2004:
+  extends: .autoinstall
+  script:
+   - docker build --build-arg IMG=ubuntu:20.04 --build-arg BRANCH=$CI_COMMIT_BRANCH -f $DOCKERFILE
+
 # -------------------------------------- Docs ---------------------------------------
 
 docs:
-- 
GitLab


From 4b9671559f5f20286cba50a33e8e81c619181299 Mon Sep 17 00:00:00 2001
From: Remi Cresson <remi.cresson@inrae.fr>
Date: Mon, 21 Aug 2023 20:57:19 +0200
Subject: [PATCH 02/11] ADD: dockerfile for autoinstall testing

---
 tests/autoinstall_dockerfile | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 tests/autoinstall_dockerfile

diff --git a/tests/autoinstall_dockerfile b/tests/autoinstall_dockerfile
new file mode 100644
index 0000000..33c0fb9
--- /dev/null
+++ b/tests/autoinstall_dockerfile
@@ -0,0 +1,11 @@
+ARG IMG
+ARG BRANCH
+FROM $IMG
+RUN apt update && apt install -y wget unzip
+RUN useradd -s /bin/bash -m otbuser
+WORKDIR /home/otbuser
+USER otbuser
+RUN wget https://gitlab.orfeo-toolbox.org/nicolasnn/pyotb/-/archive/$BRANCH/pyotb-$BRANCH.zip \
+ && unzip pyotb-$BRANCH.zip
+RUN PYTHONPATH=/home/otbuser/pyotb-$BRANCH/pyotb python3 -c "import install; assert install.install_otb()"
+RUN PYTHONPATH=/home/otbuser/pyotb-$BRANCH python3 -c "import pyotb"
-- 
GitLab


From 94c5ffa6d0e99f2cdfc0b3b8125bdaba02fa7681 Mon Sep 17 00:00:00 2001
From: Remi Cresson <remi.cresson@inrae.fr>
Date: Mon, 21 Aug 2023 20:59:32 +0200
Subject: [PATCH 03/11] CI: add autoinstall testing

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e4ce695..d8f98ab 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -114,7 +114,7 @@ pipeline_permutations:
     - python3 -m pytest -vv --junitxml=test-pipeline-permutations.xml tests/test_pipeline.py
 
 .autoinstall:
-  stage: Test Autoinstall
+  stage: Tests
   allow_failure: false
   image: docker:latest
   variables:
-- 
GitLab


From b27cb8e6c5dccd8afc3e3b125cfa7ee318e70b2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Cresson?= <remi.cresson@inrae.fr>
Date: Wed, 30 Aug 2023 07:32:11 +0000
Subject: [PATCH 04/11] CI: use godzilla runner for autoinstall tests

---
 .gitlab-ci.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d8f98ab..e358e0a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -117,6 +117,7 @@ pipeline_permutations:
   stage: Tests
   allow_failure: false
   image: docker:latest
+  tags: [godzilla]
   variables:
     DOCKERFILE: tests/autoinstall_dockerfile
   services:
-- 
GitLab


From 00904ed4bf9e5529baf3fe8eb386ed66157c57c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Cresson?= <remi.cresson@inrae.fr>
Date: Wed, 30 Aug 2023 07:39:03 +0000
Subject: [PATCH 05/11] CI: wip on autoinstall test

---
 .gitlab-ci.yml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e358e0a..3f9362d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -119,19 +119,21 @@ pipeline_permutations:
   image: docker:latest
   tags: [godzilla]
   variables:
-    DOCKERFILE: tests/autoinstall_dockerfile
+    DOCKERFILE: autoinstall_dockerfile
   services:
     - name: docker:dind
+  before_script:
+    - cd tests
 
 test_ubuntu_2204:
   extends: .autoinstall
   script:
-   - docker build --build-arg IMG=ubuntu:22.04 --build-arg BRANCH=$CI_COMMIT_BRANCH -f $DOCKERFILE
+   - docker build --build-arg IMG=ubuntu:22.04 --build-arg BRANCH=$CI_COMMIT_BRANCH -f $DOCKERFILE .
 
 test_ubuntu_2004:
   extends: .autoinstall
   script:
-   - docker build --build-arg IMG=ubuntu:20.04 --build-arg BRANCH=$CI_COMMIT_BRANCH -f $DOCKERFILE
+   - docker build --build-arg IMG=ubuntu:20.04 --build-arg BRANCH=$CI_COMMIT_BRANCH -f $DOCKERFILE .
 
 # -------------------------------------- Docs ---------------------------------------
 
-- 
GitLab


From c201cb7df15e31203aff25080d1444219bcbc784 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Cresson?= <remi.cresson@inrae.fr>
Date: Wed, 30 Aug 2023 07:41:16 +0000
Subject: [PATCH 06/11] CI: wip on autoinstall tests

---
 tests/autoinstall_dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/autoinstall_dockerfile b/tests/autoinstall_dockerfile
index 33c0fb9..8c3b25f 100644
--- a/tests/autoinstall_dockerfile
+++ b/tests/autoinstall_dockerfile
@@ -1,10 +1,10 @@
 ARG IMG
-ARG BRANCH
 FROM $IMG
 RUN apt update && apt install -y wget unzip
 RUN useradd -s /bin/bash -m otbuser
 WORKDIR /home/otbuser
 USER otbuser
+ARG BRANCH
 RUN wget https://gitlab.orfeo-toolbox.org/nicolasnn/pyotb/-/archive/$BRANCH/pyotb-$BRANCH.zip \
  && unzip pyotb-$BRANCH.zip
 RUN PYTHONPATH=/home/otbuser/pyotb-$BRANCH/pyotb python3 -c "import install; assert install.install_otb()"
-- 
GitLab


From c323f300230931603779b579a4afc112b1b48484 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Cresson?= <remi.cresson@inrae.fr>
Date: Wed, 30 Aug 2023 07:45:58 +0000
Subject: [PATCH 07/11] CI: wip

---
 .gitlab-ci.yml               | 8 +++-----
 tests/autoinstall_dockerfile | 8 +++-----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3f9362d..a2edc20 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -118,22 +118,20 @@ pipeline_permutations:
   allow_failure: false
   image: docker:latest
   tags: [godzilla]
-  variables:
-    DOCKERFILE: autoinstall_dockerfile
   services:
     - name: docker:dind
   before_script:
-    - cd tests
+    - cp tests/autoinstall_dockerfile Dockerfile
 
 test_ubuntu_2204:
   extends: .autoinstall
   script:
-   - docker build --build-arg IMG=ubuntu:22.04 --build-arg BRANCH=$CI_COMMIT_BRANCH -f $DOCKERFILE .
+   - docker build --build-arg IMG=ubuntu:22.04 .
 
 test_ubuntu_2004:
   extends: .autoinstall
   script:
-   - docker build --build-arg IMG=ubuntu:20.04 --build-arg BRANCH=$CI_COMMIT_BRANCH -f $DOCKERFILE .
+   - docker build --build-arg IMG=ubuntu:20.04 .
 
 # -------------------------------------- Docs ---------------------------------------
 
diff --git a/tests/autoinstall_dockerfile b/tests/autoinstall_dockerfile
index 8c3b25f..d312787 100644
--- a/tests/autoinstall_dockerfile
+++ b/tests/autoinstall_dockerfile
@@ -4,8 +4,6 @@ RUN apt update && apt install -y wget unzip
 RUN useradd -s /bin/bash -m otbuser
 WORKDIR /home/otbuser
 USER otbuser
-ARG BRANCH
-RUN wget https://gitlab.orfeo-toolbox.org/nicolasnn/pyotb/-/archive/$BRANCH/pyotb-$BRANCH.zip \
- && unzip pyotb-$BRANCH.zip
-RUN PYTHONPATH=/home/otbuser/pyotb-$BRANCH/pyotb python3 -c "import install; assert install.install_otb()"
-RUN PYTHONPATH=/home/otbuser/pyotb-$BRANCH python3 -c "import pyotb"
+COPY pyotb /home/otbuser/pyotb
+RUN PYTHONPATH=/home/otbuser/pyotb/pyotb python3 -c "import install; assert install.install_otb()"
+RUN PYTHONPATH=/home/otbuser/pyotb python3 -c "import pyotb"
-- 
GitLab


From b3811914dc21a855b36be34322a23bcb0a251936 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Cresson?= <remi.cresson@inrae.fr>
Date: Wed, 30 Aug 2023 07:48:55 +0000
Subject: [PATCH 08/11] WIP: ci

---
 tests/autoinstall_dockerfile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/autoinstall_dockerfile b/tests/autoinstall_dockerfile
index d312787..10c66b9 100644
--- a/tests/autoinstall_dockerfile
+++ b/tests/autoinstall_dockerfile
@@ -1,9 +1,8 @@
 ARG IMG
 FROM $IMG
-RUN apt update && apt install -y wget unzip
 RUN useradd -s /bin/bash -m otbuser
 WORKDIR /home/otbuser
 USER otbuser
 COPY pyotb /home/otbuser/pyotb
-RUN PYTHONPATH=/home/otbuser/pyotb/pyotb python3 -c "import install; assert install.install_otb()"
-RUN PYTHONPATH=/home/otbuser/pyotb python3 -c "import pyotb"
+RUN PYTHONPATH=/home/otbuser/pyotb/pyotb python -c "import install; assert install.install_otb()"
+RUN PYTHONPATH=/home/otbuser/pyotb python -c "import pyotb"
-- 
GitLab


From 5363965994f136925b31639eca9e4348e49a1900 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Cresson?= <remi.cresson@inrae.fr>
Date: Wed, 30 Aug 2023 07:50:49 +0000
Subject: [PATCH 09/11] CI: wip

---
 tests/autoinstall_dockerfile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/autoinstall_dockerfile b/tests/autoinstall_dockerfile
index 10c66b9..0d84e1d 100644
--- a/tests/autoinstall_dockerfile
+++ b/tests/autoinstall_dockerfile
@@ -1,8 +1,9 @@
 ARG IMG
 FROM $IMG
+RUN apt update && apt install -y python3  # Required for ubuntu
 RUN useradd -s /bin/bash -m otbuser
 WORKDIR /home/otbuser
 USER otbuser
 COPY pyotb /home/otbuser/pyotb
-RUN PYTHONPATH=/home/otbuser/pyotb/pyotb python -c "import install; assert install.install_otb()"
-RUN PYTHONPATH=/home/otbuser/pyotb python -c "import pyotb"
+RUN PYTHONPATH=/home/otbuser/pyotb/pyotb python3 -c "import install; assert install.install_otb()"
+RUN PYTHONPATH=/home/otbuser/pyotb python3 -c "import pyotb"
-- 
GitLab


From 0a4f44df391706a9ddf3c8349c001cac86be5d6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Cresson?= <remi.cresson@inrae.fr>
Date: Wed, 30 Aug 2023 07:52:35 +0000
Subject: [PATCH 10/11] CI: wip

---
 tests/autoinstall_dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/autoinstall_dockerfile b/tests/autoinstall_dockerfile
index 0d84e1d..1316899 100644
--- a/tests/autoinstall_dockerfile
+++ b/tests/autoinstall_dockerfile
@@ -4,6 +4,6 @@ RUN apt update && apt install -y python3  # Required for ubuntu
 RUN useradd -s /bin/bash -m otbuser
 WORKDIR /home/otbuser
 USER otbuser
-COPY pyotb /home/otbuser/pyotb
+COPY . /home/otbuser/pyotb
 RUN PYTHONPATH=/home/otbuser/pyotb/pyotb python3 -c "import install; assert install.install_otb()"
 RUN PYTHONPATH=/home/otbuser/pyotb python3 -c "import pyotb"
-- 
GitLab


From a0d62a1163d41c6b8746cb309fbe9b23ff5d9900 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Cresson?= <remi.cresson@inrae.fr>
Date: Wed, 30 Aug 2023 08:10:44 +0000
Subject: [PATCH 11/11] CI: wip

---
 tests/autoinstall_dockerfile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/autoinstall_dockerfile b/tests/autoinstall_dockerfile
index 1316899..816eb61 100644
--- a/tests/autoinstall_dockerfile
+++ b/tests/autoinstall_dockerfile
@@ -1,6 +1,7 @@
 ARG IMG
 FROM $IMG
-RUN apt update && apt install -y python3  # Required for ubuntu
+# For unbuntu:
+RUN apt update && apt install -y ca-certificates python3 && update-ca-certificates
 RUN useradd -s /bin/bash -m otbuser
 WORKDIR /home/otbuser
 USER otbuser
-- 
GitLab