forked from venetoarpa/Arpav-PPCV-backend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update observations data periodically (#196)
* Adding tests for coverage time series endpoint * Adding tests for coverage time series endpoint * fix failing ncss query * Added missing geometry to sample station in tests * Compiling translations before running tests in CI * Refactor station harvesting code * Adding prefect * Tweaking prefect setup so that it works in the stack * Added prefect flows for ingesting observations data * Removed prefect profiles configuration This is no longer needed thanks to prefect 3rc17 * Improved prefect flows with artifacts * Set default value for nearby stations to 200m fixes #161 * Added HTTP basic auth to protect access to prefect * Removed unused code * Add tests * Change name of env variable that points to usersfile * Added info to README.md
- Loading branch information
1 parent
a2bce54
commit 3be86be
Showing
18 changed files
with
2,255 additions
and
647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,25 @@ class ContactSettings(pydantic.BaseModel): | |
email: str = "[email protected]" | ||
|
||
|
||
class PrefectSettings(pydantic.BaseModel): | ||
num_flow_retries: int = 5 | ||
flow_retry_delay_seconds: int = 5 | ||
num_task_retries: int = 5 | ||
task_retry_delay_seconds: int = 5 | ||
observation_stations_refresher_flow_cron_schedule: str = ( | ||
"0 1 * * 1" # run once every week, at 01:00 on monday | ||
) | ||
observation_monthly_measurements_refresher_flow_cron_schedule: str = ( | ||
"0 2 * * 1" # run once every week, at 02:00 on monday | ||
) | ||
observation_seasonal_measurements_refresher_flow_cron_schedule: str = ( | ||
"0 3 * * 1" # run once every week, at 03:00 on monday | ||
) | ||
observation_yearly_measurements_refresher_flow_cron_schedule: str = ( | ||
"0 4 * * 1" # run once every week, at 04:00 on monday | ||
) | ||
|
||
|
||
class ThreddsServerSettings(pydantic.BaseModel): | ||
base_url: str = "http://localhost:8080/thredds" | ||
wms_service_url_fragment: str = "wms" | ||
|
@@ -74,8 +93,9 @@ class ArpavPpcvSettings(BaseSettings): # noqa | |
templates_dir: Optional[Path] = Path(__file__).parent / "webapp/templates" | ||
static_dir: Optional[Path] = Path(__file__).parent / "webapp/static" | ||
thredds_server: ThreddsServerSettings = ThreddsServerSettings() | ||
prefect: PrefectSettings = PrefectSettings() | ||
martin_tile_server_base_url: str = "http://localhost:3000" | ||
nearest_station_radius_meters: int = 10_000 | ||
nearest_station_radius_meters: int = 200 | ||
v2_api_mount_prefix: str = "/api/v2" | ||
log_config_file: Path | None = None | ||
session_secret_key: str = "changeme" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.