Skip to content

Commit

Permalink
* Ajout de la librairie de gestion d'un style ROK4
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolite committed Sep 30, 2024
1 parent 823b07d commit f3c8910
Show file tree
Hide file tree
Showing 7 changed files with 1,076 additions and 19 deletions.
32 changes: 22 additions & 10 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
ci-cd:
- .github/**/*
- changed-files:
- any-glob-to-any-file:
- .github/**

dependencies:
- requirements.txt
- requirements/*.txt
- changed-files:
- any-glob-to-any-file:
- requirements.txt
- requirements/*.txt

documentation:
- docs/**/*
- changed-files:
- any-glob-to-any-file:
- docs/**

enhancement:
- src/**/*
- changed-files:
- any-glob-to-any-file:
- src/**

quality:
- tests/**/*
- changed-files:
- any-glob-to-any-file:
- tests/**

tooling:
- .gitignore
- .pre-commit-config.yaml
- setup.cfg
- pyproject.toml
- changed-files:
- any-glob-to-any-file:
- .gitignore
- .pre-commit-config.yaml
- setup.cfg
- pyproject.toml
15 changes: 6 additions & 9 deletions .github/workflows/pr-auto-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: "🏷 PR Labeler"
on:
- pull_request

permissions:
contents: read
pull-requests: write
- pull_request_target

jobs:
triage:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/labeler@v5
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,33 @@ except Exception as exc:
print(exc)
```

Les variables d'environnement suivantes peuvent être nécessaires, par module :

* `storage` : plus de détails dans la documentation technique du module
* `ROK4_READING_LRU_CACHE_SIZE` : Nombre d'élément dans le cache de lecture (0 pour ne pas avoir de limite)
* `ROK4_READING_LRU_CACHE_TTL` : Durée de validité d'un élément du cache, en seconde (0 pour ne pas avoir de limite)
* `ROK4_CEPH_CONFFILE` : Fichier de configuration du cluster Ceph
* `ROK4_CEPH_USERNAME` : Compte d'accès au cluster Ceph
* `ROK4_CEPH_CLUSTERNAME` : Nom du cluster Ceph
* `ROK4_S3_KEY` : Clé(s) de(s) serveur(s) S3
* `ROK4_S3_SECRETKEY` : Clé(s) secrète(s) de(s) serveur(s) S3
* `ROK4_S3_URL` : URL de(s) serveur(s) S3
* `ROK4_SSL_NO_VERIFY` : Désactivation de la vérification SSL pour les accès S3 (n'importe quelle valeur non vide)
* `tile_matrix_set` :
* `ROK4_TMS_DIRECTORY` : Dossier racine (fichier ou objet) des tile matrix sets
* `style` :
* `ROK4_STYLES_DIRECTORY` : Dossier racine (fichier ou objet) des styles

Readings uses a LRU cache system with a TTL. It's possible to configure it with environment variables :
- ROK4_READING_LRU_CACHE_SIZE : Number of cached element. Default 64. Set 0 or a negative integer to configure a cache without bound. A power of two make cache more efficient.
- ROK4_READING_LRU_CACHE_TTL : Validity duration of cached element, in seconds. Default 300. 0 or negative integer to get cache without expiration date.

To disable cache (always read data on storage), set ROK4_READING_LRU_CACHE_SIZE to 1 and ROK4_READING_LRU_CACHE_TTL to 1.

Using CEPH storage requires environment variables :

Using S3 storage requires environment variables :

Plus d'exemple dans la documentation développeur.


Expand Down
17 changes: 17 additions & 0 deletions README.pypi.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,21 @@ except Exception as exc:
print(exc)
```

Following environment variables could be used, by module :

* `storage` : more details in the module developer documentation
* `ROK4_READING_LRU_CACHE_SIZE` : Cache size (0 for no limit)
* `ROK4_READING_LRU_CACHE_TTL` : Cache validity time (0 for no limit)
* `ROK4_CEPH_CONFFILE` : Ceph configuration file
* `ROK4_CEPH_USERNAME` : Ceph cluster user
* `ROK4_CEPH_CLUSTERNAME` : Ceph cluster name
* `ROK4_S3_KEY` : Key(s) for S3 server(s)
* `ROK4_S3_SECRETKEY` : Secret key(s) for S3 server(s)
* `ROK4_S3_URL` : URL(s) for S3 server(s)
* `ROK4_SSL_NO_VERIFY` : Disable SSL conrols for S3 access (any non empty value)
* `tile_matrix_set` :
* `ROK4_TMS_DIRECTORY` : Root directory (file or object) for tile matrix sets
* `style` :
* `ROK4_STYLES_DIRECTORY` : Root directory (file or object) for styles

More examples in the developer documentation
4 changes: 4 additions & 0 deletions src/rok4/storage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Provide functions to read or write data
Available storage types are :
- S3 (path are preffixed with `s3://`)
- CEPH (path are prefixed with `ceph://`)
- FILE (path are prefixed with `file://`, but it is the default paths' interpretation)
Expand All @@ -10,17 +11,20 @@
According to functions, all storage types are not necessarily available.
Readings uses a LRU cache system with a TTL. It's possible to configure it with environment variables :
- ROK4_READING_LRU_CACHE_SIZE : Number of cached element. Default 64. Set 0 or a negative integer to configure a cache without bound. A power of two make cache more efficient.
- ROK4_READING_LRU_CACHE_TTL : Validity duration of cached element, in seconds. Default 300. 0 or negative integer to get cache without expiration date.
To disable cache (always read data on storage), set ROK4_READING_LRU_CACHE_SIZE to 1 and ROK4_READING_LRU_CACHE_TTL to 1.
Using CEPH storage requires environment variables :
- ROK4_CEPH_CONFFILE
- ROK4_CEPH_USERNAME
- ROK4_CEPH_CLUSTERNAME
Using S3 storage requires environment variables :
- ROK4_S3_KEY
- ROK4_S3_SECRETKEY
- ROK4_S3_URL
Expand Down
Loading

0 comments on commit f3c8910

Please sign in to comment.