Skip to content

Commit 060a85b

Browse files
vjaganat90Vasu Jaganath
andauthored
default network access for ICT to CLT conversion and handle single node WFB payload (PolusAI#291)
Co-authored-by: Vasu Jaganath <[email protected]>
1 parent ae6652e commit 060a85b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/sophios/api/utils/converter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def extract_state(inp: Json) -> Json:
6262
plugin = next((ict for ict in plugins if ict['pid'] == node_pid), None)
6363
clt: Json = {}
6464
if plugin:
65-
clt = ict_to_clt(plugin)
65+
# by default have network access true
66+
# so we don't get runtime error for docker/container pull
67+
clt = ict_to_clt(plugin, True)
6668
# just have the clt payload in run
6769
node['run'] = clt
6870
inp_restrict = inp_inter['state']
@@ -165,7 +167,11 @@ def wfb_to_wic(inp: Json) -> Cwl:
165167
workflow_temp["steps"].append(node) # node["cwlScript"] # Assume dict form
166168
else: # A single node workflow
167169
node = inp_restrict["nodes"][0]
168-
workflow_temp = node["cwlScript"] if node.get("cwlScript") else node['run']
170+
if node.get("cwlScript"):
171+
workflow_temp = node["cwlScript"]
172+
else:
173+
workflow_temp["steps"] = []
174+
workflow_temp["steps"].append(node)
169175
return workflow_temp
170176

171177

0 commit comments

Comments
 (0)