Skip to content

Commit

Permalink
feat: remove files from the RemoteRunner execution
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Apr 2, 2024
1 parent f9d149f commit 77602e8
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 77602e8

Please sign in to comment.