Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
default: ""
schedule:
- cron: "37 */6 * * *"


jobs:
benchmarks:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
pytest \
-vv \
--log-cli-level=INFO \
"${filter_args[@]}" \
-k '[max_ndvi]' \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REMOVE ME

--html report/report.html --self-contained-html \
--track-metrics-json=report/metrics.json \
--track-metrics-parquet-s3-bucket="apex-benchmarks" \
Expand Down
12 changes: 12 additions & 0 deletions algorithm_catalog/vito/max_ndvi/benchmark_scenarios/max_ndvi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
{
Expand All @@ -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
}
}
]
3 changes: 2 additions & 1 deletion qa/benchmarks/requirements.txt
Original file line number Diff line number Diff line change
@@ -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@127002fb6e9f4ae5aa1abc4bd7e7fa7689c002cc
ogc-api-processes-client>=0.6.0
pytest>=8.2.0
requests>=2.32.0
Expand Down
3 changes: 0 additions & 3 deletions qa/tools/apex_algorithm_qa_tools/benchmarks/openeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
29 changes: 26 additions & 3 deletions qa/tools/apex_algorithm_qa_tools/benchmarks/runners/openeo.py
Original file line number Diff line number Diff line change
@@ -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,
)
Expand All @@ -17,9 +17,10 @@
BenchmarkRunner,
BenchmarkRunnerArtifacts,
)

from apex_algorithm_qa_tools.scenarios.openeo import openEOBenchmarkScenario

_log = logging.getLogger(__name__)


class OpenEOBenchmarkRunner(BenchmarkRunner):
def __init__(self, *, scenario: openEOBenchmarkScenario, request):
Expand Down Expand Up @@ -68,4 +69,26 @@ 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,
add_original_hrefs=True,
path_templates={
# For now: use stable auto-increment based download filenames,
# as workaround for unpredictable (UUID-based) filenames in openEO results.
# Also see Open-EO/openeo-python-client#936 and eu-cdse/openeo-cdse-infra#1259
"collection": "collection-{auto_increment}{extension}",
"item": "item-{auto_increment:02d}{extension}",
"asset": "asset-{auto_increment:03d}{extension}",
"collection-asset": "collection-asset-{auto_increment}{extension}",
"generic-link": "generic-{auto_increment}{extension}",
},
)
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
Loading