-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.py
More file actions
124 lines (105 loc) · 4.99 KB
/
Copy pathconfig.example.py
File metadata and controls
124 lines (105 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#############################################################################
# weBIGeo Clouds
# Copyright (C) 2026 Gerald Kimmersdorfer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#############################################################################
# Copy this file to config.py and adjust the values for your deployment.
# Maximum altitude used for cloud layer normalisation (metres).
# MAX_ALTITUDE = 22500.0 # DWD ICON-D2 maximum altitude
max_altitude = 14000.0 # Sensible maximum altitude
# Path to the SQLite database file.
db_path = "data/clouds-server.db"
# Directory where generated tile sets are stored.
tileset_cache_dir = "data/tileset_cache"
# Maximum total size of the tileset cache directory. Processing is skipped when exceeded.
tilesets_max_size = 100 * 1024 * 1024 * 1024 # 100 GiB
# Host and port the server listens on.
# Use "0.0.0.0" to accept connections from any network interface.
host = "127.0.0.1"
port = 8000
# Logging level. (e.g. DEBUG, INFO, WARNING, ERROR, CRITICAL)
log_level = "DEBUG"
# NOTE: Logs for the tile creation progress are stored in the respective tile folders. The following values
# only affect the server's own console log output.
# Log file path. Set to empty string to disable file logging.
log_file = "data/latest.log"
# Log file rotation: maximum size per file in bytes and number of backup files to keep.
log_file_max_bytes = 5 * 1024 * 1024 # 5 MiB
log_file_backup_count = 3
# Per-logger level overrides. Use this to silence noisy third-party libraries
log_level_overrides = {
"waitress": "ERROR",
"filelock": "ERROR",
"urllib3": "ERROR",
"numba": "WARNING",
}
# Access key for the per-tileset worker log endpoint (/v2/{folder}/log).
# Those logs expose internal paths and hostnames, so the endpoint is disabled entirely
# unless a key is set here. Enter it via the lock button in the web dashboard.
# Generate one with: python -c "import secrets; print(secrets.token_urlsafe(32))"
log_access_token = ""
# If True, downloaded GRIB files are kept on disk after processing.
# NOTE: Use only for debug purposes. Those files are very large
keep_gribs = False
# Number of parallel workers for downloading GRIB files from DWD.
download_workers = 16
# Number of tile-set jobs that can be processed concurrently.
# NOTE: Each job depending on the step uses many threads/GPU internally, thats why in worker.py we use
# several file locks to actually serialize the work per step again. Therefore A value above 5 might not make
# a lot of sense and will probably not even affect the processing speed positively.
worker_threads = 3
# Unified scheme controlling which tile sets are fetched and which are purged.
# Rules are checked top-to-bottom
tile_retention_policy = [
{ # Remove all tiles that are older than a year
"before": -364,
"hours": [],
"mode": "purge_only"
},
{ # For tiles older than a week only keep the one at noon
"before": -7,
"hours": [12],
"mode": "purge_only"
},
{ # For tiles in the last week keep the ones with no step (the most accurate ones)
"before": 0,
"hours": [0, 3, 6, 9, 12, 15, 18, 21],
"mode": "fetch_and_purge"
},
{ # At the current day we want a different set of tiles for each hour
"before": 1,
"hours": list(range(24)),
"mode": "fetch_only"
},
{ # For the next two days (forecasts) only fetch morning, noon, evening
# NOTE: Increasing this would mean a lot of refetches each auto_build since
# its very likely that a "better" model exists for all forecast tile_sets
"before": 3,
"hours": [6, 12, 18],
"mode": "fetch_only"
},
]
# UTC times (HH:MM) at which the auto-build and archive tasks run.
# NOTE: ICON-D2 runs are every 3 hours starting at 00:00, but it takes some time until they are available
auto_build_time = ["00:30", "07:30", "16:30"]
# If True, a maintenance run (purge + auto-build) is performed immediately on startup.
run_maintenance_on_startup = True
# When True, no new tiles are fetched or generated and no old tiles are purged.
# Only tiles that already exist on disk will be served.
only_serve = False
# ntfy.sh push notifications. Set ntfy_topic to enable (pick an unguessable name).
# Install the ntfy app and subscribe to the same topic to receive push notifications.
ntfy_topic = "" # e.g. "webigeo-clouds-abc123"
ntfy_server = "https://ntfy.sh" # override for self-hosted instances