Skip to content

Commit

Permalink
feat: removed private pilot functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Jan 18, 2024
1 parent 0548f1f commit 9eb7b8a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ are showed in the next table:
+----------------------------+------------------------------------------------------------------+-------------+
| *Operator* | Operator | |
+----------------------------+------------------------------------------------------------------+-------------+
| *Pilot* | Private pilot | |
+----------------------------+------------------------------------------------------------------+-------------+
| *PrivateLimitedDelegation* | Allow getting only limited proxies for one self | |
+----------------------------+------------------------------------------------------------------+-------------+
| *ProductionManagement* | Allow managing all productions | |
Expand Down
2 changes: 0 additions & 2 deletions src/DIRAC/Core/Security/Properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class SecurityProperty(str, Enum):
JOB_MONITOR = "JobMonitor"
#: Accounting Monitor - can see accounting data for all groups
ACCOUNTING_MONITOR = "AccountingMonitor"
#: Private pilot
PILOT = "Pilot"
#: Generic pilot
GENERIC_PILOT = "GenericPilot"
#: Site Manager
Expand Down
2 changes: 1 addition & 1 deletion src/DIRAC/Resources/Computing/ComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def _monitorProxy(self, payloadProxy=None):
pilotProps = pilotProxyDict["groupProperties"]

# if running with a pilot proxy, use it to renew the proxy of the payload
if Properties.PILOT in pilotProps or Properties.GENERIC_PILOT in pilotProps:
if Properties.GENERIC_PILOT in pilotProps:
self.log.info("Using Pilot credentials to get a new payload Proxy")
return gProxyManager.renewProxy(
proxyToBeRenewed=payloadProxy,
Expand Down
2 changes: 1 addition & 1 deletion src/DIRAC/WorkloadManagementSystem/Agent/JobAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def _setupProxy(self, ownerDN, ownerGroup):
return S_ERROR("Proxy has no group properties defined")

groupProps = ret["Value"]["groupProperties"]
if Properties.GENERIC_PILOT in groupProps or Properties.PILOT in groupProps:
if Properties.GENERIC_PILOT in groupProps:
proxyResult = self._requestProxyFromProxyManager(ownerDN, ownerGroup)
if not proxyResult["OK"]:
self.log.error("Invalid Proxy", proxyResult["Message"])
Expand Down
6 changes: 1 addition & 5 deletions src/DIRAC/WorkloadManagementSystem/Client/Matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,9 @@ def _checkCredentials(self, resourceDict, credDict):
else:
raise RuntimeError(result["Message"])
else:
# If it's a private pilot, the DN has to be the same
if Properties.PILOT in credDict["properties"]:
self.log.notice("Setting the resource DN to the credentials DN")
resourceDict["OwnerDN"] = credDict["DN"]
# If it's a job sharing. The group has to be the same and just check that the DN (if any)
# belongs to the same group
elif Properties.JOB_SHARING in credDict["properties"]:
if Properties.JOB_SHARING in credDict["properties"]:
resourceDict["OwnerGroup"] = credDict["group"]
self.log.notice("Setting the resource group to the credentials group")
if "OwnerDN" in resourceDict and resourceDict["OwnerDN"] != credDict["DN"]:
Expand Down
17 changes: 5 additions & 12 deletions src/DIRAC/WorkloadManagementSystem/private/ConfigHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,21 @@
from DIRAC.FrameworkSystem.Client.ProxyManagerClient import gProxyManager


def findGenericPilotCredentials(vo=False, group=False, pilotDN="", pilotGroup=""):
def findGenericPilotCredentials(vo=False, pilotDN=""):
"""Looks into the Operations/<>/Pilot section of CS to find the pilot credentials.
Then check if the user has a registered proxy in ProxyManager.
if pilotDN or pilotGroup are specified, use them
if pilotDN are specified, use them
:param str vo: VO name
:param str group: group name
:param str pilotDN: pilot DN
:param str pilotGroup: pilot group
:return: S_OK(tuple)/S_ERROR()
"""
if not group and not vo:
return S_ERROR("Need a group or a VO to determine the Generic pilot credentials")
if not vo:
vo = Registry.getVOForGroup(group)
if not vo:
return S_ERROR(f"Group {group} does not have a VO associated")
return S_ERROR("Need a VO to determine the Generic pilot credentials")
opsHelper = Operations.Operations(vo=vo)
if not pilotGroup:
pilotGroup = opsHelper.getValue("Pilot/GenericPilotGroup", "")
pilotGroup = opsHelper.getValue("Pilot/GenericPilotGroup", "")
if not pilotDN:
pilotDN = opsHelper.getValue("Pilot/GenericPilotDN", "")
if not pilotDN:
Expand Down

0 comments on commit 9eb7b8a

Please sign in to comment.