Only delete working/ and outputs on resubmission

This commit is contained in:
mvdbeek
2020-01-21 11:16:38 +01:00
parent 933c3bafc0
commit db472b2bc0
3 changed files with 10 additions and 4 deletions
+1
View File
@@ -1113,6 +1113,7 @@ class JobWrapper(HasResourceParameters):
# The tool execution is given a working directory beneath the
# "job" working directory.
safe_makedirs(self.tool_working_directory)
safe_makedirs(os.path.join(working_directory, 'outputs'))
log.debug('(%s) Working directory for job is: %s',
self.job_id, self.working_directory)
except ObjectInvalid:
+7 -1
View File
@@ -101,7 +101,13 @@ def build_command(
# Remove the working directory incase this is for instance a SLURM re-submission.
# xref https://github.com/galaxyproject/galaxy/issues/3289
commands_builder.prepend_command("rm -rf working outputs; mkdir -p working outputs; cd working")
commands_builder.prepend_command("""# Delete working/ and outputs/ only if job was resubmitted
if [ -f .job_started ]; then
rm -rf working outputs; mkdir -p working outputs
fi
touch .job_started
cd working
""", sep='')
container_monitor_command = job_wrapper.container_monitor_command(container)
if container_monitor_command:
+2 -3
View File
@@ -2269,9 +2269,8 @@ class OutputParameterJSONTool(Tool):
json_params['output_data'].append(data_dict)
if json_filename is None:
json_filename = file_name
out = open(json_filename, 'w')
out.write(json.dumps(json_params))
out.close()
with open(json_filename, 'w') as out:
out.write(json.dumps(json_params))
class ExpressionTool(Tool):