diff --git a/.github/workflows/benchmarks.yaml b/.github/workflows/benchmarks.yaml index c668b85db..a9a38bcfb 100644 --- a/.github/workflows/benchmarks.yaml +++ b/.github/workflows/benchmarks.yaml @@ -10,7 +10,7 @@ on: default: "" schedule: - cron: "37 */6 * * *" - + jobs: benchmarks: @@ -54,7 +54,7 @@ jobs: pytest \ -vv \ --log-cli-level=INFO \ - "${filter_args[@]}" \ + -k '[max_ndvi]' \ --html report/report.html --self-contained-html \ --track-metrics-json=report/metrics.json \ --track-metrics-parquet-s3-bucket="apex-benchmarks" \ diff --git a/algorithm_catalog/vito/max_ndvi/benchmark_scenarios/max_ndvi.json b/algorithm_catalog/vito/max_ndvi/benchmark_scenarios/max_ndvi.json index 5a0522f70..0e3076087 100644 --- a/algorithm_catalog/vito/max_ndvi/benchmark_scenarios/max_ndvi.json +++ b/algorithm_catalog/vito/max_ndvi/benchmark_scenarios/max_ndvi.json @@ -23,9 +23,15 @@ "result": true } }, + "job_options": { + "stac-version": "1.1" + }, "reference_data": { "job-results.json": "https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22559915879!tests_test_benchmarks.py__test_run_benchmark_max_ndvi_!actual/job-results.json", "openEO.tif": "https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22559915879!tests_test_benchmarks.py__test_run_benchmark_max_ndvi_!actual/openEO.tif" + }, + "reference_options": { + "download_as_collection": true } }, { @@ -52,9 +58,15 @@ "result": true } }, + "job_options": { + "stac-version": "1.1" + }, "reference_data": { "job-results.json": "https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22671803853!tests_test_benchmarks.py__test_run_benchmark_max_ndvi_large_!actual/job-results.json", "openEO.tif": "https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22671803853!tests_test_benchmarks.py__test_run_benchmark_max_ndvi_large_!actual/openEO.tif" + }, + "reference_options": { + "download_as_collection": true } } ] diff --git a/qa/benchmarks/requirements.txt b/qa/benchmarks/requirements.txt index c786a3612..e3899e81c 100644 --- a/qa/benchmarks/requirements.txt +++ b/qa/benchmarks/requirements.txt @@ -1,6 +1,7 @@ apex-algorithm-qa-tools httpx>=0.27.0 -openeo>=0.48.0.dev +# openeo>=0.52.0 is not released yet, so install straight from github: +git+https://github.com/Open-EO/openeo-python-client.git@9e9646c45b8b31d65bd081b2b0d89bc0114fe3a7 ogc-api-processes-client>=0.6.0 pytest>=8.2.0 requests>=2.32.0 diff --git a/qa/tools/apex_algorithm_qa_tools/benchmarks/openeo.py b/qa/tools/apex_algorithm_qa_tools/benchmarks/openeo.py index 1ba48fc5c..4e535df1c 100644 --- a/qa/tools/apex_algorithm_qa_tools/benchmarks/openeo.py +++ b/qa/tools/apex_algorithm_qa_tools/benchmarks/openeo.py @@ -122,6 +122,3 @@ def _timeout_handler(signum, frame): def collect_openeo_metadata(*, job): return job.get_results() - -def download_openeo_results(*, results, actual_dir: Path): - return results.download_files(target=actual_dir, include_stac_metadata=True) diff --git a/qa/tools/apex_algorithm_qa_tools/benchmarks/runners/openeo.py b/qa/tools/apex_algorithm_qa_tools/benchmarks/runners/openeo.py index acc151a5c..146ab900b 100644 --- a/qa/tools/apex_algorithm_qa_tools/benchmarks/runners/openeo.py +++ b/qa/tools/apex_algorithm_qa_tools/benchmarks/runners/openeo.py @@ -1,12 +1,12 @@ from __future__ import annotations +import logging from pathlib import Path from apex_algorithm_qa_tools.benchmarks.openeo import ( collect_openeo_metadata, create_openeo_connection, create_openeo_job, - download_openeo_results, get_openeo_backend, run_openeo_job, ) @@ -21,6 +21,9 @@ from apex_algorithm_qa_tools.scenarios.openeo import openEOBenchmarkScenario +_log = logging.getLogger(__name__) + + class OpenEOBenchmarkRunner(BenchmarkRunner): def __init__(self, *, scenario: openEOBenchmarkScenario, request): super().__init__(scenario=scenario, request=request) @@ -68,4 +71,16 @@ def collect_artifacts(self) -> BenchmarkRunnerArtifacts: def download_actual(self, *, actual_dir: Path) -> list[Path]: if self._results is None: raise RuntimeError("Cannot download openEO results before collect_artifacts().") - return download_openeo_results(results=self._results, actual_dir=actual_dir) + + if self.scenario.reference_options.get("download_as_collection"): + _log.info(f"Downloading results from {self._job.job_id} as STAC collection") + paths = self._results.download_as_collection( + target=actual_dir, + download_derived_from=True, + # path_templates=... + ) + else: + _log.info(f"Downloading results from {self._job.job_id} the old-school way") + paths = self._results.download_files(target=actual_dir, include_stac_metadata=True) + + return paths