Skip to content

Commit 9fadfcd

Browse files
authored
Release 1.7.13, Merge pull request #359 from sentinel-hub/develop
Release 1.7.13
2 parents 5bc9114 + 6eb2969 commit 9fadfcd

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: end-of-file-fixer
66
- id: requirements-txt-fixer
@@ -26,7 +26,7 @@ repos:
2626
language_version: python3
2727

2828
- repo: https://github.com/charliermarsh/ruff-pre-commit
29-
rev: "v0.6.8"
29+
rev: "v0.7.2"
3030
hooks:
3131
- id: ruff
3232

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [Version 1.7.13] - 2024-11-06
2+
3+
- Improve batch download retrying in case of temporary 404 errors
4+
5+
16
## [Version 1.7.12] - 2024-09-27
27

38
- Remove `aws_profile` from storage manager schema.

eogrow/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""The main module of the eo-grow package."""
22

3-
__version__ = "1.7.12"
3+
__version__ = "1.7.13"

eogrow/pipelines/download_batch.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
def _retry_on_404(func: Callable[P, T]) -> Callable[P, T]:
5050
@wraps(func)
5151
def retrying_func(*args: P.args, **kwargs: P.kwargs) -> T:
52-
for wait_time in [0, 10, 100]:
52+
for wait_time in [0, 10, 20, 100]:
5353
time.sleep(wait_time) # if we start monitoring too soon we might hit a 404
5454
try:
5555
return func(*args, **kwargs)
@@ -178,6 +178,7 @@ def run_procedure(self) -> tuple[list[str], list[str]]:
178178
batch_request = self._create_or_collect_batch_request()
179179

180180
user_action = self._trigger_user_action(batch_request)
181+
self._wait_for_sh_db_sync(batch_request)
181182

182183
if user_action is BatchUserAction.ANALYSE or (
183184
user_action is BatchUserAction.START and batch_request.status is not BatchRequestStatus.ANALYSIS_DONE
@@ -308,6 +309,11 @@ def _trigger_user_action(self, batch_request: BatchRequest) -> BatchUserAction:
308309
LOGGER.info("Didn't trigger batch job because current batch request status is %s", status)
309310
return BatchUserAction.NONE
310311

312+
@_retry_on_404
313+
def _wait_for_sh_db_sync(self, batch_request: BatchRequest) -> None:
314+
"""Wait for SH read/write databases to sync."""
315+
self.batch_client.get_request(batch_request)
316+
311317
def cache_batch_area_manager_grid(self, request_id: str) -> None:
312318
"""This method ensures that area manager caches batch grid into the storage."""
313319
if self.area_manager.config.batch_id and self.area_manager.config.batch_id != request_id:

eogrow/utils/map.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def cogify_inplace(
6464
floats and NEAREST for integers.
6565
:param quiet: The process does not produce logs.
6666
"""
67-
temp_file = NamedTemporaryFile()
67+
temp_file = NamedTemporaryFile() # noqa: SIM115
6868
temp_file.close()
6969

7070
cogify(

eogrow/utils/pipeline_chain.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def validate_pipeline_chain(pipeline_chain: list[RawConfig]) -> None:
4040
def run_pipeline_chain(pipeline_chain: list[RawConfig]) -> None:
4141
for run_config in pipeline_chain:
4242
run_schema = PipelineRunSchema.parse_obj(run_config)
43-
runner = _pipeline_runner.options(**run_schema.pipeline_resources) # type: ignore[attr-defined]
44-
ray.get(runner.remote(run_schema.pipeline_config))
43+
runner = _pipeline_runner.options(**run_schema.pipeline_resources)
44+
ray.get(runner.remote(run_schema.pipeline_config)) # type: ignore [arg-type]
4545

4646

4747
@ray.remote(max_retries=0)

0 commit comments

Comments
 (0)