Skip to content

Scenario Failure: phenology #392

@github-actions

Description

@github-actions

Benchmark scenario ID: phenology
Benchmark scenario definition: https://github.com/ESA-APEx/apex_algorithms/blob/91426ff33c094b53df24495e4582d2f8937475ce/algorithm_catalog/vito/phenology/benchmark_scenarios/phenology.json
openEO backend: openeofed.dataspace.copernicus.eu

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

Test start: 2026-03-10 13:44:06.476341+00:00
Test duration: 0:08:21.162271
Test outcome: ❌ failed

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

Contact Information

Name Organization Contact
Bram Janssen VITO Contact via VITO (VITO Website, GitHub)

Process Graph

{
  "phenology1": {
    "arguments": {
      "spatial_extent": {
        "coordinates": [
          [
            [
              5.179169745059369,
              51.24984286550534
            ],
            [
              5.170016107999743,
              51.25052999567865
            ],
            [
              5.171081610725707,
              51.24861004739975
            ],
            [
              5.178604705735125,
              51.246720335821465
            ],
            [
              5.179169745059369,
              51.24984286550534
            ]
          ]
        ],
        "type": "Polygon"
      },
      "temporal_extent": [
        "2022-05-01",
        "2022-09-30"
      ]
    },
    "namespace": "https://raw.githubusercontent.com/VITObelgium/openeo_algorithm_catalog/refs/heads/main/phenology/openeo_udp/phenology.json",
    "process_id": "phenology"
  },
  "saveresult1": {
    "arguments": {
      "data": {
        "from_node": "phenology1"
      },
      "format": "GTiff",
      "options": {}
    },
    "process_id": "save_result",
    "result": true
  }
}

Error Logs

scenario = BenchmarkScenario(id='phenology', description='Computes phenology metrics based on the Phenolopy implementation on NDV...home/runner/work/apex_algorithms/apex_algorithms/algorithm_catalog/vito/phenology/benchmark_scenarios/phenology.json'))
connection_factory = <function connection_factory.<locals>.get_connection at 0x7f0374f7dda0>
tmp_path = PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0')
track_metric = <function track_metric.<locals>.track at 0x7f0374f7dee0>
track_phase = <function track_phase.<locals>.track at 0x7f0374f7e020>
upload_assets_on_fail = <function upload_assets_on_fail.<locals>.collect at 0x7f0374f7e0c0>
request = <FixtureRequest for <Function test_run_benchmark[phenology]>>

    @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_phenology_0/actual')
