Skip to content
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
14 changes: 13 additions & 1 deletion src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def __init__(self, *args, **kwargs):

self.workingDirectory = None
self.maxQueueLength = 86400 * 3
# Bundle proxy lifetime factor: Job bundled proxy lifetime will be this multiplied by the queue runtime length,
# should be high enough to accommodate the queuing time of the job.
self.bundleProxyLifetimeFactor = 1.5

def initialize(self):
"""Initial settings"""
Expand Down Expand Up @@ -446,7 +449,16 @@ def _submitPilotsToQueue(self, pilotsToSubmit: int, ce: ComputingElement, queue:
envVariables = self.queueDict[queue]["ParametersDict"].get("EnvironmentVariables", None)

# Generate the executable
executable = self._getExecutable(queue, proxy=ce.proxy, jobExecDir=jobExecDir, envVariables=envVariables)
# We don't want to use the submission/"pilot" proxy for the job in the bundle:
# Instead we use a non-VOMS proxy which is then not limited in lifetime by the VOMS extension
proxyTimeSec = int(self.maxQueueLength * self.bundleProxyLifetimeFactor)
pilotGroup = Operations(vo=self.vo).getValue("Pilot/GenericPilotGroup")
result = gProxyManager.downloadProxy(self.pilotDN, pilotGroup, limited=True, requiredTimeLeft=proxyTimeSec)
if not result["OK"]:
self.log.error("Failed to get job proxy", f"Queue {queue}:\n{result['Message']}")
return result
jobProxy = result["Value"]
executable = self._getExecutable(queue, proxy=jobProxy, jobExecDir=jobExecDir, envVariables=envVariables)

# Submit the job
submitResult = ce.submitJob(executable, "", pilotsToSubmit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@
}
"""

mockPMProxy = MagicMock()
mockPMProxy.dumpAllToString.return_value = {"OK": True, "Value": "fakeProxy"}
mockPMProxyReply = MagicMock()
mockPMProxyReply.return_value = {"OK": True, "Value": mockPMProxy}


@pytest.fixture
def config():
Expand All @@ -170,6 +175,9 @@ def sd(mocker, config):
mocker.patch(
"DIRAC.WorkloadManagementSystem.Agent.SiteDirector.ResourceStatus.getElementStatus", return_values=usableSites
)
mocker.patch(
"DIRAC.WorkloadManagementSystem.Agent.SiteDirector.gProxyManager.downloadProxy", side_effect=mockPMProxyReply
)
sd = SiteDirector()

# Set logger
Expand Down