From 1c6e15d468a116b77d19902836b96b2f9f832767 Mon Sep 17 00:00:00 2001 From: aldbr Date: Thu, 4 Apr 2024 09:44:53 +0200 Subject: [PATCH] sweep: #7549 feat: remove files from the RemoteRunner execution --- src/DIRAC/Resources/Computing/AREXComputingElement.py | 2 ++ .../WorkloadManagementSystem/Utilities/RemoteRunner.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/DIRAC/Resources/Computing/AREXComputingElement.py b/src/DIRAC/Resources/Computing/AREXComputingElement.py index 84ad2b6d8a0..66171217a7b 100755 --- a/src/DIRAC/Resources/Computing/AREXComputingElement.py +++ b/src/DIRAC/Resources/Computing/AREXComputingElement.py @@ -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)) diff --git a/src/DIRAC/WorkloadManagementSystem/Utilities/RemoteRunner.py b/src/DIRAC/WorkloadManagementSystem/Utilities/RemoteRunner.py index ea816e68a88..db1683107ca 100644 --- a/src/DIRAC/WorkloadManagementSystem/Utilities/RemoteRunner.py +++ b/src/DIRAC/WorkloadManagementSystem/Utilities/RemoteRunner.py @@ -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"])