Skip to content

Commit a90acce

Browse files
authored
Merge pull request #7157 from fstagni/81_pilotDNUserName
[8.1] PilotAgentsDB: move DN in favor of username
2 parents 23b7407 + 8c13c25 commit a90acce

File tree

14 files changed

+68
-211
lines changed

14 files changed

+68
-211
lines changed

release.notes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
*TransformationSystem
44

5-
NEW: (#7170)
6-
Implement a finer grained permissions model for Transformations.
5+
NEW: (#7170) Implement a finer grained permissions model for Transformations.
76

87
*DataManagementSystem
98

src/DIRAC/Interfaces/API/DiracAdmin.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -385,22 +385,6 @@ def getVOMSProxy(self, userDN, userGroup, vomsAttr=False, validity=43200, limite
385385
userDN, userGroup, limited=limited, requiredVOMSAttribute=vomsAttr, requiredTimeLeft=validity
386386
)
387387

388-
#############################################################################
389-
def getPilotProxy(self, userDN, userGroup, validity=43200):
390-
"""Retrieves a pilot proxy with default 12hr validity and stores
391-
this in a file in the local directory by default.
392-
393-
Example usage:
394-
395-
>>> gLogger.notice(diracAdmin.getVOMSProxy())
396-
{'OK': True, 'Value': }
397-
398-
:return: S_OK,S_ERROR
399-
400-
"""
401-
402-
return gProxyManager.getPilotProxyFromDIRACGroup(userDN, userGroup, requiredTimeLeft=validity)
403-
404388
#############################################################################
405389
def resetJob(self, jobID):
406390
"""Reset a job or list of jobs in the WMS. This operation resets the reschedule

src/DIRAC/Interfaces/scripts/dirac_admin_get_job_pilots.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,30 @@
11
#!/usr/bin/env python
2-
########################################################################
3-
# File : dirac-admin-get-job-pilots
4-
# Author : Stuart Paterson
5-
########################################################################
62
"""
73
Retrieve info about pilots that have matched a given Job
84
95
Example:
106
$ dirac-admin-get-job-pilots 1848
117
{'https://marlb.in2p3.fr:9000/bqYViq6KrVgGfr6wwgT45Q': {'AccountingSent': 'False',
128
'BenchMark': 8.1799999999999997,
13-
'Broker': 'marwms.in2p3.fr',
149
'DestinationSite': 'lpsc-ce.in2p3.fr',
1510
'GridSite': 'LCG.LPSC.fr',
1611
'GridType': 'gLite',
1712
'Jobs': [1848L],
1813
'LastUpdateTime': datetime.datetime(2011, 2, 21, 12, 39, 10),
1914
'OutputReady': 'True',
20-
'OwnerDN': '/O=GRID/C=FR/O=CNRS/OU=LPC/CN=Sebastien Guizard',
2115
'OwnerGroup': '/biomed',
22-
'ParentID': 0L,
23-
'PilotID': 2247L,
2416
'PilotJobReference': 'https://marlb.in2p3.fr:9000/biq6KT45Q',
2517
'PilotStamp': '',
2618
'Status': 'Done',
2719
'SubmissionTime': datetime.datetime(2011, 2, 21, 12, 27, 52),
2820
'TaskQueueID': 399L}}
2921
"""
30-
# pylint: disable=wrong-import-position
3122
from DIRAC.Core.Base.Script import Script
3223

3324

3425
@Script()
3526
def main():
36-
# Registering arguments will automatically add their description to the help menu
3727
Script.registerArgument(["JobID: DIRAC ID of the Job"])
38-
# parseCommandLine show help when mandatory arguments are not specified or incorrect argument
3928
_, args = Script.parseCommandLine(ignoreErrors=True)
4029

4130
from DIRAC import exit as DIRACExit
@@ -58,8 +47,8 @@ def main():
5847
errorList.append((job, result["Message"]))
5948
exitCode = 2
6049

61-
for error in errorList:
62-
print("ERROR %s: %s" % error)
50+
for job, error in errorList:
51+
print(f"ERROR for {job}: {error}")
6352

6453
DIRACExit(exitCode)
6554

src/DIRAC/Interfaces/scripts/dirac_admin_get_pilot_info.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
#!/usr/bin/env python
2-
########################################################################
3-
# File : dirac-admin-get-pilot-info
4-
# Author : Ricardo Graciani
5-
########################################################################
62
"""
73
Retrieve available info about the given pilot
84
95
Example:
106
$ dirac-admin-get-pilot-info https://marlb.in2p3.fr:9000/26KCLKBFtxXKHF4_ZrQjkw
117
{'https://marlb.in2p3.fr:9000/26KCLKBFtxXKHF4_ZrQjkw': {'AccountingSent': 'False',
128
'BenchMark': 0.0,
13-
'Broker': 'marwms.in2p3.fr',
149
'DestinationSite': 'cclcgceli01.in2p3.fr',
1510
'GridSite': 'LCG.IN2P3.fr',
1611
'GridType': 'gLite',
1712
'LastUpdateTime': datetime.datetime(2011, 2, 21, 12, 49, 14),
1813
'OutputReady': 'False',
19-
'OwnerDN': '/O=GRID/C=FR/O=CNRS/OU=LPC/CN=Sebastien Guizard',
2014
'OwnerGroup': '/biomed',
21-
'ParentID': 0L,
22-
'PilotID': 2241L,
2315
'PilotJobReference': 'https://marlb.in2p3.fr:9000/2KHFrQjkw',
2416
'PilotStamp': '',
2517
'Status': 'Done',
2618
'SubmissionTime': datetime.datetime(2011, 2, 21, 12, 27, 52),
2719
'TaskQueueID': 399L}}
2820
"""
29-
# pylint: disable=wrong-import-position
3021
from DIRAC.Core.Base.Script import Script
3122

3223
extendedPrint = False
@@ -63,7 +54,6 @@ def main():
6354
for key in [
6455
"PilotJobReference",
6556
"Status",
66-
"OwnerDN",
6757
"OwnerGroup",
6858
"SubmissionTime",
6959
"DestinationSite",
@@ -85,10 +75,9 @@ def main():
8575
diracAdmin.log.notice(f"{tab}Job ID: {jobID}")
8676
tab += " "
8777
for key in [
88-
"OwnerDN",
89-
"OwnerGroup",
9078
"JobName",
9179
"Status",
80+
"OwnerGroup",
9281
"StartExecTime",
9382
"LastUpdateTime",
9483
"EndExecTime",
@@ -99,8 +88,8 @@ def main():
9988
else:
10089
print(diracAdmin.pPrint.pformat({gridID: res}))
10190

102-
for error in errorList:
103-
print("ERROR %s: %s" % error)
91+
for job, error in errorList:
92+
print(f"ERROR for {job}: {error}")
10493

10594
DIRACExit(exitCode)
10695

src/DIRAC/ResourceStatusSystem/Command/PilotCommand.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def doNew(self, masterParams=None):
9393
return S_ERROR(f'"{element}" is not Site nor Resource')
9494

9595
if element == "Resource":
96-
pilotsResultPivot = self.pilots.getGroupedPilotSummary({}, ["GridSite", "DestinationSite", "OwnerGroup"])
96+
pilotsResultPivot = self.pilots.getGroupedPilotSummary(["GridSite", "DestinationSite", "OwnerGroup"])
9797
elif element == "Site":
98-
pilotsResultPivot = self.pilots.getGroupedPilotSummary({}, ["GridSite", "OwnerGroup"])
98+
pilotsResultPivot = self.pilots.getGroupedPilotSummary(["GridSite", "OwnerGroup"])
9999
else:
100100
# You should never see this error
101101
return S_ERROR(f'"{element}" is not Site nor Resource')

src/DIRAC/WorkloadManagementSystem/Agent/PilotStatusAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def _addPilotsAccountingReport(self, pilotsData):
208208
pA.setValueByKey("Site", "Unknown")
209209
pA.setValueByKey("GridCE", pData["DestinationSite"])
210210
pA.setValueByKey("GridMiddleware", pData["GridType"])
211-
pA.setValueByKey("GridResourceBroker", pData["Broker"])
211+
pA.setValueByKey("GridResourceBroker", "DIRAC")
212212
pA.setValueByKey("GridStatus", pData["Status"])
213213
if "Jobs" not in pData:
214214
pA.setValueByKey("Jobs", 0)

src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,6 @@ def _addPilotTQReference(self, queue, taskQueueDict, pilotList, stampDict):
841841
result = self.pilotAgentsDB.addPilotTQReference(
842842
pilotsList,
843843
tqID,
844-
self.pilotDN,
845844
self.pilotGroup,
846845
self.localhost,
847846
self.queueDict[queue]["CEType"],
@@ -1201,7 +1200,6 @@ def _updatePilotStatusPerQueue(self, queue, proxy):
12011200
"GridType": ceType,
12021201
"GridSite": siteName,
12031202
"Status": PilotStatus.PILOT_TRANSIENT_STATES,
1204-
"OwnerDN": self.pilotDN,
12051203
"OwnerGroup": self.pilotGroup,
12061204
}
12071205
)
@@ -1356,7 +1354,7 @@ def sendPilotAccounting(self, pilotDict):
13561354
pA.setValueByKey("Site", "Unknown")
13571355
pA.setValueByKey("GridCE", pilotDict[pRef]["DestinationSite"])
13581356
pA.setValueByKey("GridMiddleware", pilotDict[pRef]["GridType"])
1359-
pA.setValueByKey("GridResourceBroker", pilotDict[pRef]["Broker"])
1357+
pA.setValueByKey("GridResourceBroker", "DIRAC")
13601358
pA.setValueByKey("GridStatus", pilotDict[pRef]["Status"])
13611359
if "Jobs" not in pilotDict[pRef]:
13621360
pA.setValueByKey("Jobs", 0)

0 commit comments

Comments
 (0)