diff --git a/force_level2_openeo_test.py b/force_level2_openeo_test.py index 1500a1e..dc8dbb8 100755 --- a/force_level2_openeo_test.py +++ b/force_level2_openeo_test.py @@ -1,7 +1,7 @@ import openeo -# url = "https://openeo.dataspace.copernicus.eu" -url = "https://openeo-staging.dataspace.copernicus.eu/" +url = "https://openeo.dataspace.copernicus.eu" +# url = "https://openeo-staging.dataspace.copernicus.eu/" connection = openeo.connect(url).authenticate_oidc() # datacube = connection.datacube_from_process( @@ -15,6 +15,6 @@ stac_root="catalogue.json", ) -job = datacube.create_job() +job = datacube.create_job(title=__file__) job.start_and_wait() results = job.get_results() diff --git a/material/force-l2.cwl b/material/force-l2.cwl index a1c4d30..84ed252 100644 --- a/material/force-l2.cwl +++ b/material/force-l2.cwl @@ -13,8 +13,8 @@ class: CommandLineTool requirements: DockerRequirement: # dockerPull: registry.stag.warsaw.openeo.dataspace.copernicus.eu/rand/force-eoap:0.0.7 -# dockerPull: quay.io/bcdev/force-eoap:0.0.7 - dockerImageId: quay.io/bcdev/force-eoap:0.0.7 + dockerPull: quay.io/bcdev/force-eoap:0.0.7 +# dockerImageId: quay.io/bcdev/force-eoap:0.0.7 NetworkAccess: networkAccess: true baseCommand: /opt/apex-force-wrapper/bin/force-level2-wrapper.sh diff --git a/resources/output-item-boa-asset.template b/resources/output-item-boa-asset.template index 92d11ba..fc1c379 100644 --- a/resources/output-item-boa-asset.template +++ b/resources/output-item-boa-asset.template @@ -62,7 +62,7 @@ "eo:common_name": "swir22" } ], - "type": "image/tif", + "type": "image/tiff", "file:size": ${size}, "file:checksum": "$md5sum", "file:local_path": "$boa_path", diff --git a/resources/output-item-ovv-asset.template b/resources/output-item-ovv-asset.template index ab2b4dd..f93b8f9 100644 --- a/resources/output-item-ovv-asset.template +++ b/resources/output-item-ovv-asset.template @@ -1,6 +1,6 @@ "${id}": { "href": "${ovv_path}", - "type": "image/jpg", + "type": "image/jpeg", "file:size": ${size}, "file:checksum": "$md5sum", "file:local_path": "$ovv_path", diff --git a/resources/output-item-qai-asset.template b/resources/output-item-qai-asset.template index b781e45..918210a 100644 --- a/resources/output-item-qai-asset.template +++ b/resources/output-item-qai-asset.template @@ -1,6 +1,6 @@ "${id}": { "href": "${qai_path}", - "type": "image/tif", + "type": "image/tiff", "file:size": ${size}, "file:checksum": "$md5sum", "file:local_path": "$qai_path", diff --git a/run_load_stac.py b/run_load_stac.py new file mode 100644 index 0000000..b96543c --- /dev/null +++ b/run_load_stac.py @@ -0,0 +1,30 @@ +from pathlib import Path +import os +import openeo + +stac_root = Path("l2-ard/catalogue.json").absolute() +if not stac_root.exists(): + # Run the CWL first to create the stac catalog! + os.system( + "cwltool --preserve-environment=AWS_ENDPOINT_URL_S3 --preserve-environment=AWS_ACCESS_KEY_ID --preserve-environment=AWS_SECRET_ACCESS_KEY --force-docker-pull --leave-container --leave-tmpdir --tmpdir-prefix=$HOME/tmp/ material/force-l2.cwl" + ) + +from pystac import Catalog + +validations = Catalog.from_file(str(stac_root)).validate_all() +assert validations > 0 + + +datacube = openeo.DataCube.load_stac( + url=str(stac_root), + spatial_extent={"west": 10.25, "south": 44.13, "east": 11.67, "north": 45.15}, +) + +tmp_dir = Path(".").absolute() / "tmp" +tmp_dir.mkdir(exist_ok=True) + +datacube.print_json(file=tmp_dir / "process_graph.json", indent=2) + +from openeogeotrellis.deploy.run_graph_locally import run_graph_locally + +run_graph_locally(tmp_dir / "process_graph.json", tmp_dir)