Skip to content

Scenario Failure: world_agrocommodities #384

@github-actions

Description

@github-actions

Benchmark scenario ID: world_agrocommodities
Benchmark scenario definition: https://github.com/ESA-APEx/apex_algorithms/blob/a4d58a18b69cf4c81512047b01e3f3e7581b54dc/algorithm_catalog/wur/worldagrocommodities/benchmark_scenarios/world_agrocommodities.json
openEO backend: openeo.dataspace.copernicus.eu

GitHub Actions workflow run: https://github.com/ESA-APEx/apex_algorithms/actions/runs/22790705443
Workflow artifacts: https://github.com/ESA-APEx/apex_algorithms/actions/runs/22790705443#artifacts

Test start: 2026-03-07 03:03:58.625914+00:00
Test duration: 0:04:04.463789
Test outcome: ❌ failed

Last successful test phase: download-reference
Failure in test phase: compare:derived_from-change

Contact Information

Name Organization Contact
Hans Vanrompay VITO Contact via VITO (VITO Website)

Process Graph

{
  "worldagrocommodities1": {
    "process_id": "world_agrocommodities",
    "namespace": "https://raw.githubusercontent.com/masolele/WAC/refs/tags/inference_udp_v0.0.2/src/world_agrocommodities/udp/world_agrocommodities.json",
    "arguments": {
      "spatial_extent": {
        "west": 817475.0741295104,
        "south": -522776.47462956805,
        "east": 817838.336850123,
        "north": -522493.8634415434,
        "crs": "EPSG:32634"
      },
      "temporal_extent": [
        "2025-01-01",
        "2025-12-31"
      ],
      "crs": "EPSG:32634",
      "model_id": "WorldAgriCommodities_Africa_v1"
    },
    "result": true
  }
}

Error Logs

