From 67984c0fe7612be1772f187af136c0567a319dd5 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Wed, 9 Oct 2024 17:15:54 +0200 Subject: [PATCH 01/36] add github actions to deploy docker on ghcr --- .github/workflows/cicd_deploy.yml | 69 +++++++++++++++++++++++++++++++ Makefile | 18 ++++++-- 2 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/cicd_deploy.yml diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml new file mode 100644 index 00000000..2b6f721a --- /dev/null +++ b/.github/workflows/cicd_deploy.yml @@ -0,0 +1,69 @@ + +name: cicd_deploy + +on: + # Also run when the pull request merges (which generates a push) + # So that we can tag the docker image appropriately. + push: + tags: [ 'v*.*.*' ] + +env: + IMAGE_NAME: ${{ github.repository }} + REGISTRY: ghcr.io + TEST_TAG: ${{ github.repository }}:test + +jobs: + deploy_docker: + runs-on: ubuntu-latest + + permissions: + packages: write + + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + - name: Build the Docker image + id: build + uses: docker/build-push-action@v5 + with: + load: true + tags: ${{ env.TEST_TAG }} + + # run the test on the docker image + - name: Run tests in docker image + run: > + docker run + --ipc=host + ${{ env.TEST_TAG }} + python -m pytest ./test -s --log-cli-level DEBUG + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + if: github.event_name != 'pull_request' + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build an Docker image with Buildx (don't on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Makefile b/Makefile index 49748893..676546be 100644 --- a/Makefile +++ b/Makefile @@ -21,12 +21,24 @@ mamba-env-update: # Docker ############################## -PROJECT_NAME=lidar_hd/lidro +REGISTRY=ghcr.io +IMAGE_NAME=lidro +NAMESPACE=ignf VERSION=`python -m lidro._version` +FULL_IMAGE_NAME=${REGISTRY}/${NAMESPACE}/${IMAGE_NAME}:${VERSION} + docker-build: - docker build -t ${PROJECT_NAME}:${VERSION} -f Dockerfile . + docker build --no-cache -t ${IMAGE_NAME}:${VERSION} -f Dockerfile . + +docker-test: + docker run --rm -it ${IMAGE_NAME}:${VERSION} python -m pytest -s docker-remove: - docker rmi -f `docker images | grep ${PROJECT_NAME} | tr -s ' ' | cut -d ' ' -f 3` + docker rmi -f `docker images | grep ${IMAGE_NAME} | tr -s ' ' | cut -d ' ' -f 3` docker rmi -f `docker images -f "dangling=true" -q` + +docker-deploy: + docker tag ${IMAGE_NAME}:${VERSION} ${FULL_IMAGE_NAME} + docker push ${FULL_IMAGE_NAME} + From 19ee9cc992eb2525ee77d7ef1681c76ca563c03a Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Wed, 9 Oct 2024 17:25:52 +0200 Subject: [PATCH 02/36] test cicd file --- .github/workflows/cicd_deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 2b6f721a..79e447bf 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -2,10 +2,10 @@ name: cicd_deploy on: - # Also run when the pull request merges (which generates a push) - # So that we can tag the docker image appropriately. - push: - tags: [ 'v*.*.*' ] + pull_request: + branches: + - main + - dev env: IMAGE_NAME: ${{ github.repository }} From 2857ef24843fe676e7f65601c40060627f8a3783 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Wed, 9 Oct 2024 17:54:28 +0200 Subject: [PATCH 03/36] to fixup --- .github/workflows/cicd_deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 79e447bf..e9f9d7c2 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -63,6 +63,8 @@ jobs: id: build-and-push uses: docker/build-push-action@v5 with: + ssh-key: ${{ secrets.DEPLOYER_SSHKEY }} + submodules: true context: . push: true tags: ${{ steps.meta.outputs.tags }} From e0645c60c09263d03ae102c34a0c4750ea0b8192 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Wed, 9 Oct 2024 17:56:29 +0200 Subject: [PATCH 04/36] to fixup --- .github/workflows/cicd_deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index e9f9d7c2..0495fcee 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -63,8 +63,7 @@ jobs: id: build-and-push uses: docker/build-push-action@v5 with: - ssh-key: ${{ secrets.DEPLOYER_SSHKEY }} - submodules: true + submodules: false context: . push: true tags: ${{ steps.meta.outputs.tags }} From 2a7169148e326422c6db11bd5f1be0edb952df8e Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Wed, 9 Oct 2024 18:11:19 +0200 Subject: [PATCH 05/36] to fixup --- .github/workflows/cicd_deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 0495fcee..13d0a83b 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -63,7 +63,9 @@ jobs: id: build-and-push uses: docker/build-push-action@v5 with: - submodules: false + submodules: + include: [] + recursive: false context: . push: true tags: ${{ steps.meta.outputs.tags }} From 0abe69149d1f6a1dee97c5eb23902e8b8630ba5f Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Wed, 9 Oct 2024 18:12:19 +0200 Subject: [PATCH 06/36] to fixup --- .github/workflows/cicd_deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 13d0a83b..346c71aa 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -62,10 +62,10 @@ jobs: - name: Build and push Docker image id: build-and-push uses: docker/build-push-action@v5 + submodules: + include: [] + recursive: false with: - submodules: - include: [] - recursive: false context: . push: true tags: ${{ steps.meta.outputs.tags }} From 5d9b13caf0035bda9e4884df8c83b2861d0bf948 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Wed, 16 Oct 2024 11:24:50 +0200 Subject: [PATCH 07/36] fix submodules --- .github/workflows/cicd_deploy.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 346c71aa..79e447bf 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -62,9 +62,6 @@ jobs: - name: Build and push Docker image id: build-and-push uses: docker/build-push-action@v5 - submodules: - include: [] - recursive: false with: context: . push: true From 3627180549098418ba0700bd09d7ca7f23c5118a Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 14:43:53 +0100 Subject: [PATCH 08/36] to fixup data --- Dockerfile | 3 ++- data | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 54970eec..db063a0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,5 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1 COPY lidro lidro -COPY configs configs \ No newline at end of file +COPY configs configs +COPY data data \ No newline at end of file diff --git a/data b/data index 031c3315..2ae2dfcc 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 031c3315127a9c972d622779a25aed3274789fa4 +Subproject commit 2ae2dfcc4fd4f5e89c4510c49fd4e6676e247421 From 80a06f30eb92494a5b5f06066154e1181b8aeff4 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 15:35:38 +0100 Subject: [PATCH 09/36] to fixup data --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index db063a0e..af48a61d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN micromamba install -y -n base -f /tmp/env.yaml && \ ENV ENV=base ARG MAMBA_DOCKERFILE_ACTIVATE=1 - +RUN mkdir data +RUN mkdir tmp COPY lidro lidro COPY configs configs -COPY data data \ No newline at end of file From 2cedfa92af3d2578efb20b04574ecfed86fd4b8b Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 15:48:22 +0100 Subject: [PATCH 10/36] to fixup data --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index af48a61d..01a4777d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,11 @@ ENV ENV=base ARG MAMBA_DOCKERFILE_ACTIVATE=1 RUN mkdir data +RUN cd /data && git clone git@github.com:IGNF/lidro-data.git +RUN cd .. RUN mkdir tmp COPY lidro lidro COPY configs configs +RUN git submodule update --remote --merge + + From b78f5d680469244f488bbe70709577a92c5122b6 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 16:03:58 +0100 Subject: [PATCH 11/36] to fixup data --- .github/workflows/cicd_deploy.yml | 5 +++++ Dockerfile | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 79e447bf..5a5d3af8 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -20,6 +20,11 @@ jobs: packages: write steps: + - name: Checkout with submodules + uses: actions/checkout@v3 + with: + ssh-key: ${{ secrets.DEPLOYER_SSHKEY }} + submodules: true - name: Checkout branch uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index 01a4777d..77e3e5e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,11 +15,10 @@ ENV ENV=base ARG MAMBA_DOCKERFILE_ACTIVATE=1 RUN mkdir data -RUN cd /data && git clone git@github.com:IGNF/lidro-data.git -RUN cd .. +## RUN cd /data && git clone git@github.com:IGNF/lidro-data.git RUN mkdir tmp COPY lidro lidro COPY configs configs -RUN git submodule update --remote --merge +## RUN git submodule update --remote --merge From 87ce4d41dfcfe367538a8c08cf646d3a9a130991 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 16:26:18 +0100 Subject: [PATCH 12/36] to fixup data --- .github/workflows/cicd_deploy.yml | 127 ++++++++++++++++++------------ 1 file changed, 76 insertions(+), 51 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 5a5d3af8..8a379e2d 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -12,63 +12,88 @@ env: REGISTRY: ghcr.io TEST_TAG: ${{ github.repository }}:test + jobs: - deploy_docker: + build-docker: runs-on: ubuntu-latest + steps: + - name: Checkout with submodules + uses: actions/checkout@v3 + with: + ssh-key: ${{ secrets.DEPLOYER_SSHKEY }} + submodules: true + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: 'user/app:tag' - permissions: - packages: write +# jobs: +# deploy_docker: +# runs-on: ubuntu-latest - steps: - - name: Checkout with submodules - uses: actions/checkout@v3 - with: - ssh-key: ${{ secrets.DEPLOYER_SSHKEY }} - submodules: true - - name: Checkout branch - uses: actions/checkout@v4 +# permissions: +# packages: write + +# steps: +# - name: Checkout with submodules +# uses: actions/checkout@v3 +# with: +# ssh-key: ${{ secrets.DEPLOYER_SSHKEY }} +# submodules: true +# - name: Checkout branch +# uses: actions/checkout@v4 - - name: Build the Docker image - id: build - uses: docker/build-push-action@v5 - with: - load: true - tags: ${{ env.TEST_TAG }} +# - name: Build the Docker image +# id: build +# uses: docker/build-push-action@v5 +# with: +# load: true +# tags: ${{ env.TEST_TAG }} - # run the test on the docker image - - name: Run tests in docker image - run: > - docker run - --ipc=host - ${{ env.TEST_TAG }} - python -m pytest ./test -s --log-cli-level DEBUG +# # run the test on the docker image +# - name: Run tests in docker image +# run: > +# docker run +# --ipc=host +# ${{ env.TEST_TAG }} +# python -m pytest ./test -s --log-cli-level DEBUG - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} +# # Login against a Docker registry except on PR +# # https://github.com/docker/login-action +# - name: Log into registry ${{ env.REGISTRY }} +# if: github.event_name != 'pull_request' +# uses: docker/login-action@v2 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - if: github.event_name != 'pull_request' - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} +# # Extract metadata (tags, labels) for Docker +# # https://github.com/docker/metadata-action +# - name: Extract Docker metadata +# if: github.event_name != 'pull_request' +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # Build an Docker image with Buildx (don't on PR) - # https://github.com/docker/build-push-action - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file +# # Build an Docker image with Buildx (don't on PR) +# # https://github.com/docker/build-push-action +# - name: Build and push Docker image +# id: build-and-push +# uses: docker/build-push-action@v5 +# with: +# context: . +# push: true +# tags: ${{ steps.meta.outputs.tags }} +# labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 7be901719974c0dce6182f6f800ab63b72ba9159 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 16:33:28 +0100 Subject: [PATCH 13/36] to fixup data --- .github/workflows/cicd_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 8a379e2d..b9f7476b 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -37,7 +37,7 @@ jobs: push: true tags: 'user/app:tag' -# jobs: +## jobs: # deploy_docker: # runs-on: ubuntu-latest From ecfc99c42041c8a437fb2a6722ed9e868e3b9802 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 16:42:36 +0100 Subject: [PATCH 14/36] to fixup data --- .github/workflows/cicd_deploy.yml | 146 +++++++++++++----------------- 1 file changed, 64 insertions(+), 82 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index b9f7476b..349eaa6f 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -1,99 +1,81 @@ - name: cicd_deploy on: - pull_request: - branches: - - main - - dev + push: + # Run deployment on every new version tag and every push to main + branches: [ "main" ] + tags: [ '*.*.*' ] env: - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: ${{ github.repository }} REGISTRY: ghcr.io - TEST_TAG: ${{ github.repository }}:test - + DOCKER_IMAGE_NAME: lidro + TEST_TAG: lidro:test jobs: - build-docker: + deploy_docker: runs-on: ubuntu-latest - steps: - - name: Checkout with submodules - uses: actions/checkout@v3 - with: - ssh-key: ${{ secrets.DEPLOYER_SSHKEY }} - submodules: true - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GHCR_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - push: true - tags: 'user/app:tag' -## jobs: -# deploy_docker: -# runs-on: ubuntu-latest + steps: + - name: Checkout branch + uses: actions/checkout@v4 -# permissions: -# packages: write + # build the image + - name: Build Docker image for tests + id: build + uses: docker/build-push-action@v5 + with: + load: true + tags: ${{ env.TEST_TAG }} -# steps: -# - name: Checkout with submodules -# uses: actions/checkout@v3 -# with: -# ssh-key: ${{ secrets.DEPLOYER_SSHKEY }} -# submodules: true -# - name: Checkout branch -# uses: actions/checkout@v4 + - name: Run tests in docker + run: > + docker run + --ipc=host + ${{ env.TEST_TAG }} + python -m pytest -m docker -s --log-cli-level DEBUG -# - name: Build the Docker image -# id: build -# uses: docker/build-push-action@v5 -# with: -# load: true -# tags: ${{ env.TEST_TAG }} + - name: Set version number + run: | + echo "VERSION=v$(python -m lidro.version)" >> $GITHUB_ENV -# # run the test on the docker image -# - name: Run tests in docker image -# run: > -# docker run -# --ipc=host -# ${{ env.TEST_TAG }} -# python -m pytest ./test -s --log-cli-level DEBUG + - name: Check tag and version number consistency + if: ${{ github.event_name == 'tag' }} + run: | + if [[ ${{ github.ref_name }} == ${{ env.VERSION }} ]] + then + echo "OK: Tag name and VERSION.md (${{ env.VERSION }}) version number (${{ github.ref_name }}) match" + else + echo "NOK: Tag name and VERSION.md (${{ env.VERSION }}) version number (${{ github.ref_name }}) don't match" + exit 1 + fi -# # Login against a Docker registry except on PR -# # https://github.com/docker/login-action -# - name: Log into registry ${{ env.REGISTRY }} -# if: github.event_name != 'pull_request' -# uses: docker/login-action@v2 -# with: -# registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} -# # Extract metadata (tags, labels) for Docker -# # https://github.com/docker/metadata-action -# - name: Extract Docker metadata -# if: github.event_name != 'pull_request' -# id: meta -# uses: docker/metadata-action@v5 -# with: -# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} -# # Build an Docker image with Buildx (don't on PR) -# # https://github.com/docker/build-push-action -# - name: Build and push Docker image -# id: build-and-push -# uses: docker/build-push-action@v5 -# with: -# context: . -# push: true -# tags: ${{ steps.meta.outputs.tags }} -# labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + # Build and push Docker image with Buildx (don't on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + if: ${{ github.event_name != 'pull_request' }} + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From e68678ae80d306db9a21677fb798524525fe2b60 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 16:43:58 +0100 Subject: [PATCH 15/36] to fixup data --- .github/workflows/cicd_deploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 349eaa6f..78e0fe5c 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -1,11 +1,11 @@ name: cicd_deploy on: - push: - # Run deployment on every new version tag and every push to main - branches: [ "main" ] - tags: [ '*.*.*' ] - + pull_request: + branches: + - main + - dev + env: IMAGE_NAME: ${{ github.repository }} REGISTRY: ghcr.io From 0e10b9faf34e36cfd2ee5f4694482eaededce335 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 16:45:15 +0100 Subject: [PATCH 16/36] to fixup data --- .github/workflows/cicd_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 78e0fe5c..ea248cc7 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -5,7 +5,7 @@ on: branches: - main - dev - + env: IMAGE_NAME: ${{ github.repository }} REGISTRY: ghcr.io @@ -58,7 +58,7 @@ jobs: with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GHCR_TOKEN }} # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action From 7f7493e0b2e5dabb5be099ef1c9ff606ecaf6b6d Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 17:02:46 +0100 Subject: [PATCH 17/36] to fixup data --- .github/workflows/cicd_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index ea248cc7..140f9785 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -20,7 +20,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v4 - # build the image + ## build the image - name: Build Docker image for tests id: build uses: docker/build-push-action@v5 From c948485370a7818ffe98ef208d4cd20855c55248 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 17:14:30 +0100 Subject: [PATCH 18/36] to fixup data --- .github/workflows/cicd_deploy.yml | 4 +++- .gitmodules | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 140f9785..362106db 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -19,7 +19,9 @@ jobs: steps: - name: Checkout branch uses: actions/checkout@v4 - + with: + submodules: recursive + token: ${{ secrets.GHCR_TOKEN }} ## build the image - name: Build Docker image for tests id: build diff --git a/.gitmodules b/.gitmodules index ca441591..938af87f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "data"] path = data - url = git@github.com:IGNF/lidro-data.git + url = https://github.com/IGNF/lidro-data.git From a577780733e80e48d07e344a3c9e1c170f9315d5 Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 17:15:54 +0100 Subject: [PATCH 19/36] to fixup data --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 938af87f..ca441591 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "data"] path = data - url = https://github.com/IGNF/lidro-data.git + url = git@github.com:IGNF/lidro-data.git From 0038d0f9ad51ba08a0d1831cadde5a5f8c26752b Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 17:24:05 +0100 Subject: [PATCH 20/36] to fixup data --- .github/workflows/cicd_deploy.yml | 2 +- .gitmodules | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 362106db..8a0454d1 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -22,7 +22,7 @@ jobs: with: submodules: recursive token: ${{ secrets.GHCR_TOKEN }} - ## build the image + # build the image - name: Build Docker image for tests id: build uses: docker/build-push-action@v5 diff --git a/.gitmodules b/.gitmodules index ca441591..938af87f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "data"] path = data - url = git@github.com:IGNF/lidro-data.git + url = https://github.com/IGNF/lidro-data.git From 211e4e709813c4e2be42c456e10a7e2208fc460c Mon Sep 17 00:00:00 2001 From: Yoann Apel Date: Tue, 12 Nov 2024 17:29:46 +0100 Subject: [PATCH 21/36] to fixup data --- .github/workflows/cicd_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 8a0454d1..3c3a70c3 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -20,7 +20,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v4 with: - submodules: recursive + submodules: true token: ${{ secrets.GHCR_TOKEN }} # build the image - name: Build Docker image for tests From 37eadf9f9a669b99c5f6b67ba902850b3538747a Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 17:36:51 +0100 Subject: [PATCH 22/36] update ghcr_token --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 21b7395a..373c31e9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - token: ${{ secrets.PAT_TOKEN }} + token: ${{ secrets.GHCR_TOKEN }} # See https://github.com/marketplace/actions/setup-micromamba - name: Install conda env uses: mamba-org/setup-micromamba@v1.8.1 From c9789a6be4c1d10d20743f68671b1e591fa0f7e3 Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 17:38:23 +0100 Subject: [PATCH 23/36] update ghcr_token --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 373c31e9..b984d337 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v4 with: - submodules: recursive + submodules: True token: ${{ secrets.GHCR_TOKEN }} # See https://github.com/marketplace/actions/setup-micromamba - name: Install conda env From a96cd3024e5ba61f0a9fe49ca94c70782d3beec2 Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 17:47:14 +0100 Subject: [PATCH 24/36] update ghcr_token --- .github/workflows/ci.yaml | 22 ++++++++++++++++++---- .netrc | 3 +++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .netrc diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b984d337..1e84be1b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,17 +17,31 @@ jobs: - name: Checkout branch uses: actions/checkout@v4 with: - submodules: True - token: ${{ secrets.GHCR_TOKEN }} - # See https://github.com/marketplace/actions/setup-micromamba + submodules: recursive + token: ${{ secrets.GHRC_TOKEN }} + + - name: Configure .netrc for Docker submodule access + run: | + echo "machine github.com login ${{ secrets.GHRC_TOKEN }}" > ~/.netrc + chmod 600 ~/.netrc + + - name: Build Docker image for tests + uses: docker/build-push-action@v3 + with: + context: . + load: true + tags: ${{ env.TEST_TAG }} + secrets: id=netrc,src=$HOME/.netrc + - name: Install conda env uses: mamba-org/setup-micromamba@v1.8.1 with: environment-file: environment.yml - environment-name: lidro # activate the environment + environment-name: lidro cache-environment: true cache-downloads: true generate-run-shell: true + - name: Unit test shell: micromamba-shell {0} run: | diff --git a/.netrc b/.netrc new file mode 100644 index 00000000..865ebcaa --- /dev/null +++ b/.netrc @@ -0,0 +1,3 @@ +machine github.com +login GITHUB_USERNAME +password GITHUB_TOKEN \ No newline at end of file From fa484e928e180096900cc94666b2efbcebc61d62 Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 17:50:26 +0100 Subject: [PATCH 25/36] update ghcr_token --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1e84be1b..d1f07386 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,8 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - token: ${{ secrets.GHRC_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Configure .netrc for Docker submodule access run: | From 14e51427df6960de70b918f6ce4fd1705a704a16 Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 17:58:30 +0100 Subject: [PATCH 26/36] update ghcr_token --- .github/workflows/ci.yaml | 8 +------- .netrc | 3 --- Dockerfile | 22 ++++++++++++++++++---- 3 files changed, 19 insertions(+), 14 deletions(-) delete mode 100644 .netrc diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d1f07386..e35e5352 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,13 +18,7 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - token: ${{ secrets.GITHUB_TOKEN }} - - - - name: Configure .netrc for Docker submodule access - run: | - echo "machine github.com login ${{ secrets.GHRC_TOKEN }}" > ~/.netrc - chmod 600 ~/.netrc + token: ${{ secrets.GHRC_TOKEN }} - name: Build Docker image for tests uses: docker/build-push-action@v3 diff --git a/.netrc b/.netrc deleted file mode 100644 index 865ebcaa..00000000 --- a/.netrc +++ /dev/null @@ -1,3 +0,0 @@ -machine github.com -login GITHUB_USERNAME -password GITHUB_TOKEN \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 77e3e5e3..3027b97a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,13 @@ FROM mambaorg/micromamba:latest USER root + +# Switch to root to install additional packages +USER root + +# Install Git to enable submodule sync/update commands +RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* + WORKDIR /lidro # # Set up the Conda environment: cf https://github.com/mamba-org/micromamba-docker @@ -11,14 +18,21 @@ RUN chown $MAMBA_USER:$MAMBA_USER /tmp/env.yaml RUN micromamba install -y -n base -f /tmp/env.yaml && \ micromamba clean --all --yes + +# Set environment variables ENV ENV=base ARG MAMBA_DOCKERFILE_ACTIVATE=1 -RUN mkdir data -## RUN cd /data && git clone git@github.com:IGNF/lidro-data.git -RUN mkdir tmp +# Sync and update submodules (ensure they are configured in the repository) +RUN git submodule sync && \ + git submodule update --init --recursive + +# Create directories +RUN mkdir data tmp + +# Copy the application files COPY lidro lidro COPY configs configs -## RUN git submodule update --remote --merge + From e68864abdb142d43d5d7367f8ee1ea5a119f369a Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 18:03:16 +0100 Subject: [PATCH 27/36] update ghcr_token --- .github/workflows/ci.yaml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e35e5352..373c31e9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,25 +18,16 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - token: ${{ secrets.GHRC_TOKEN }} - - - name: Build Docker image for tests - uses: docker/build-push-action@v3 - with: - context: . - load: true - tags: ${{ env.TEST_TAG }} - secrets: id=netrc,src=$HOME/.netrc - + token: ${{ secrets.GHCR_TOKEN }} + # See https://github.com/marketplace/actions/setup-micromamba - name: Install conda env uses: mamba-org/setup-micromamba@v1.8.1 with: environment-file: environment.yml - environment-name: lidro + environment-name: lidro # activate the environment cache-environment: true cache-downloads: true generate-run-shell: true - - name: Unit test shell: micromamba-shell {0} run: | From ac77a7332de3386abb15baf56d83625f985239fa Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 18:10:09 +0100 Subject: [PATCH 28/36] update ghcr_token --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 938af87f..5c50f01d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "data"] +[submodule "lidro-data"] path = data url = https://github.com/IGNF/lidro-data.git From 49b55c4603b7fa9638a41a0da4185d58e91abbaa Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 18:12:13 +0100 Subject: [PATCH 29/36] update ghcr_token --- .github/workflows/cicd_deploy.yml | 2 +- .gitmodules | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd_deploy.yml b/.github/workflows/cicd_deploy.yml index 3c3a70c3..8a0454d1 100644 --- a/.github/workflows/cicd_deploy.yml +++ b/.github/workflows/cicd_deploy.yml @@ -20,7 +20,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v4 with: - submodules: true + submodules: recursive token: ${{ secrets.GHCR_TOKEN }} # build the image - name: Build Docker image for tests diff --git a/.gitmodules b/.gitmodules index 5c50f01d..4b1a0fd7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "lidro-data"] - path = data + path = lidro/data url = https://github.com/IGNF/lidro-data.git From aba4e393e652459e7c75285ec20cb51b420eaac6 Mon Sep 17 00:00:00 2001 From: mdupays Date: Tue, 12 Nov 2024 18:13:32 +0100 Subject: [PATCH 30/36] update ghcr_token --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 4b1a0fd7..938af87f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "lidro-data"] - path = lidro/data +[submodule "data"] + path = data url = https://github.com/IGNF/lidro-data.git From 01670a33c7df5b60c4ca01300525e9c177775ae6 Mon Sep 17 00:00:00 2001 From: mdupays Date: Wed, 13 Nov 2024 09:34:51 +0100 Subject: [PATCH 31/36] update ghcr_token --- .github/workflows/ci.yaml | 2 +- Dockerfile | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 373c31e9..ee8ef460 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - token: ${{ secrets.GHCR_TOKEN }} + #token: ${{ secrets.GHCR_TOKEN }} # See https://github.com/marketplace/actions/setup-micromamba - name: Install conda env uses: mamba-org/setup-micromamba@v1.8.1 diff --git a/Dockerfile b/Dockerfile index 3027b97a..3b2f724e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,11 @@ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* WORKDIR /lidro +COPY . . + # # Set up the Conda environment: cf https://github.com/mamba-org/micromamba-docker -COPY environment.yml /tmp/env.yaml -COPY requirements.txt /tmp/requirements.txt +# COPY environment.yml /tmp/env.yaml +# COPY requirements.txt /tmp/requirements.txt RUN chown $MAMBA_USER:$MAMBA_USER /tmp/env.yaml RUN micromamba install -y -n base -f /tmp/env.yaml && \ micromamba clean --all --yes @@ -28,11 +30,11 @@ RUN git submodule sync && \ git submodule update --init --recursive # Create directories -RUN mkdir data tmp +RUN mkdir tmp -# Copy the application files -COPY lidro lidro -COPY configs configs +# # Copy the application files +# COPY lidro lidro +# COPY configs configs From 91d6e040c798ae62066b3adc0dc4d3d2a3e93380 Mon Sep 17 00:00:00 2001 From: mdupays Date: Wed, 13 Nov 2024 09:39:12 +0100 Subject: [PATCH 32/36] update ghcr_token --- Dockerfile | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3b2f724e..5102ad3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,19 +6,28 @@ USER root # Switch to root to install additional packages USER root -# Install Git to enable submodule sync/update commands -RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* +# # Install Git to enable submodule sync/update commands +# RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* WORKDIR /lidro COPY . . -# # Set up the Conda environment: cf https://github.com/mamba-org/micromamba-docker +RUN chown $MAMBA_USER:$MAMBA_USER environment.yml +RUN micromamba install -y -n base -f environment.yml && \ + micromamba clean --all --yes + + +# # # Set up the Conda environment: cf https://github.com/mamba-org/micromamba-docker # COPY environment.yml /tmp/env.yaml # COPY requirements.txt /tmp/requirements.txt -RUN chown $MAMBA_USER:$MAMBA_USER /tmp/env.yaml -RUN micromamba install -y -n base -f /tmp/env.yaml && \ - micromamba clean --all --yes +# RUN chown $MAMBA_USER:$MAMBA_USER /tmp/env.yaml +# RUN micromamba install -y -n base -f /tmp/env.yaml && \ +# micromamba clean --all --yes + +# # Copy the application files +# COPY lidro lidro +# COPY configs configs # Set environment variables @@ -32,9 +41,5 @@ RUN git submodule sync && \ # Create directories RUN mkdir tmp -# # Copy the application files -# COPY lidro lidro -# COPY configs configs - From 4a6304c14db26d27bda8b6c58b0a8395034ae1c8 Mon Sep 17 00:00:00 2001 From: mdupays Date: Wed, 13 Nov 2024 09:41:12 +0100 Subject: [PATCH 33/36] update dockerfile with submodule --- Dockerfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5102ad3d..c04c0b45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,13 +11,21 @@ USER root WORKDIR /lidro + +# Create directories +RUN mkdir tmp data + COPY . . +# Sync and update submodules (ensure they are configured in the repository) +RUN git submodule sync && \ + git submodule update --init --recursive + RUN chown $MAMBA_USER:$MAMBA_USER environment.yml RUN micromamba install -y -n base -f environment.yml && \ micromamba clean --all --yes - + # # # Set up the Conda environment: cf https://github.com/mamba-org/micromamba-docker # COPY environment.yml /tmp/env.yaml # COPY requirements.txt /tmp/requirements.txt @@ -34,12 +42,7 @@ RUN micromamba install -y -n base -f environment.yml && \ ENV ENV=base ARG MAMBA_DOCKERFILE_ACTIVATE=1 -# Sync and update submodules (ensure they are configured in the repository) -RUN git submodule sync && \ - git submodule update --init --recursive -# Create directories -RUN mkdir tmp From c0d04fe48508bef8fd84f81d264fd1110985d32b Mon Sep 17 00:00:00 2001 From: mdupays Date: Wed, 13 Nov 2024 09:52:53 +0100 Subject: [PATCH 34/36] update dockerfile with submodule --- .github/workflows/ci.yaml | 3 ++- Dockerfile | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee8ef460..bb20131a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,8 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - #token: ${{ secrets.GHCR_TOKEN }} + token: ${{ secrets.GHCR_TOKEN }} + fetch-depth: 1 # See https://github.com/marketplace/actions/setup-micromamba - name: Install conda env uses: mamba-org/setup-micromamba@v1.8.1 diff --git a/Dockerfile b/Dockerfile index c04c0b45..70d52d10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,15 +12,11 @@ USER root WORKDIR /lidro -# Create directories -RUN mkdir tmp data +# # Create directories +RUN mkdir tmp COPY . . -# Sync and update submodules (ensure they are configured in the repository) -RUN git submodule sync && \ - git submodule update --init --recursive - RUN chown $MAMBA_USER:$MAMBA_USER environment.yml RUN micromamba install -y -n base -f environment.yml && \ micromamba clean --all --yes @@ -43,6 +39,12 @@ ENV ENV=base ARG MAMBA_DOCKERFILE_ACTIVATE=1 +# Sync and update submodules (ensure they are configured in the repository) +RUN git submodule sync && \ + git submodule update --init --recursive + +RUN mkdir tmp + From d2dec1364e4e50204c6b1339f416249cbaf16bde Mon Sep 17 00:00:00 2001 From: mdupays Date: Wed, 13 Nov 2024 09:58:46 +0100 Subject: [PATCH 35/36] update dockerfile with submodule --- .github/workflows/ci.yaml | 2 +- Dockerfile | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bb20131a..84b0ccb3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: with: submodules: recursive token: ${{ secrets.GHCR_TOKEN }} - fetch-depth: 1 + #fetch-depth: 1 # See https://github.com/marketplace/actions/setup-micromamba - name: Install conda env uses: mamba-org/setup-micromamba@v1.8.1 diff --git a/Dockerfile b/Dockerfile index 70d52d10..077b37f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,10 +38,14 @@ RUN micromamba install -y -n base -f environment.yml && \ ENV ENV=base ARG MAMBA_DOCKERFILE_ACTIVATE=1 +# Use ARG to pass the authentication token +ARG GIT_AUTH_TOKEN -# Sync and update submodules (ensure they are configured in the repository) -RUN git submodule sync && \ - git submodule update --init --recursive +# Configure Git to use the token in the submodule URLs +RUN git config --global url."https://${GIT_AUTH_TOKEN}@github.com/".insteadOf "https://github.com/" + +# Initialize and update submodules +RUN git submodule update --init --recursive RUN mkdir tmp From fb916f9525ebc68aa3ca6335d42c35f73c96d89b Mon Sep 17 00:00:00 2001 From: mdupays Date: Wed, 13 Nov 2024 10:02:01 +0100 Subject: [PATCH 36/36] update dockerfile with submodule --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 077b37f1..306d28fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,6 @@ FROM mambaorg/micromamba:latest USER root -# Switch to root to install additional packages -USER root - # # Install Git to enable submodule sync/update commands # RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* @@ -38,6 +35,9 @@ RUN micromamba install -y -n base -f environment.yml && \ ENV ENV=base ARG MAMBA_DOCKERFILE_ACTIVATE=1 + +RUN mkdir tmp data + # Use ARG to pass the authentication token ARG GIT_AUTH_TOKEN @@ -47,7 +47,6 @@ RUN git config --global url."https://${GIT_AUTH_TOKEN}@github.com/".insteadOf "h # Initialize and update submodules RUN git submodule update --init --recursive -RUN mkdir tmp