Skip to content

Benchmark: sentinel1_changedetection #475

@github-actions

Description

@github-actions

Benchmark scenario ID: sentinel1_changedetection
Benchmark scenario definition: https://github.com/ESA-APEx/apex_algorithms/blob/9fe9397b8f7afe69b3b7227b6391238ff3895914/algorithm_catalog/gisat/sentinel1_changedetection/benchmark_scenarios/sentinel1_changedetection.json
openEO backend: openeo.dataspace.copernicus.eu

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

Test start: 2026-04-22 03:49:32.515512+00:00
Test duration: 0:05:19.389671
Test outcome: ❌ failed

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

Contact Information

Name Organization Contact
Sivasankar Arul Gisat s.r.o. Contact via Gisat (GISAT Website, GitHub)

Process Graph

{
  "s1stats1": {
    "process_id": "sentinel1_mcd",
    "namespace": "https://raw.githubusercontent.com/ESA-APEx/apex_algorithms/refs/heads/main/algorithm_catalog/gisat/sentinel1_changedetection/openeo_udp/sentinel1_changedetection.json",
    "arguments": {
      "spatial_extent": {
        "east": -54.59,
        "north": -12.08,
        "south": -12.26,
        "west": -54.81
      },
      "temporal_extent": [
        "2020-03-11",
        "2020-03-23"
      ]
    },
    "result": true
  }
}

Error Logs