scenario = BenchmarkScenario(id='world_agrocommodities', description='openEO pipeline for agricultural feature extraction and mod...algorithms/apex_algorithms/algorithm_catalog/wur/worldagrocommodities/benchmark_scenarios/world_agrocommodities.json'))
connection_factory = <function connection_factory.<locals>.get_connection at 0x7fcf7efc5da0>
tmp_path = PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0')
track_metric = <function track_metric.<locals>.track at 0x7fcf7efc5ee0>
track_phase = <function track_phase.<locals>.track at 0x7fcf7efc6020>
upload_assets_on_fail = <function upload_assets_on_fail.<locals>.collect at 0x7fcf7efc60c0>
request = <FixtureRequest for <Function test_run_benchmark[world_agrocommodities]>>

    @pytest.mark.parametrize(
        "scenario",
        [
            # Use scenario id as parameterization id to give nicer test names.
            pytest.param(uc, id=uc.id)
            for uc in get_benchmark_scenarios()
        ],
    )
    def test_run_benchmark(
        scenario: BenchmarkScenario,
        connection_factory,
        tmp_path: Path,
        track_metric,
        track_phase,
        upload_assets_on_fail,
        request,
    ):
        track_metric("scenario_id", scenario.id)

        with track_phase(phase="connect"):
            # Check if a backend override has been provided via cli options.
            override_backend = request.config.getoption("--override-backend")
            backend_filter = request.config.getoption("--backend-filter")
            if backend_filter and not re.match(backend_filter, scenario.backend):
                # TODO apply filter during scenario retrieval, but seems to be hard to retrieve cli param
                pytest.skip(
                    f"skipping scenario {scenario.id} because backend {scenario.backend} does not match filter {backend_filter!r}"
                )
            backend = scenario.backend
            if override_backend:
                _log.info(f"Overriding backend URL with {override_backend!r}")
                backend = override_backend

            connection: openeo.Connection = connection_factory(url=backend)

        report_path = None

        with track_phase(phase="create-job"):
            # TODO #14 scenario option to use synchronous instead of batch job mode?
            job = connection.create_job(
                process_graph=scenario.process_graph,
                title=f"APEx benchmark {scenario.id}",
                additional=scenario.job_options,
            )
            track_metric("job_id", job.job_id)

            if request.config.getoption("--upload-benchmark-report"):
                report_path = tmp_path / "benchmark_report.json"
                report_path.write_text(json.dumps({
                    "job_id": job.job_id,
                    "scenario_id": scenario.id,
                    "scenario_description": scenario.description,
                    "scenario_backend": scenario.backend,
                    "scenario_source": str(scenario.source) if scenario.source else None,
                    "reference_data": scenario.reference_data,
                    "reference_options": scenario.reference_options,
                }, indent=2))
                upload_assets_on_fail(report_path)

        with track_phase(phase="run-job"):
            # TODO: monitor timing and progress
            # TODO: separate "job started" and run phases?
            max_minutes = request.config.getoption("--maximum-job-time-in-minutes")
            if max_minutes:
                def _timeout_handler(signum, frame):
                    raise TimeoutError(
                        f"Batch job {job.job_id} exceeded maximum allowed time of {max_minutes} minutes"
                    )

                old_handler = signal.signal(signal.SIGALRM, _timeout_handler)
                signal.alarm(max_minutes * 60)
            try:
                job.start_and_wait()
            finally:
                if max_minutes:
                    signal.alarm(0)
                    signal.signal(signal.SIGALRM, old_handler)

        with track_phase(phase="collect-metadata"):
            collect_metrics_from_job_metadata(job, track_metric=track_metric)

            results = job.get_results()
            collect_metrics_from_results_metadata(results, track_metric=track_metric)

        with track_phase(phase="download-actual"):
            # Download actual results
            actual_dir = tmp_path / "actual"
            paths = results.download_files(target=actual_dir, include_stac_metadata=True)

            # Upload assets on failure
            upload_assets_on_fail(*paths)

        with track_phase(phase="download-reference"):
            reference_dir = download_reference_data(
                scenario=scenario, reference_dir=tmp_path / "reference"
            )

        if report_path is not None:
            report = json.loads(report_path.read_text())
            report["actual_files"] = {
                str(p.relative_to(actual_dir)): f"{p.stat().st_size / 1024:.1f} kb"
                for p in sorted(actual_dir.rglob("*")) if p.is_file()
            }
            ref_files = {}
            for p in sorted(reference_dir.rglob("*")):
                if not p.is_file():
                    continue
                rel = p.relative_to(reference_dir)
                size_str = f"{p.stat().st_size / 1024:.1f} kb"
                actual_counterpart = actual_dir / rel
                if not actual_counterpart.exists():
                    size_str += " (missing in actual)"
                elif actual_counterpart.stat().st_size != p.stat().st_size:
                    size_str += f" (actual: {actual_counterpart.stat().st_size / 1024:.1f} kb)"
                ref_files[str(rel)] = size_str
            report["reference_files"] = ref_files
            report_path.write_text(json.dumps(report, indent=2))

        with track_phase(
            phase="compare", describe_exception=analyse_results_comparison_exception
        ):
            # Compare actual results with reference data
>           assert_job_results_allclose(
                actual=actual_dir,
                expected=reference_dir,
                tmp_path=tmp_path,
                rtol=scenario.reference_options.get("rtol", 1e-3),
                atol=scenario.reference_options.get("atol", 1),
                pixel_tolerance=scenario.reference_options.get("pixel_tolerance", 1),
            )

tests/test_benchmarks.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

actual = PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/actual')
expected = PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/reference')

    def assert_job_results_allclose(
        actual: Union[BatchJob, JobResults, str, Path],
        expected: Union[BatchJob, JobResults, str, Path],
        *,
        rtol: float = _DEFAULT_RTOL,
        atol: float = _DEFAULT_ATOL,
        pixel_tolerance: float = _DEFAULT_PIXELTOL,
        tmp_path: Optional[Path] = None,
    ):
        """
        Assert that two job results sets are equal (with tolerance).

        :param actual: actual job results, provided as :py:class:`~openeo.rest.job.BatchJob` object,
            :py:meth:`~openeo.rest.job.JobResults` object or path to directory with downloaded assets.
        :param expected: expected job results, provided as :py:class:`~openeo.rest.job.BatchJob` object,
            :py:meth:`~openeo.rest.job.JobResults` object or path to directory with downloaded assets.
        :param rtol: relative tolerance
        :param atol: absolute tolerance
        :param pixel_tolerance: maximum fraction of pixels (in percent)
            that is allowed to be significantly different (considering ``atol`` and ``rtol``)
        :param tmp_path: root temp path to download results if needed.
            It's recommended to pass pytest's `tmp_path` fixture here
        :raises AssertionError: if not equal within the given tolerance

        .. versionadded:: 0.31.0

        .. warning::
            This function is experimental and subject to change.
        """
        issues = _compare_job_results(
            actual, expected, rtol=rtol, atol=atol, pixel_tolerance=pixel_tolerance, tmp_path=tmp_path
        )
        if issues:
