Skip to content

Commit

Permalink
add JOB_CLEANUP_KEEP_INPUT
Browse files Browse the repository at this point in the history
  • Loading branch information
vieting committed Jul 17, 2024
1 parent ce5f7a2 commit 93daf7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion sisyphus/global_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ def file_caching(path):
JOB_CLEANER_INTERVAL = 60
#: How many threads should be cleaning in parallel
JOB_CLEANER_WORKER = 5
#: If the job internal work directory should be keeped re deleted during clean up
#: If the job internal work directory should be kept or deleted during clean up
JOB_CLEANUP_KEEP_WORK = False
#: If the job internal input directory with symlinks to input jobs should be kept or deleted during clean up
JOB_CLEANUP_KEEP_INPUT = False
#: Default value for job used by tk.cleaner to determine if a job should be removed or not
JOB_DEFAULT_KEEP_VALUE = 50
#: How many threads should update the graph in parallel, useful if the filesystem has a high latency
Expand Down
4 changes: 3 additions & 1 deletion sisyphus/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,12 @@ def _sis_cleanup(self):
try:
if not gs.JOB_CLEANUP_KEEP_WORK:
shutil.rmtree(os.path.abspath(self._sis_path(gs.JOB_WORK_DIR)))
if not gs.JOB_CLEANUP_KEEP_INPUT:
shutil.rmtree(os.path.abspath(self._sis_path(gs.JOB_INPUT)))
files = [
i
for i in os.listdir(self._sis_path())
if i not in (gs.JOB_OUTPUT, gs.JOB_INFO, gs.JOB_WORK_DIR)
if i not in (gs.JOB_OUTPUT, gs.JOB_INFO, gs.JOB_WORK_DIR, gs.JOB_INPUT)
]
subprocess.check_call(
["tar", "-czf", gs.JOB_FINISHED_ARCHIVE] + files, cwd=os.path.abspath(self._sis_path())
Expand Down

0 comments on commit 93daf7a

Please sign in to comment.