scenario = BenchmarkScenario(id='sentinel1_changedetection', description='Sentinel 1 change detection example', backend='openeo.d...apex_algorithms/algorithm_catalog/gisat/sentinel1_changedetection/benchmark_scenarios/sentinel1_changedetection.json'))
connection_factory = <function connection_factory.<locals>.get_connection at 0x7fc732b52840>
tmp_path = PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0')
track_metric = <function track_metric.<locals>.track at 0x7fc732b52980>
track_phase = <apex_algorithm_qa_tools.pytest.pytest_track_metrics._PhaseTracker object at 0x7fc732b55c40>
upload_assets_on_fail = <apex_algorithm_qa_tools.pytest.pytest_upload_assets.upload_assets_on_fail.<locals>._Collector object at 0x7fc732b78290>
request = <FixtureRequest for <Function test_run_benchmark[sentinel1_changedetection]>>

    @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
        if request.config.getoption("--upload-benchmark-report"):
            report_path = tmp_path / "benchmark_report.json"
            report_path.write_text(json.dumps({
                "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)

        def _on_phase_exception(phase: str, exc: Exception):
            if report_path is not None:
                report = json.loads(report_path.read_text())
                report["test_failed"] = True
                report["test_failed_phase"] = phase
                report["test_error_message"] = str(exc)
                report_path.write_text(json.dumps(report, indent=2))
                cwd_report_dir = Path("benchmark_reports")
                cwd_report_dir.mkdir(exist_ok=True)
                (cwd_report_dir / f"{scenario.id}_benchmark_report.json").write_text(
                    json.dumps(report, indent=2)
                )
                report_url = upload_assets_on_fail.get_url(report_path)
                if report_url:
                    exc.add_note(f"Benchmark report: {report_url}")

        track_phase.on_exception = _on_phase_exception

        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 report_path is not None:
                report = json.loads(report_path.read_text())
                report["job_id"] = job.job_id
                report_path.write_text(json.dumps(report, indent=2))

        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)

        # Pre-compute S3 URLs for actual files (used in error messages and benchmark reports)
        actual_s3_urls = {
            str(p.relative_to(actual_dir)): upload_assets_on_fail.get_url(p)
            for p in sorted(actual_dir.rglob("*")) if p.is_file()
        }
        actual_s3_urls = {k: v for k, v in actual_s3_urls.items() if v is not None}

        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
            if actual_s3_urls:
                report["actual_data"] = actual_s3_urls
            report_path.write_text(json.dumps(report, indent=2))
            # Also write to CWD so the report is accessible on Jenkins workspace
            cwd_report_dir = Path("benchmark_reports")
            cwd_report_dir.mkdir(exist_ok=True)
            (cwd_report_dir / f"{scenario.id}_benchmark_report.json").write_text(
                json.dumps(report, indent=2)
            )

        with track_phase(
            phase="compare", describe_exception=analyse_results_comparison_exception
        ):
            # Compare actual results with reference data
            try:
>               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:183:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/openeo/testing/results.py:532: in assert_job_results_allclose
    issues = _compare_job_results(
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/openeo/testing/results.py:438: in _compare_job_results
    issues = _compare_job_result_metadata(actual=actual_path, expected=expected_path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/openeo/testing/results.py:478: in _compare_job_result_metadata
    expected_metadata = _load_json(expected)
                        ^^^^^^^^^^^^^^^^^^^^
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/openeo/testing/results.py:68: in _load_json
    return json.load(f)
           ^^^^^^^^^^^^
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/json/__init__.py:293: in load
    return loads(fp.read(),
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/json/__init__.py:346: in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/json/decoder.py:338: in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fc7925b3f20>
s = '<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><Message></Message><BucketName>apex-benchmarks</Bu...stId>tx00000d4fa7dcf3eccf76e-0069e8468b-2d6f038c1-default</RequestId><HostId>2d6f038c1-default-waw3-1</HostId></Error>'
idx = 0

    def raw_decode(self, s, idx=0):
        """Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.

        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.

        """
        try:
            obj, end = self.scan_once(s, idx)
        except StopIteration as err:
>           raise JSONDecodeError("Expecting value", s, err.value) from None
E           json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/json/decoder.py:356: JSONDecodeError
----------------------------- Captured stdout call -----------------------------
0:00:00 Job 'j-2604220349364c5a8240bc7bfbf84739': send 'start'
0:00:34 Job 'j-2604220349364c5a8240bc7bfbf84739': created (progress 0%)
0:00:39 Job 'j-2604220349364c5a8240bc7bfbf84739': created (progress 0%)
0:00:46 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:00:54 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:01:04 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:01:16 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:01:32 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:01:51 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:02:15 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:02:45 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:03:23 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:04:10 Job 'j-2604220349364c5a8240bc7bfbf84739': running (progress N/A)
0:05:08 Job 'j-2604220349364c5a8240bc7bfbf84739': 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:410 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: ['token_type', 'access_token', 'expires_in', 'id_token', 'scope']
INFO     openeo.rest.job:job.py:436 Downloading Job result asset 'openEO_2020-03-11Z.tif' from https://s3.waw3-1.openeo.v1.dataspace.copernicus.eu/openeo-data-prod-waw4-1/batch_jobs/j-2604220349364c5a8240bc7bfbf84739/openEO_2020-03-11Z.tif?X-Proxy-Head-As-Get=true&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=3807dee825874777814b8c8298e1647f%2F20260422%2Fwaw4-1%2Fs3%2Faws4_request&X-Amz-Date=20260422T035447Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Security-Token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlX2FybiI6ImFybjpvcGVuZW93czppYW06Ojpyb2xlL29wZW5lby1kYXRhLXByb2Qtd2F3NC0xLXdvcmtzcGFjZSIsImluaXRpYWxfaXNzdWVyIjoib3BlbmVvLnByb2Qud2F3My0xLm9wZW5lby1pbnQudjEuZGF0YXNwYWNlLmNvcGVybmljdXMuZXUiLCJodHRwczovL2F3cy5hbWF6b24uY29tL3RhZ3MiOnsicHJpbmNpcGFsX3RhZ3MiOnsiam9iX2lkIjpbImotMjYwNDIyMDM0OTM2NGM1YTgyNDBiYzdiZmJmODQ3MzkiXSwidXNlcl9pZCI6WyI2YTc3ZmNkMS05YzA4LTQ2ZTktYjg3NS01NGZiOTk5YWIyMDAiXX0sInRyYW5zaXRpdmVfdGFnX2tleXMiOlsidXNlcl9pZCIsImpvYl9pZCJdfSwiaXNzIjoic3RzLndhdzMtMS5vcGVuZW8udjEuZGF0YXNwYWNlLmNvcGVybmljdXMuZXUiLCJzdWIiOiJvcGVuZW8tZHJpdmVyIiwiZXhwIjoxNzc2ODczMjg3LCJuYmYiOjE3NzY4MzAwODcsImlhdCI6MTc3NjgzMDA4NywianRpIjoiNWNhZDA4NjEtNjEzYy00YTllLWIwOTMtYjU4ZWVhM2UzYTUxIiwiYWNjZXNzX2tleV9pZCI6IjM4MDdkZWU4MjU4NzQ3Nzc4MTRiOGM4Mjk4ZTE2NDdmIn0.m0NypdJVrKIKytvmEvHl9Dtb-nWrNtgDfo-7F2qn1uUm3V7OfZ3rEMpPHKltfqWPoKV0dNhygSMo0t3lA3-hoiCyF1jMHrunn-hTbUIM4_7PLwp8LYyFHTAzgSlEyoBa5n0de8PulkUfFVmT80C55wq68RpYWZhx9aQnF22EblbIKPoJenb3SvHwVEdZJy8_0Ui2jNdKQkIsm8vo6irkL-hZvf0loAlc33A-HkewYQnPHBlqYmcI8DlZ_SchnFi4GUgqcF1puf7i6uNFryyIStGxplo0QfIOXy2zhaF5ms5mWGLnMnTHrx7pKKST_15YK9m1tBisCkRrlV_xViPApA&X-Amz-Signature=4b5e9b1cd8dc982b3543299c6a737d7c76581405c8354ab17892791b7e1826c5 to /home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/actual/openEO_2020-03-11Z.tif
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading reference data for scenario.id='sentinel1_changedetection' to reference_dir=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/reference'): start 2026-04-22 03:54:50.883384
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-11743427213!tests_test_benchmarks.py__test_run_benchmark_sentinel1_mcd_!actual/job-results.json' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/reference/job-results.json'): start 2026-04-22 03:54:50.883653
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-11743427213!tests_test_benchmarks.py__test_run_benchmark_sentinel1_mcd_!actual/job-results.json' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/reference/job-results.json'): end 2026-04-22 03:54:51.389732, elapsed 0:00:00.506079
INFO     apex_algorithm_qa_tools.scenarios:util.py:345 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-11743427213!tests_test_benchmarks.py__test_run_benchmark_sentinel1_mcd_!actual/openEO.tif' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/reference/openEO.tif'): start 2026-04-22 03:54:51.390041
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading source='https://s3.waw3-1.cloudferro.com/apex-benchmarks/gh-11743427213!tests_test_benchmarks.py__test_run_benchmark_sentinel1_mcd_!actual/openEO.tif' to path=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/reference/openEO.tif'): end 2026-04-22 03:54:51.902985, elapsed 0:00:00.512944
INFO     apex_algorithm_qa_tools.scenarios:util.py:351 Downloading reference data for scenario.id='sentinel1_changedetection' to reference_dir=PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/reference'): end 2026-04-22 03:54:51.903127, elapsed 0:00:01.019743
INFO     openeo.testing.results:results.py:423 Comparing job results: PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/actual') vs PosixPath('/home/runner/work/apex_algorithms/apex_algorithms/qa/benchmarks/tmp_path_root/test_run_benchmark_sentinel1_c0/reference')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions