Skip to content

Commit

Permalink
Warn on bad rendering options in JobInputFile.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Nov 6, 2024
1 parent 2c671e0 commit 921efca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions law/job/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,6 @@ def __init__(self, path, copy=None, share=None, forward=None, increment=None, po
render_local = maybe_set(render_local, False)

# store attributes, apply residual defaults
# TODO: move to job rendering by default
self.path = os.path.abspath(os.path.expandvars(os.path.expanduser(get_path(path))))
self.copy = True if copy is None else bool(copy)
self.share = False if share is None else bool(share)
Expand Down Expand Up @@ -1356,7 +1355,7 @@ def __init__(self, path, copy=None, share=None, forward=None, increment=None, po
"but rendering is enabled which has no effect".format(self.path),
)
if self.share and self.render_local:
logger.warning(
logger.error(
"input file at {} is configured to be shared across jobs but local rendering is "
"active, potentially resulting in wrong file content".format(self.path),
)
Expand All @@ -1365,6 +1364,11 @@ def __init__(self, path, copy=None, share=None, forward=None, increment=None, po
"input file at {} is configured to be rendered locally and within the job, which "
"is likely unnecessary".format(self.path),
)
if not self.render_local and not self.render_job:
logger.error(
"input file at {} is configured not to be rendered at all, which will most likely "
"cause errors on remote worker nodes".format(self.path),
)

# different path variants as seen by jobs
self.path_sub_abs = None
Expand Down

0 comments on commit 921efca

Please sign in to comment.