Skip to content

Commit a712a89

Browse files
author
Peter Amstutz
committed
Support --info
1 parent efc17cc commit a712a89

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

wes_client/__init__.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def main(argv=sys.argv[1:]):
3131
exgroup.add_argument("--get", type=str, default=None)
3232
exgroup.add_argument("--log", type=str, default=None)
3333
exgroup.add_argument("--list", action="store_true", default=False)
34+
exgroup.add_argument("--info", action="store_true", default=False)
3435
exgroup.add_argument("--version", action="store_true", default=False)
3536

3637
exgroup = parser.add_mutually_exclusive_group()
@@ -75,6 +76,11 @@ def main(argv=sys.argv[1:]):
7576
json.dump(response.result(), sys.stdout, indent=4)
7677
return 0
7778

79+
if args.info:
80+
response = client.WorkflowExecutionService.GetServiceInfo()
81+
json.dump(response.result(), sys.stdout, indent=4)
82+
return 0
83+
7884
loader = schema_salad.ref_resolver.Loader({
7985
"location": {"@type": "@id"}
8086
})
@@ -83,11 +89,18 @@ def main(argv=sys.argv[1:]):
8389
basedir = os.path.dirname(args.job_order)
8490

8591
def fixpaths(d):
86-
if isinstance(d, dict) and "path" in d:
87-
local_path = os.path.normpath(
88-
os.path.join(os.getcwd(), basedir, d["path"]))
89-
del d["path"]
90-
d["location"] = urllib.pathname2url(local_path)
92+
if isinstance(d, dict):
93+
if "path" in d:
94+
local_path = os.path.normpath(
95+
os.path.join(os.getcwd(), basedir, d["path"]))
96+
del d["path"]
97+
d["location"] = urllib.pathname2url(local_path)
98+
if d.get("class") == "Directory":
99+
loc = d.get("location", "")
100+
if loc.startswith("http:") or loc.startswith("https:"):
101+
logging.error("Directory inputs not supported with http references")
102+
exit(33)
103+
91104
visit(input, fixpaths)
92105

93106
workflow_url = args.workflow_url

wes_service/arvados_wes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ArvadosBackend(WESBackend):
3030
def GetServiceInfo(self):
3131
return {
3232
"workflow_type_versions": {
33-
"CWL": ["v1.0"]
33+
"CWL": {"workflow_type_version": ["v1.0"]}
3434
},
3535
"supported_wes_versions": "0.2.1",
3636
"supported_filesystem_protocols": ["file", "http", "https", "keep"],

wes_service/cwl_runner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ class CWLRunnerBackend(WESBackend):
130130
def GetServiceInfo(self):
131131
return {
132132
"workflow_type_versions": {
133-
"CWL": ["v1.0"]
133+
"CWL": {"workflow_type_version": ["v1.0"]}
134134
},
135-
"supported_wes_versions": "0.3.0",
136-
"supported_filesystem_protocols": ["file"],
135+
"supported_wes_versions": ["0.3.0"],
136+
"supported_filesystem_protocols": ["file", "http", "https"],
137137
"engine_versions": "cwl-runner",
138138
"system_state_counts": {},
139139
"key_values": {}

0 commit comments

Comments
 (0)