Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] feat: remove files from the RemoteRunner execution #7549

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading