diff --git a/ades.py b/ades.py index 4e2b80f..a52fb84 100644 --- a/ades.py +++ b/ades.py @@ -6,9 +6,10 @@ import pyeodh from dotenv import load_dotenv from requests import HTTPError +import yaml load_dotenv() - +pyeodh.set_log_level(10) username = os.getenv("ADES_USER") token = os.getenv("ADES_TOKEN") @@ -41,7 +42,9 @@ def deploy(file, interact): except HTTPError: print("Process not found, no need to undeploy.") - # ades.deploy_process(cwl_yaml=cwl_yaml) + proc = ades.deploy_process(cwl_yaml=cwl_yaml) + + print(proc.id, proc.description) if interact: code.interact(local={**globals(), **locals()}) @@ -51,7 +54,7 @@ def deploy(file, interact): @click.argument("wf", default=WF_ID) @click.option("--inputs", "inputs_file", type=click.Path(exists=True)) @click.option("-i", "interact", help="End in interactive shell", is_flag=True) -def exec(wf: str, inputs_file, interact): +def exec(wf: str, inputs_file: str, interact): print("ID", wf) inputs = {} @@ -59,7 +62,10 @@ def exec(wf: str, inputs_file, interact): print(f"Loading inputs from {inputs_file}") with open(inputs_file, "r") as f: - inputs = json.load(f) + if inputs_file.endswith((".yml", ".yaml")): + inputs = yaml.safe_load(f) + else: + inputs = json.load(f) print("Inputs:") print(json.dumps(inputs, indent=2)) diff --git a/resize-collection.cwl b/resize-collection.cwl index 153fd62..9365fb1 100644 --- a/resize-collection.cwl +++ b/resize-collection.cwl @@ -7,8 +7,8 @@ schemas: $graph: - class: Workflow id: resize-collection - label: Resize sentinel2ard collection - doc: Resize sentinel2ard collection + label: Resize collection cogs + doc: Resize collection cogs requirements: - class: ScatterFeatureRequirement inputs: