Skip to content

Commit

Permalink
Issue #115 crossbackend: switch to load_stac + partial job results
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Sep 8, 2023
1 parent 1f55f97 commit 5a6f404
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/openeo_aggregator/partitionedjobs/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ def create_crossbackend_pjob(
create_stats = collections.Counter()

def get_replacement(node_id: str, node: dict, subgraph_id: SubGraphId) -> dict:
# TODO: use `load_stac` iso `load_result`, and use canonical URL?
nonlocal batch_jobs
job_id = batch_jobs[subgraph_id].job_id
# TODO: use canonical URL to circumvent auth issues
# but how does `parial` work there? (https://github.com/Open-EO/openeo-api/issues/507)
stac_url = batch_jobs[subgraph_id].get_results_metadata_url(full=True) + "?partial=true"
return {
node_id: {
"process_id": "load_result",
"arguments": {"id": job_id},
"process_id": "load_stac",
"arguments": {"url": stac_url},
}
}

Expand Down
10 changes: 8 additions & 2 deletions tests/partitionedjobs/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,10 @@ def test_create_job_basic(self, flask_app, api100, zk_db, dummy1):
"backend_id": "b1",
"process_graph": {
"lc1": {"process_id": "load_collection", "arguments": {"id": "S2"}},
"lc2": {"process_id": "load_result", "arguments": {"id": "1-jb-0"}},
"lc2": {
"process_id": "load_stac",
"arguments": {"url": "https://b1.test/v1/jobs/1-jb-0/results?partial=true"},
},
"merge": {
"process_id": "merge_cubes",
"arguments": {"cube1": {"from_node": "lc1"}, "cube2": {"from_node": "lc2"}},
Expand All @@ -775,7 +778,10 @@ def test_create_job_basic(self, flask_app, api100, zk_db, dummy1):
assert dummy1.get_job_status(TEST_USER, expected_job_id) == "created"
assert dummy1.get_job_data(TEST_USER, expected_job_id).create["process"]["process_graph"] == {
"lc1": {"process_id": "load_collection", "arguments": {"id": "S2"}},
"lc2": {"process_id": "load_result", "arguments": {"id": "1-jb-0"}},
"lc2": {
"process_id": "load_stac",
"arguments": {"url": "https://b1.test/v1/jobs/1-jb-0/results?partial=true"},
},
"merge": {
"process_id": "merge_cubes",
"arguments": {"cube1": {"from_node": "lc1"}, "cube2": {"from_node": "lc2"}},
Expand Down

0 comments on commit 5a6f404

Please sign in to comment.