Skip to content

Commit

Permalink
Issue #1066 disable EJR health check in batch jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Feb 24, 2025
1 parent 93bd40c commit 8eedf2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ without compromising stable operations.

- `load_stac`: improve STAC requests resilience ([#818](https://github.com/Open-EO/openeo-geopyspark-driver/issues/818))
- Extract demo CWL content to package resources ([#1057](https://github.com/Open-EO/openeo-geopyspark-driver/issues/1057))
- Disable EJR health check from batch job context ([#1066](https://github.com/Open-EO/openeo-geopyspark-driver/issues/1066))

## 0.61.0

Expand Down
9 changes: 7 additions & 2 deletions openeogeotrellis/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def __init__(
batch_job_output_root: Optional[Path] = None,
use_job_registry: bool = True,
elastic_job_registry: Optional[ElasticJobRegistry] = None,
do_ejr_health_check: bool = True,
):
self._service_registry = (
# TODO #283 #285: eliminate is_ci_context, use some kind of config structure
Expand Down Expand Up @@ -352,7 +353,9 @@ def __init__(
if use_job_registry and not elastic_job_registry:
# TODO #236/#498 avoid this fallback and just make sure it is always set when necessary
logger.warning("No elastic_job_registry given to GeoPySparkBackendImplementation, creating one")
elastic_job_registry = get_elastic_job_registry(requests_session=requests_session)
elastic_job_registry = get_elastic_job_registry(
requests_session=requests_session, do_health_check=do_ejr_health_check
)

super().__init__(
catalog=catalog,
Expand Down Expand Up @@ -1298,6 +1301,7 @@ def run_udf(self, udf: str, data: openeo.udf.UdfData) -> openeo.udf.UdfData:

def get_elastic_job_registry(
requests_session: Optional[requests.Session] = None,
do_health_check: bool = True,
) -> ElasticJobRegistry:
"""Build ElasticJobRegistry instance from config"""
config = get_backend_config()
Expand All @@ -1317,7 +1321,8 @@ def get_elastic_job_registry(
# Fail harder
ejr_creds = get_ejr_credentials_from_env(strict=True)
job_registry.setup_auth_oidc_client_credentials(credentials=ejr_creds)
job_registry.health_check(log=True)
if do_health_check:
job_registry.health_check(log=True)
return job_registry


Expand Down
1 change: 1 addition & 0 deletions openeogeotrellis/deploy/batch_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def run_job(

backend_implementation = GeoPySparkBackendImplementation(
use_job_registry=bool(get_backend_config().ejr_api),
do_ejr_health_check=False,
)

if default_sentinel_hub_credentials is not None:
Expand Down

0 comments on commit 8eedf2b

Please sign in to comment.