Skip to content

Commit 574465b

Browse files
committed
renaming Command line arg to --force-docker-pull for better undestanding
1 parent 81b7c6e commit 574465b

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

cwltool/builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(self): # type: () -> None
4949
self.make_fs_access = None # type: Type[StdFsAccess]
5050
self.debug = False # type: bool
5151
self.mutation_manager = None # type: MutationManager
52-
self.strict_docker_pull = False # type: bool
52+
self.force_docker_pull = False # type: bool
5353

5454
# One of "no_listing", "shallow_listing", "deep_listing"
5555
# Will be default "no_listing" for CWL v1.1
@@ -246,5 +246,5 @@ def do_eval(self, ex, context=None, pull_image=True, recursive=False):
246246
self.resources,
247247
context=context, pull_image=pull_image,
248248
timeout=self.timeout,
249-
strict_docker_pull=self.strict_docker_pull,
249+
force_docker_pull=self.force_docker_pull,
250250
debug=self.debug)

cwltool/expression.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def next_seg(remain, obj): # type: (Text, Any) -> Any
153153
return obj
154154

155155

156-
def evaluator(ex, jslib, obj, fullJS=False, timeout=None, strict_docker_pull=False, debug=False):
156+
def evaluator(ex, jslib, obj, fullJS=False, timeout=None, force_docker_pull=False, debug=False):
157157
# type: (Text, Text, Dict[Text, Any], bool, int, bool, bool) -> JSON
158158
m = param_re.match(ex)
159159
if m:
@@ -164,15 +164,15 @@ def evaluator(ex, jslib, obj, fullJS=False, timeout=None, strict_docker_pull=Fal
164164
except Exception as w:
165165
raise WorkflowException("%s%s" % (m.group(1), w))
166166
elif fullJS:
167-
return sandboxjs.execjs(ex, jslib, timeout=timeout, strict_docker_pull=strict_docker_pull, debug=debug)
167+
return sandboxjs.execjs(ex, jslib, timeout=timeout, force_docker_pull=force_docker_pull, debug=debug)
168168
else:
169169
raise sandboxjs.JavascriptException(
170170
"Syntax error in parameter reference '%s' or used Javascript code without specifying InlineJavascriptRequirement.",
171171
ex)
172172

173173

174174
def interpolate(scan, rootvars,
175-
timeout=None, fullJS=None, jslib="",strict_docker_pull=False,
175+
timeout=None, fullJS=None, jslib="",force_docker_pull=False,
176176
debug=False):
177177
# type: (Text, Dict[Text, Any], int, bool, Union[str, Text], bool, bool) -> JSON
178178
scan = scan.strip()
@@ -183,7 +183,7 @@ def interpolate(scan, rootvars,
183183

184184
if scan[w[0]] == '$':
185185
e = evaluator(scan[w[0] + 1:w[1]], jslib, rootvars, fullJS=fullJS,
186-
timeout=timeout, strict_docker_pull=strict_docker_pull,
186+
timeout=timeout, force_docker_pull=force_docker_pull,
187187
debug=debug)
188188
if w[0] == 0 and w[1] == len(scan):
189189
return e
@@ -202,7 +202,7 @@ def interpolate(scan, rootvars,
202202

203203

204204
def do_eval(ex, jobinput, requirements, outdir, tmpdir, resources,
205-
context=None, pull_image=True, timeout=None, strict_docker_pull=False, debug=False):
205+
context=None, pull_image=True, timeout=None, force_docker_pull=False, debug=False):
206206
# type: (Union[dict, AnyStr], Dict[Text, Union[Dict, List, Text]], List[Dict[Text, Any]], Text, Text, Dict[Text, Union[int, Text]], Any, bool, int, bool, bool) -> Any
207207

208208
runtime = copy.copy(resources)
@@ -229,7 +229,7 @@ def do_eval(ex, jobinput, requirements, outdir, tmpdir, resources,
229229
timeout=timeout,
230230
fullJS=fullJS,
231231
jslib=jslib,
232-
strict_docker_pull=strict_docker_pull,
232+
force_docker_pull=force_docker_pull,
233233
debug=debug)
234234
except Exception as e:
235235
raise WorkflowException("Expression evaluation error:\n%s" % e)

cwltool/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
226226
exgroup.add_argument("--make-template", action="store_true",
227227
help="Generate a template input object")
228228

229-
parser.add_argument("--docker-pull", action="store_true",
229+
parser.add_argument("--force-docker-pull", action="store_true",
230230
default=False, help="Strictly pull latest docker image even if"
231-
" it is locally present", dest="docker_pull")
231+
" it is locally present", dest="force_docker_pull")
232232
parser.add_argument("workflow", type=Text, nargs="?", default=None)
233233
parser.add_argument("job_order", nargs=argparse.REMAINDER)
234234

cwltool/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def _init_job(self, joborder, **kwargs):
560560

561561
builder.make_fs_access = kwargs.get("make_fs_access") or StdFsAccess
562562
builder.fs_access = builder.make_fs_access(kwargs["basedir"])
563-
builder.strict_docker_pull = kwargs.get("docker_pull")
563+
builder.force_docker_pull = kwargs.get("force_docker_pull")
564564

565565
loadListingReq, _ = self.get_requirement("http://commonwl.org/cwltool#LoadListingRequirement")
566566
if loadListingReq:

cwltool/sandboxjs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def check_js_threshold_version(working_alias):
5353
return False
5454

5555

56-
def new_js_proc(strict_docker_pull=False):
56+
def new_js_proc(force_docker_pull=False):
5757
# type: (bool) -> subprocess.Popen
5858

5959
res = resource_stream(__name__, 'cwlNodeEngine.js')
@@ -89,7 +89,7 @@ def new_js_proc(strict_docker_pull=False):
8989
if not have_node_slim:
9090
dockerimgs = subprocess.check_output(["docker", "images", "-q", nodeimg]).decode('utf-8')
9191
# if output is an empty string
92-
if (len(dockerimgs.split("\n")) <= 1) or strict_docker_pull:
92+
if (len(dockerimgs.split("\n")) <= 1) or force_docker_pull:
9393
# pull node:slim docker container
9494
nodejsimg = subprocess.check_output(["docker", "pull", nodeimg]).decode('utf-8')
9595
_logger.info("Pulled Docker image %s %s", nodeimg, nodejsimg)
@@ -124,10 +124,10 @@ def new_js_proc(strict_docker_pull=False):
124124
return nodejs
125125

126126

127-
def execjs(js, jslib, timeout=None, strict_docker_pull=False, debug=False): # type: (Union[Mapping, Text], Any, int, bool, bool) -> JSON
127+
def execjs(js, jslib, timeout=None, force_docker_pull=False, debug=False): # type: (Union[Mapping, Text], Any, int, bool, bool) -> JSON
128128

129129
if not hasattr(localdata, "proc") or localdata.proc.poll() is not None or onWindows():
130-
localdata.proc = new_js_proc(strict_docker_pull=strict_docker_pull)
130+
localdata.proc = new_js_proc(force_docker_pull=force_docker_pull)
131131

132132
nodejs = localdata.proc
133133

0 commit comments

Comments
 (0)