expected = PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/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: File set mismatch: {'job-results.json', 'openEO_2022-05-02Z.tif'} != {'job-results.json', 'openEO.tif'}
E           Issues for metadata file 'job-results.json':
E           Differing 'derived_from' links (0 common, 61 only in actual, 61 only in expected):
E             only in actual: {'S2B_MSIL2A_20220502T103619_N0510_R008_T31UFS_20240609T014539', 'S2B_MSIL2A_20220823T104619_N0510_R051_T31UFS_20240704T163824', 'S2A_MSIL2A_20220626T103641_N0510_R008_T31UFS_20240714T133851', 'S2A_MSIL2A_20220709T105041_N0510_R051_T31UFS_20240708T052543', 'S2A_MSIL2A_20220616T103631_N0510_R008_T31UFS_20240628T163751', 'S2A_MSIL2A_20220808T104631_N0510_R051_T31UFS_20240714T002454', 'S2A_MSIL2A_20220917T104711_N0510_R051_T31UFS_20240726T230442', 'S2A_MSIL2A_20220805T103631_N0510_R008_T31UFS_20240713T000709', 'S2B_MSIL2A_20220731T103629_N0510_R008_T31UFS_20240716T204002', 'S2B_MSIL2A_20220515T104619_N0510_R051_T31UFS_20240610T215024', 'S2A_MSIL2A_20220726T103631_N0510_R008_T31UFS_20240717T031142', 'S2A_MSIL2A_20220510T104621_N0510_R051_T31UFS_20240617T152023', 'S2B_MSIL2A_20220704T104629_N0510_R051_T31UFS_20240702T140539', 'S2B_MSIL2A_20220909T103629_N0510_R008_T31UFS_20240726T161307', 'S2B_MSIL2A_20220912T104629_N0510_R051_T31UFS_20240728T003727', 'S2B_MSIL2A_20220711T103629_N0510_R0...
E             only in expected: {'/eodata/Sentinel-2/MSI/L2A_N0500/2022/07/04/S2B_MSIL2A_20220704T104629_N0510_R051_T31UFS_20240702T140539.SAFE', '/eodata/Sentinel-2/MSI/L2A_N0500/2022/06/26/S2A_MSIL2A_20220626T103641_N0510_R008_T31UFS_20240714T133851.SAFE', '/eodata/Sentinel-2/MSI/L2A_N0500/2022/06/09/S2A_MSIL2A_20220609T104631_N0510_R051_T31UFS_20240619T185429.SAFE', '/eodata/Sentinel-2/MSI/L2A_N0500/2022/07/29/S2A_MSIL2A_20220729T104631_N0510_R051_T31UFS_20240718T071744.SAFE', '/eodata/Sentinel-2/MSI/L2A_N0500/2022/08/03/S2B_MSIL2A_20220803T104629_N0510_R051_T31UFS_20240712T060026.SAFE', '/eodata/Sentinel-2/MSI/L2A_N0500/2022/07/01/S2B_MSIL2A_20220701T103629_N0510_R008_T31UFS_20240702T141508.SAFE', '/eodata/Sentinel-2/MSI/L2A_N0500/2022/08/23/S2B_MSIL2A_20220823T104619_N0510_R051_T31UFS_20240704T163824.SAFE', '/eodata/Sentinel-2/MSI/L2A_N0500/2022/05/22/S2B_MSIL2A_20220522T103629_N0510_R008_T31UFS_20240613T093452.SAFE', '/eodata/Sentinel-2/MSI/L2A_N0500/2022/07/14/S2B_MSIL2A_20220714T104629_N0510_R051_T31UFS_20....

/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 'cdse-j-2603101344094af0a939841e647a717f': send 'start'
0:00:19 Job 'cdse-j-2603101344094af0a939841e647a717f': created (progress 0%)
0:00:24 Job 'cdse-j-2603101344094af0a939841e647a717f': created (progress 0%)
0:00:32 Job 'cdse-j-2603101344094af0a939841e647a717f': created (progress 0%)
0:00:40 Job 'cdse-j-2603101344094af0a939841e647a717f': created (progress 0%)
0:00:50 Job 'cdse-j-2603101344094af0a939841e647a717f': created (progress 0%)
0:01:02 Job 'cdse-j-2603101344094af0a939841e647a717f': created (progress 0%)
0:01:18 Job 'cdse-j-2603101344094af0a939841e647a717f': queued (progress 0%)
0:01:38 Job 'cdse-j-2603101344094af0a939841e647a717f': queued (progress 0%)
0:02:02 Job 'cdse-j-2603101344094af0a939841e647a717f': queued (progress 0%)
0:02:37 Job 'cdse-j-2603101344094af0a939841e647a717f': queued (progress 0%)
0:03:14 Job 'cdse-j-2603101344094af0a939841e647a717f': running (progress N/A)
0:04:02 Job 'cdse-j-2603101344094af0a939841e647a717f': running (progress N/A)
0:05:01 Job 'cdse-j-2603101344094af0a939841e647a717f': running (progress N/A)
0:06:02 Job 'cdse-j-2603101344094af0a939841e647a717f': running (progress N/A)
0:07:02 Job 'cdse-j-2603101344094af0a939841e647a717f': running (progress N/A)
0:08:06 Job 'cdse-j-2603101344094af0a939841e647a717f': finished (progress 100%)
------------------------------ Captured log call -------------------------------
INFO     conftest:conftest.py:145 Connecting to 'openeofed.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='openeofed.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_2022-05-02Z.tif' from https://s3.waw3-1.openeo.v1.dataspace.copernicus.eu/openeo-data-prod-waw4-1/batch_jobs/j-2603101344094af0a939841e647a717f/openEO_2022-05-02Z.tif?X-Proxy-Head-As-Get=true&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=306df2895e36493da11fed682eafcc94%2F20260310%2Fwaw4-1%2Fs3%2Faws4_request&X-Amz-Date=20260310T135224Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Security-Token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlX2FybiI6ImFybjpvcGVuZW93czppYW06Ojpyb2xlL29wZW5lby1kYXRhLXByb2Qtd2F3NC0xLXdvcmtzcGFjZSIsImluaXRpYWxfaXNzdWVyIjoib3BlbmVvLnByb2Qud2F3My0xLm9wZW5lby1pbnQudjEuZGF0YXNwYWNlLmNvcGVybmljdXMuZXUiLCJodHRwczovL2F3cy5hbWF6b24uY29tL3RhZ3MiOnsicHJpbmNpcGFsX3RhZ3MiOnsiam9iX2lkIjpbImotMjYwMzEwMTM0NDA5NGFmMGE5Mzk4NDFlNjQ3YTcxN2YiXSwidXNlcl9pZCI6WyI2YTc3ZmNkMS05YzA4LTQ2ZTktYjg3NS01NGZiOTk5YWIyMDAiXX0sInRyYW5zaXRpdmVfdGFnX2tleXMiOlsidXNlcl9pZCIsImpvYl9pZCJdfSwiaXNzIjoic3RzLndhdzMtMS5vcGVuZW8udjEuZGF0YXNwYWNlLmNvcGVybmljdXMuZXUiLCJzdWIiOiJvcGVuZW8tZHJpdmVyIiwiZXhwIjoxNzczMTkzOTQ0LCJuYmYiOjE3NzMxNTA3NDQsImlhdCI6MTc3MzE1MDc0NCwianRpIjoiMjJhZGFhZTAtMzhmMi00ZGM2LTlkMTItYTFhMWI2NDYwMWQzIiwiYWNjZXNzX2tleV9pZCI6IjMwNmRmMjg5NWUzNjQ5M2RhMTFmZWQ2ODJlYWZjYzk0In0.uKcprd9kBk9lYGW4SV5gvUCLiljFXBE0IuH8mD2lzqMVBWRsEBzWdX3n5mBUb2bn-rlQZUpERa69SQhmjI4mcnv_E_djZTFzqvOAhspb7xh_9Wyylu0sW4UcArdubBs7NNDE0YfDmq64rTDGmxvMNGoVQ4eWkjttDj59ePPslIzQbu0_80yZDrVi69CrwHQH8mnFuSHmfROHnk3UqeGV5sAnDPI19Zubo-VH_AKJJ9yMuTZeYTM8R3iEQhc8dLvpeibbAQ5RoQfv9mOCOhJDiJ-S4taEyn5EynJjAnaUs9ZvMMZ2ZSZdt-8MKe-vHpOrMdZTT1uWS67WELeLkBrdRQ&X-Amz-Signature=607698a99c264f33211f7b67667ce81636f26a14fb68efcf2dcbb48fc08d294d to /home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/actual/openEO_2022-05-02Z.tif
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading reference data for scenario.id='phenology' to reference_dir=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/reference'): start 2026-03-10 13:52:25.976766
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22018234335!tests_test_benchmarks.py__test_run_benchmark_phenology_!actual/openEO_2022-05-02Z.tif' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/reference/openEO.tif'): start 2026-03-10 13:52:25.977055
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22018234335!tests_test_benchmarks.py__test_run_benchmark_phenology_!actual/openEO_2022-05-02Z.tif' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/reference/openEO.tif'): end 2026-03-10 13:52:27.009386, elapsed 0:00:01.032331
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22018234335!tests_test_benchmarks.py__test_run_benchmark_phenology_!actual/job-results.json' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/reference/job-results.json'): start 2026-03-10 13:52:27.009804
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-22018234335!tests_test_benchmarks.py__test_run_benchmark_phenology_!actual/job-results.json' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/reference/job-results.json'): end 2026-03-10 13:52:27.635705, elapsed 0:00:00.625901
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading reference data for scenario.id='phenology' to reference_dir=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/reference'): end 2026-03-10 13:52:27.635886, elapsed 0:00:01.659120
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_phenology_0/actual') vs PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_phenology_0/reference')

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