Skip to content

Commit 17c0fab

Browse files
authored
Merge pull request #90 from rok4/feature/style-handler
Ajout de la librairie de gestion d'un style ROK4
2 parents 823b07d + 6989164 commit 17c0fab

7 files changed

Lines changed: 1097 additions & 18 deletions

File tree

‎.github/labeler.yml‎

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
ci-cd:
2-
- .github/**/*
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- .github/**
35

46
dependencies:
5-
- requirements.txt
6-
- requirements/*.txt
7+
- changed-files:
8+
- any-glob-to-any-file:
9+
- requirements.txt
10+
- requirements/*.txt
711

812
documentation:
9-
- docs/**/*
13+
- changed-files:
14+
- any-glob-to-any-file:
15+
- docs/**
1016

1117
enhancement:
12-
- src/**/*
18+
- changed-files:
19+
- any-glob-to-any-file:
20+
- src/**
1321

1422
quality:
15-
- tests/**/*
23+
- changed-files:
24+
- any-glob-to-any-file:
25+
- tests/**
1626

1727
tooling:
18-
- .gitignore
19-
- .pre-commit-config.yaml
20-
- setup.cfg
21-
- pyproject.toml
28+
- changed-files:
29+
- any-glob-to-any-file:
30+
- .gitignore
31+
- .pre-commit-config.yaml
32+
- setup.cfg
33+
- pyproject.toml

‎.github/workflows/pr-auto-labeler.yml‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ name: "🏷 PR Labeler"
22
on:
33
- pull_request
44

5-
permissions:
6-
contents: read
7-
pull-requests: write
8-
95
jobs:
10-
triage:
6+
labeler:
7+
permissions:
8+
contents: read
9+
pull-requests: write
1110
runs-on: ubuntu-latest
1211
steps:
13-
- uses: actions/labeler@v5
14-
with:
15-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
12+
- uses: actions/labeler@v5

‎README.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,33 @@ except Exception as exc:
2727
print(exc)
2828
```
2929

30+
Les variables d'environnement suivantes peuvent être nécessaires, par module :
31+
32+
* `storage` : plus de détails dans la documentation technique du module
33+
* `ROK4_READING_LRU_CACHE_SIZE` : Nombre d'élément dans le cache de lecture (0 pour ne pas avoir de limite)
34+
* `ROK4_READING_LRU_CACHE_TTL` : Durée de validité d'un élément du cache, en seconde (0 pour ne pas avoir de limite)
35+
* `ROK4_CEPH_CONFFILE` : Fichier de configuration du cluster Ceph
36+
* `ROK4_CEPH_USERNAME` : Compte d'accès au cluster Ceph
37+
* `ROK4_CEPH_CLUSTERNAME` : Nom du cluster Ceph
38+
* `ROK4_S3_KEY` : Clé(s) de(s) serveur(s) S3
39+
* `ROK4_S3_SECRETKEY` : Clé(s) secrète(s) de(s) serveur(s) S3
40+
* `ROK4_S3_URL` : URL de(s) serveur(s) S3
41+
* `ROK4_SSL_NO_VERIFY` : Désactivation de la vérification SSL pour les accès S3 (n'importe quelle valeur non vide)
42+
* `tile_matrix_set` :
43+
* `ROK4_TMS_DIRECTORY` : Dossier racine (fichier ou objet) des tile matrix sets
44+
* `style` :
45+
* `ROK4_STYLES_DIRECTORY` : Dossier racine (fichier ou objet) des styles
46+
47+
Readings uses a LRU cache system with a TTL. It's possible to configure it with environment variables :
48+
- 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.
49+
- ROK4_READING_LRU_CACHE_TTL : Validity duration of cached element, in seconds. Default 300. 0 or negative integer to get cache without expiration date.
50+
51+
To disable cache (always read data on storage), set ROK4_READING_LRU_CACHE_SIZE to 1 and ROK4_READING_LRU_CACHE_TTL to 1.
52+
53+
Using CEPH storage requires environment variables :
54+
55+
Using S3 storage requires environment variables :
56+
3057
Plus d'exemple dans la documentation développeur.
3158

3259

‎README.pypi.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,21 @@ except Exception as exc:
2424
print(exc)
2525
```
2626

27+
Following environment variables could be used, by module :
28+
29+
* `storage` : more details in the module developer documentation
30+
* `ROK4_READING_LRU_CACHE_SIZE` : Cache size (0 for no limit)
31+
* `ROK4_READING_LRU_CACHE_TTL` : Cache validity time (0 for no limit)
32+
* `ROK4_CEPH_CONFFILE` : Ceph configuration file
33+
* `ROK4_CEPH_USERNAME` : Ceph cluster user
34+
* `ROK4_CEPH_CLUSTERNAME` : Ceph cluster name
35+
* `ROK4_S3_KEY` : Key(s) for S3 server(s)
36+
* `ROK4_S3_SECRETKEY` : Secret key(s) for S3 server(s)
37+
* `ROK4_S3_URL` : URL(s) for S3 server(s)
38+
* `ROK4_SSL_NO_VERIFY` : Disable SSL conrols for S3 access (any non empty value)
39+
* `tile_matrix_set` :
40+
* `ROK4_TMS_DIRECTORY` : Root directory (file or object) for tile matrix sets
41+
* `style` :
42+
* `ROK4_STYLES_DIRECTORY` : Root directory (file or object) for styles
43+
2744
More examples in the developer documentation

‎src/rok4/storage.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Provide functions to read or write data
22
33
Available storage types are :
4+
45
- S3 (path are preffixed with `s3://`)
56
- CEPH (path are prefixed with `ceph://`)
67
- FILE (path are prefixed with `file://`, but it is the default paths' interpretation)
@@ -10,17 +11,20 @@
1011
According to functions, all storage types are not necessarily available.
1112
1213
Readings uses a LRU cache system with a TTL. It's possible to configure it with environment variables :
14+
1315
- 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.
1416
- ROK4_READING_LRU_CACHE_TTL : Validity duration of cached element, in seconds. Default 300. 0 or negative integer to get cache without expiration date.
1517
1618
To disable cache (always read data on storage), set ROK4_READING_LRU_CACHE_SIZE to 1 and ROK4_READING_LRU_CACHE_TTL to 1.
1719
1820
Using CEPH storage requires environment variables :
21+
1922
- ROK4_CEPH_CONFFILE
2023
- ROK4_CEPH_USERNAME
2124
- ROK4_CEPH_CLUSTERNAME
2225
2326
Using S3 storage requires environment variables :
27+
2428
- ROK4_S3_KEY
2529
- ROK4_S3_SECRETKEY
2630
- ROK4_S3_URL

0 commit comments

Comments
 (0)