>           raise AssertionError("\n".join(issues))
E           AssertionError: Issues for file 'openEO.nc':
E           Issues for variable 'ARGMAX':
E           Fraction significantly differing pixels: 1.5843429636533086% > 1%
E           ARGMAX: t 2025-01-01T00:00:00.000000000: value difference exceeds tolerance (rtol 0.001, atol 1), min:2.0, max: 7.0, mean: 6.71, var: 1.38
E           ARGMAX: t 2025-01-01T00:00:00.000000000: differing pixels: 17/1073 (1.6%), bbox ((817795.0, -522645.0), (817835.0, -522585.0)) - 2.4% of the area
E           Issues for metadata file 'job-results.json':
E           Differing 'derived_from' links (55 common, 2 only in actual, 0 only in expected):
E             only in actual: {'Sentinel-1_IW_mosaic_2025_M12_34MHV_0_0', 'Sentinel-1_IW_mosaic_2025_M10_34MHV_0_0'}
E             only in expected: set().

/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/openeo/testing/results.py:521: AssertionError
----------------------------- Captured stdout call -----------------------------
0:00:00 Job 'j-2603070304014183adb0fc4f4493a044': send 'start'
0:00:13 Job 'j-2603070304014183adb0fc4f4493a044': queued (progress 0%)
0:00:19 Job 'j-2603070304014183adb0fc4f4493a044': queued (progress 0%)
0:00:25 Job 'j-2603070304014183adb0fc4f4493a044': queued (progress 0%)
0:00:33 Job 'j-2603070304014183adb0fc4f4493a044': queued (progress 0%)
0:00:43 Job 'j-2603070304014183adb0fc4f4493a044': queued (progress 0%)
0:00:56 Job 'j-2603070304014183adb0fc4f4493a044': queued (progress 0%)
0:01:11 Job 'j-2603070304014183adb0fc4f4493a044': running (progress N/A)
0:01:31 Job 'j-2603070304014183adb0fc4f4493a044': running (progress N/A)
0:01:55 Job 'j-2603070304014183adb0fc4f4493a044': running (progress N/A)
0:02:25 Job 'j-2603070304014183adb0fc4f4493a044': running (progress N/A)
0:03:07 Job 'j-2603070304014183adb0fc4f4493a044': running (progress N/A)
0:03:54 Job 'j-2603070304014183adb0fc4f4493a044': finished (progress 100%)
------------------------------ Captured log call -------------------------------
INFO     conftest:conftest.py:145 Connecting to 'openeo.dataspace.copernicus.eu'
INFO     openeo.config:config.py:193 Loaded openEO client config from sources: []
INFO     conftest:conftest.py:158 Checking for auth_env_var='OPENEO_AUTH_CLIENT_CREDENTIALS_CDSEFED' to drive auth against url='openeo.dataspace.copernicus.eu'.
INFO     conftest:conftest.py:162 Extracted provider_id='CDSE' client_id='openeo-apex-benchmarks-service-account' from auth_env_var='OPENEO_AUTH_CLIENT_CREDENTIALS_CDSEFED'
INFO     openeo.rest.connection:connection.py:302 Found OIDC providers: ['CDSE']
INFO     openeo.rest.auth.oidc:oidc.py:404 Doing 'client_credentials' token request 'https://identity.dataspace.copernicus.eu/auth/realms/CDSE/protocol/openid-connect/token' with post data fields ['grant_type', 'client_id', 'client_secret', 'scope'] (client_id 'openeo-apex-benchmarks-service-account')
INFO     openeo.rest.connection:connection.py:401 Obtained tokens: ['access_token', 'id_token']
INFO     openeo.rest.job:job.py:436 Downloading Job result asset 'openEO.nc' from https://s3.waw3-1.openeo.v1.dataspace.copernicus.eu/openeo-data-prod-waw4-1/batch_jobs/j-2603070304014183adb0fc4f4493a044/openEO.nc?X-Proxy-Head-As-Get=true&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=29d6de4b1bf9433cbad301b838e5cc8b%2F20260307%2Fwaw4-1%2Fs3%2Faws4_request&X-Amz-Date=20260307T030757Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Security-Token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlX2FybiI6ImFybjpvcGVuZW93czppYW06Ojpyb2xlL29wZW5lby1kYXRhLXByb2Qtd2F3NC0xLXdvcmtzcGFjZSIsImluaXRpYWxfaXNzdWVyIjoib3BlbmVvLnByb2Qud2F3My0xLm9wZW5lby1pbnQudjEuZGF0YXNwYWNlLmNvcGVybmljdXMuZXUiLCJodHRwczovL2F3cy5hbWF6b24uY29tL3RhZ3MiOnsicHJpbmNpcGFsX3RhZ3MiOnsiam9iX2lkIjpbImotMjYwMzA3MDMwNDAxNDE4M2FkYjBmYzRmNDQ5M2EwNDQiXSwidXNlcl9pZCI6WyI2YTc3ZmNkMS05YzA4LTQ2ZTktYjg3NS01NGZiOTk5YWIyMDAiXX0sInRyYW5zaXRpdmVfdGFnX2tleXMiOlsidXNlcl9pZCIsImpvYl9pZCJdfSwiaXNzIjoic3RzLndhdzMtMS5vcGVuZW8udjEuZGF0YXNwYWNlLmNvcGVybmljdXMuZXUiLCJzdWIiOiJvcGVuZW8tZHJpdmVyIiwiZXhwIjoxNzcyODk2MDc3LCJuYmYiOjE3NzI4NTI4NzcsImlhdCI6MTc3Mjg1Mjg3NywianRpIjoiNmMxMTVlZjUtMDhlMS00NDFiLTg3ZTItMWUwZjQ1Yjc1MmIyIiwiYWNjZXNzX2tleV9pZCI6IjI5ZDZkZTRiMWJmOTQzM2NiYWQzMDFiODM4ZTVjYzhiIn0.nLLgOaE0YxnYzdHR_6upERxVY2YHB3DJl8ydOcT8isnEltr_FGro4DlJIBEbPzLuvePMHVguVoAORSadv6KkFuAqA3qCr13Q9GAHkRZq585fPnO5VkS0sdKDLMydrtIPNk1u5ZPNzU6Io4PvporSLRbyw2WKIfwgyNHIeY18oDSsyaDrMZsNmDm3A3CJ0F6rmvOSxTWifZ3odFabfdIgpbcVU9MtlE4MePPoLO6GtBLLe8jdPIkNWnInkUoPtQglzU6tqxqR6T6Uf5TwLrgCRbGbq7KnbOCwoPUUSK8pQveKjhtZiHmkMinrDBfGJJL5IuJZ6NcNRUv-X4YuXkUWlw&X-Amz-Signature=d789452ea19cdf4cf019aac13cb493f1d3a670ca23e206508d75b958ffbb0171 to /home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/actual/openEO.nc
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading reference data for scenario.id='world_agrocommodities' to reference_dir=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/reference'): start 2026-03-07 03:08:00.939471
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22720678447!tests_test_benchmarks.py__test_run_benchmark_world_agrocommodities_!actual/job-results.json' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/reference/job-results.json'): start 2026-03-07 03:08:00.939792
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22720678447!tests_test_benchmarks.py__test_run_benchmark_world_agrocommodities_!actual/job-results.json' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/reference/job-results.json'): end 2026-03-07 03:08:01.721569, elapsed 0:00:00.781777
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22720678447!tests_test_benchmarks.py__test_run_benchmark_world_agrocommodities_!actual/openEO.nc' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/reference/openEO.nc'): start 2026-03-07 03:08:01.721914
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22720678447!tests_test_benchmarks.py__test_run_benchmark_world_agrocommodities_!actual/openEO.nc' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/reference/openEO.nc'): end 2026-03-07 03:08:02.652632, elapsed 0:00:00.930718
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading reference data for scenario.id='world_agrocommodities' to reference_dir=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/reference'): end 2026-03-07 03:08:02.652796, elapsed 0:00:01.713325
INFO     openeo.testing.results:results.py:422 Comparing job results: PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/actual') vs PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_world_agroc0/reference')
WARNING  openeo.testing.results:results.py:171 Difference (ascii art) for ARGMAX: t 2025-01-01T00:00:00.000000000:
┌─────────────────────────────────────┐
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                 $$$?│
│                                $$ $$│
│                                $    │
│                                $$   │
│                                $$   │
│                                 $$  │
│                                   $$│
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
│                                     │
└─────────────────────────────────────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions