106
106
)
107
107
from .workflow import Workflow
108
108
109
+ docker_exe : str
110
+
109
111
110
112
def _terminate_processes () -> None :
111
113
"""Kill all spawned processes.
@@ -118,6 +120,7 @@ def _terminate_processes() -> None:
118
120
continuing to execute while it kills the processes that they've
119
121
spawned. This may occasionally lead to unexpected behaviour.
120
122
"""
123
+ global docker_exe
121
124
# It's possible that another thread will spawn a new task while
122
125
# we're executing, so it's not safe to use a for loop here.
123
126
while processes_to_kill :
@@ -131,7 +134,7 @@ def _terminate_processes() -> None:
131
134
try :
132
135
with open (cidfile [0 ]) as inp_stream :
133
136
p = subprocess .Popen ( # nosec
134
- ["docker" , "kill" , inp_stream .read ()], shell = False # nosec
137
+ [docker_exe , "kill" , inp_stream .read ()], shell = False # nosec
135
138
)
136
139
try :
137
140
p .wait (timeout = 10 )
@@ -1010,6 +1013,7 @@ def main(
1010
1013
stderr_handler = _logger .handlers [- 1 ]
1011
1014
workflowobj = None
1012
1015
prov_log_handler : Optional [logging .StreamHandler [ProvOut ]] = None
1016
+ global docker_exe
1013
1017
try :
1014
1018
if args is None :
1015
1019
if argsl is None :
@@ -1031,6 +1035,10 @@ def main(
1031
1035
else :
1032
1036
runtimeContext = runtimeContext .copy ()
1033
1037
1038
+ if runtimeContext .podman :
1039
+ docker_exe = "podman"
1040
+ else :
1041
+ docker_exe = "docker"
1034
1042
# If caller parsed its own arguments, it may not include every
1035
1043
# cwltool option, so fill in defaults to avoid crashing when
1036
1044
# dereferencing them in args.
0 commit comments