Skip to content

Commit

Permalink
Merge pull request #7553 from DIRACGridBot/cherry-pick-2-193f9cd2d-in…
Browse files Browse the repository at this point in the history
…tegration

[sweep:integration] feat: remove files from the RemoteRunner execution
  • Loading branch information
fstagni authored Apr 5, 2024
2 parents c668011 + 1c6e15d commit c2faf3f
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 @@ -893,8 +893,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 @@ -103,7 +103,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 c2faf3f

Please sign in to comment.