Skip to content

Commit

Permalink
set_env verbatim flag
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed Feb 12, 2024
1 parent 79daa72 commit 00fb851
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions sisyphus/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,9 +1135,18 @@ def update_rqmt(self, task_name, rqmt):
self._sis_task_rqmt_overwrite[task_name] = rqmt.copy(), False
return self

def set_env(self, key: str, value: str):
"""this environment var will be set at job startup"""
self._sis_environment.set_verbatim(key, value)
def set_env(self, key: str, value: str, *, verbatim: bool = True):
"""
Set environment variable. This environment var will be set at job startup in the worker.
:param key: variable name
:param value:
:param verbatim: True: set it as-is; False: use string.Template(value).substitute(orig_env)
"""
if verbatim:
self._sis_environment.set_verbatim(key, value)
else:
self._sis_environment.set(key, value)

def tasks(self) -> Iterator[Task]:
"""
Expand Down

0 comments on commit 00fb851

Please sign in to comment.