Skip to content

Commit

Permalink
Merge pull request #7549 from aldbr/v8.0_FIX_RemoteRunner-outputs
Browse files Browse the repository at this point in the history
[8.0] feat: remove files from the RemoteRunner execution
  • Loading branch information
fstagni authored Apr 4, 2024
2 parents 2369983 + 77602e8 commit 193f9cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/DIRAC/Resources/Computing/AREXComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,10 @@ def getJobOutput(self, jobID, workingDirectory=None):
if remoteOutput == f"{stamp}.out":
with open(localOutput) as f:
stdout = f.read()
os.unlink(localOutput)
if remoteOutput == f"{stamp}.err":
with open(localOutput) as f:
stderr = f.read()
os.unlink(localOutput)

return S_OK((stdout, stderr))
6 changes: 5 additions & 1 deletion src/DIRAC/WorkloadManagementSystem/Utilities/RemoteRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ def execute(self, command, workingDirectory=".", numberOfProcessors=1, cleanRemo
return result
self.log.info("The output has been retrieved and declared complete")

# Clean job in the remote resource
# Clean up the job (local files not needed anymore)
os.remove(self.checkSumOutput)
os.remove(self.executable)

# Remove the job from the CE
if cleanRemoteJob:
if not (result := workloadCE.cleanJob(jobID))["OK"]:
self.log.warn("Failed to clean the output remotely", result["Message"])
Expand Down

0 comments on commit 193f9cd

Please sign in to comment.