From faf71e6cbe2d78801b6118b451fcf15e199effa8 Mon Sep 17 00:00:00 2001 From: Theo Satabin Date: Mon, 29 Jan 2024 08:54:58 +0100 Subject: [PATCH 1/6] Ajout d'un nettoyage propre du pool de stockage dans mergeNtiff --- src/mergeNtiff.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mergeNtiff.cpp b/src/mergeNtiff.cpp index 88fd5be..1872665 100644 --- a/src/mergeNtiff.cpp +++ b/src/mergeNtiff.cpp @@ -1300,6 +1300,9 @@ int main(int argc, char** argv) { delete pMaskOut; ProjPool::cleanProjPool(); proj_cleanup(); + StoragePool::cleanStoragePool(); + CurlPool::cleanCurlPool(); + curl_global_cleanup(); return 0; } \ No newline at end of file From f7c61045a3e52937b6403325d741cae97cd1aeb9 Mon Sep 17 00:00:00 2001 From: Theo Satabin Date: Tue, 30 Jan 2024 13:18:23 +0100 Subject: [PATCH 2/6] Gestion du versionnement de ma documentation avec mike --- .github/workflows/build-and-release.yaml | 77 ++++++++---------------- .github/workflows/build-docs.yaml | 67 --------------------- .gitignore | 3 +- CMakeLists.txt | 2 +- docs/CHANGELOG.hdr.md | 4 ++ docs/CONTRIBUTING.hdr.md | 4 ++ docs/README.hdr.md | 4 ++ docs/documentation.md | 9 +++ docs/mkdocs.yml | 27 +++++++++ docs/overrides/main.html | 8 +++ docs/requirements.txt | 3 + 11 files changed, 86 insertions(+), 122 deletions(-) delete mode 100644 .github/workflows/build-docs.yaml create mode 100644 docs/CHANGELOG.hdr.md create mode 100644 docs/CONTRIBUTING.hdr.md create mode 100644 docs/README.hdr.md create mode 100644 docs/documentation.md create mode 100644 docs/mkdocs.yml create mode 100644 docs/overrides/main.html create mode 100644 docs/requirements.txt diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 5f80dbb..d2f4bd4 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -79,66 +79,37 @@ jobs: cd build make doc cd .. - cp -r README.md CHANGELOG.md docs/images dist/ - - name: Upload documentation - if: "matrix.os == 'ubuntu-20.04'" - uses: actions/upload-artifact@v3 + cp docs/mkdocs.yml target/mkdocs.yml + cp -r docs/overrides target/ + cp -r docs/images target/docs/ + cp docs/documentation.md target/docs/documentation.md + cp docs/README.hdr.md target/docs/README.md + cp docs/CHANGELOG.hdr.md target/docs/CHANGELOG.md + cp docs/CONTRIBUTING.hdr.md target/docs/CONTRIBUTING.md + sed "s#x.y.z#${{ github.ref_name }}#g" README.md >>target/docs/README.md + sed -i "s#](./docs/images/#](./images/#g" target/docs/README.md + cat CHANGELOG.md >>target/docs/CHANGELOG.md + cat CONTRIBUTING.md >>target/docs/CONTRIBUTING.md + + + - name: Setup python + uses: actions/setup-python@v4 with: - name: dist-py3 - path: dist/ - if-no-files-found: error - retention-days: 1 - - commit_documentation: - name: Add documentation into gh-pages branch - needs: build_and_test - if: "always()&&(needs.create_release.outputs.job_status=='success')&&(needs.build_and_test.outputs.job_status=='success')" - runs-on: ubuntu-latest - - steps: + python-version: "3.10" + cache: 'pip' - - name: Checkout project on gh-pages - uses: actions/checkout@v3 - with: - ref: 'gh-pages' - token: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/download-artifact@v3 - with: - name: dist-py3 - path: artifact/ + - name: Install Mkdocs + run: pip install -r docs/requirements.txt - - name: Copy version elements to final location - run: | - mkdir -p docs/versions/${{ github.ref_name }}/docs - cp -r artifact/html docs/versions/${{ github.ref_name }}/ - cp -r artifact/images docs/versions/${{ github.ref_name }}/docs/ - - - - name: Add pages from templates - run: | - sed "s#__version__#${{ github.ref_name }}#" templates/mkdocs.template.yml >mkdocs.yml - - sed "s#__version__#${{ github.ref_name }}#" templates/documentation.template.md >docs/versions/${{ github.ref_name }}/documentation.md - - sed "s#__version__#${{ github.ref_name }}#" templates/index-version.template.md >docs/versions/${{ github.ref_name }}/index.md - cat artifact/README.md >>docs/versions/${{ github.ref_name }}/index.md - sed -i "s#x.y.z#${{ github.ref_name }}#g" docs/versions/${{ github.ref_name }}/index.md - - cp templates/index-versions.template.md docs/versions/index.md - sed "s/^## \(.*\)$/## \1 \n\n[➔ Lien vers la documentation](\1\/index.md) /" artifact/CHANGELOG.md >>docs/versions/index.md - - sed "s#__version__#${{ github.ref_name }}#" templates/latest.template.html >docs/versions/latest/index.html - rm -r artifact - - - name: Publish on gh-pages branch + - name: Publish documentation + if: "matrix.os == 'ubuntu-20.04'" run: | git config user.name github-actions git config user.email github-actions@github.com - git add -v docs/versions/${{ github.ref_name }}/ docs/versions/latest/ docs/index.md docs/versions/index.md - git commit -m "Add documentation for version ${{ github.ref_name }}" - git push + cd target/ + mike deploy --push --update-aliases --branch gh-pages -t "Version ${{ github.ref_name }}" ${{ github.ref_name }} latest + mike set-default --push --branch gh-pages ${{ github.ref_name }} delete_version: name: Remove release and tag if error occured diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml deleted file mode 100644 index 459496b..0000000 --- a/.github/workflows/build-docs.yaml +++ /dev/null @@ -1,67 +0,0 @@ -name: Build doc site with mkdocs and deploy - -on: - workflow_dispatch: - -jobs: - - build: - - name: Build doc site with mkdocs - - runs-on: ubuntu-latest - - steps: - - name: Checkout project - uses: actions/checkout@v3 - with: - ref: 'gh-pages' - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: 'pip' - - - name: Install Mkdocs - run: pip install -r requirements.txt - - - name: Run mkdocs and archive - run : | - mkdocs build - tar \ - --dereference --hard-dereference \ - --directory "site" \ - -cvf "${{ runner.temp }}/site.tar" \ - --exclude=.git \ - --exclude=.github \ - . - - - name: Upload pages - uses: actions/upload-artifact@main - with: - name: github-pages - path: ${{ runner.temp }}/site.tar - retention-days: 1 - - deploy: - - name: Deploy site to github pages - - needs: build - - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 diff --git a/.gitignore b/.gitignore index a7e8e21..81333a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build -dist \ No newline at end of file +dist +target \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 8549af8..bf22fcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ endforeach() if(DOC_ENABLED) set(DOXYGEN_DOXYFILE_ENCODING UTF-8) - set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist) + set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/target/docs) set(DOXYGEN_OUTPUT_LANGUAGE french) set(DOXYGEN_INPUT_ENCODING UTF-8) set(DOXYGEN_IMAGE_PATH docs/images) diff --git a/docs/CHANGELOG.hdr.md b/docs/CHANGELOG.hdr.md new file mode 100644 index 0000000..e0257d2 --- /dev/null +++ b/docs/CHANGELOG.hdr.md @@ -0,0 +1,4 @@ +--- +hide: + - navigation +--- diff --git a/docs/CONTRIBUTING.hdr.md b/docs/CONTRIBUTING.hdr.md new file mode 100644 index 0000000..e0257d2 --- /dev/null +++ b/docs/CONTRIBUTING.hdr.md @@ -0,0 +1,4 @@ +--- +hide: + - navigation +--- diff --git a/docs/README.hdr.md b/docs/README.hdr.md new file mode 100644 index 0000000..e0257d2 --- /dev/null +++ b/docs/README.hdr.md @@ -0,0 +1,4 @@ +--- +hide: + - navigation +--- diff --git a/docs/documentation.md b/docs/documentation.md new file mode 100644 index 0000000..9131259 --- /dev/null +++ b/docs/documentation.md @@ -0,0 +1,9 @@ +--- +hide: + - navigation + - toc +--- + +# Documentation technique + + \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000..6fcfe3b --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,27 @@ +site_name: "Projet ROK4 - Outils de génération de dalles raster et vecteur" +site_url: https://rok4.github.io/generation + +nav: + - Accueil: README.md + - Documentation technique: documentation.md + - Historique des versions: CHANGELOG.md + - Contribuer: CONTRIBUTING.md + +theme: + logo: https://rok4.github.io/assets/images/rok4-carre.png + favicon: https://rok4.github.io/assets/images/rok4-carre.png + name: material + features: + - navigation.tabs + - navigation.tabs.sticky + language: fr + custom_dir: overrides + +extra_css: + - https://rok4.github.io/assets/css/commun.css + +extra: + homepage: https://rok4.github.io + version: + provider: mike + default: latest \ No newline at end of file diff --git a/docs/overrides/main.html b/docs/overrides/main.html new file mode 100644 index 0000000..7d3b2f9 --- /dev/null +++ b/docs/overrides/main.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block outdated %} + 🚨 Vous êtes sur la documentation d'une ancienne version. 🚨 + + Cliquez ici pour aller sur la dernière version. + +{% endblock %} \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..543b168 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +mkdocs +mkdocs-material +mike \ No newline at end of file From 84c81da5d5c7f4237aab5f0c9cf68606d6c857af Mon Sep 17 00:00:00 2001 From: Theo Satabin Date: Wed, 31 Jan 2024 14:10:04 +0100 Subject: [PATCH 3/6] Correction du workflow (publication de la doc) --- .github/workflows/build-and-release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index d2f4bd4..1f4892b 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -46,7 +46,9 @@ jobs: steps: - name: Checkout project - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Install system dependencies run: | From 6b0453f3824c2210461b07de98ec6a7c7900a33c Mon Sep 17 00:00:00 2001 From: Theo Satabin Date: Tue, 13 Feb 2024 17:03:04 +0100 Subject: [PATCH 4/6] Correction passage labeler v4 -> v5 --- .github/workflows/pr-auto-labeler.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-auto-labeler.yml b/.github/workflows/pr-auto-labeler.yml index 42ec571..cc5272e 100644 --- a/.github/workflows/pr-auto-labeler.yml +++ b/.github/workflows/pr-auto-labeler.yml @@ -1,6 +1,6 @@ name: "🏷 PR Labeler" on: - - pull_request_target + - pull_request permissions: contents: read @@ -10,6 +10,6 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4 + - uses: actions/labeler@v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" From e6a7c0b2710ed3877344b537cd18b01a577a8d6f Mon Sep 17 00:00:00 2001 From: Theo Satabin Date: Thu, 21 Mar 2024 11:48:12 +0100 Subject: [PATCH 5/6] =?UTF-8?q?Lecture=20et=20=C3=A9criture=20potentiellem?= =?UTF-8?q?ent=20en=20boucle=20sur=20le=20stockage=20objet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### [Added] * Stockage objet (S3, Swift et Ceph) * Possibilité de définir un nombre de tentatives pour les lectures (1 par défaut) : variable d'environnement `ROK4_OBJECT_READ_ATTEMPTS` * Possibilité de définir un nombre de tentatives pour les écritures (1 par défaut) : variable d'environnement `ROK4_OBJECT_WRITE_ATTEMPTS` * Possibilité de définir un temps d'attente, en secondes, entre les tentatives (5 par défaut) : variable d'environnement `ROK4_OBJECT_ATTEMPTS_WAIT` --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0e3e0d..e7f551d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,6 @@ curl -o styles.deb https://github.com/rok4/styles/releases/download/x.y.z/rok4-s apt install ./styles.deb ``` - ## Utiliser les outils Voici la légende utilisée pour identifié le format des images dans les documentations par commande : @@ -47,6 +46,10 @@ Voici la légende utilisée pour identifié le format des images dans les docume Leur définition est contrôlée à l'usage. +* Pour le stockage objet + - `ROK4_OBJECT_READ_ATTEMPTS` : nombre de tentatives pour les lectures + - `ROK4_OBJECT_WRITE_ATTEMPTS` : nombre de tentatives pour les écritures + - `ROK4_OBJECT_ATTEMPTS_WAIT` : temps d'attente en secondes entre les tentatives * Pour le stockage S3 - `ROK4_S3_URL` - `ROK4_S3_KEY` From 62c9d77aca47552e045c6d3da47f2e829a6bd71b Mon Sep 17 00:00:00 2001 From: Theo Satabin Date: Thu, 21 Mar 2024 15:13:35 +0100 Subject: [PATCH 6/6] =?UTF-8?q?Compl=C3=A9tion=20du=20changelog=20pour=20l?= =?UTF-8?q?a=20version=204.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fb500b..38ba5d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 4.2.0 + +### [Added] + +* Stockage objet (S3, Swift et Ceph) + * Possibilité de définir un nombre de tentatives pour les lectures (1 par défaut) : variable d'environnement `ROK4_OBJECT_READ_ATTEMPTS` + * Possibilité de définir un nombre de tentatives pour les écritures (1 par défaut) : variable d'environnement `ROK4_OBJECT_WRITE_ATTEMPTS` + * Possibilité de définir un temps d'attente, en secondes, entre les tentatives (5 par défaut) : variable d'environnement `ROK4_OBJECT_ATTEMPTS_WAIT` + ## 4.1.5 ### [Fixed]