From db485b3fb62306c90e21b1879885f31a0224de49 Mon Sep 17 00:00:00 2001 From: Vasu Jaganath Date: Thu, 31 Oct 2024 13:23:22 -0400 Subject: [PATCH] default network access for ICT to CLT conversion and handle single node WFB payload --- src/sophios/api/utils/converter.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sophios/api/utils/converter.py b/src/sophios/api/utils/converter.py index ba00ac99..5dbcd332 100644 --- a/src/sophios/api/utils/converter.py +++ b/src/sophios/api/utils/converter.py @@ -62,7 +62,9 @@ def extract_state(inp: Json) -> Json: plugin = next((ict for ict in plugins if ict['pid'] == node_pid), None) clt: Json = {} if plugin: - clt = ict_to_clt(plugin) + # by default have network access true + # so we don't get runtime error for docker/container pull + clt = ict_to_clt(plugin, True) # just have the clt payload in run node['run'] = clt inp_restrict = inp_inter['state'] @@ -165,7 +167,11 @@ def wfb_to_wic(inp: Json) -> Cwl: workflow_temp["steps"].append(node) # node["cwlScript"] # Assume dict form else: # A single node workflow node = inp_restrict["nodes"][0] - workflow_temp = node["cwlScript"] if node.get("cwlScript") else node['run'] + if node.get("cwlScript"): + workflow_temp = node["cwlScript"] + else: + workflow_temp["steps"] = [] + workflow_temp["steps"].append(node) return workflow_temp