Skip to content

Commit

Permalink
print Rucio container name. For #5176 (#5177)
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte authored Oct 18, 2022
1 parent 8b8f2a2 commit a7cc0e1
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/python/CRABClient/Commands/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ def __call__(self):
maxJobRuntime = int(getColumn(crabDBInfo, 'tm_maxjobruntime'))
numCores = int(getColumn(crabDBInfo, 'tm_numcores'))
splitting = getColumn(crabDBInfo, 'tm_split_algo')
outputLfn = getColumn(crabDBInfo, 'tm_output_lfn')
if getColumn(crabDBInfo, 'tm_output_dataset'):
outputDatasetList = literal_eval(getColumn(crabDBInfo, 'tm_output_dataset'))
else:
outputDatasetList = None
outDataset = outputDatasetList[0] if outputDatasetList else None # we do not support multiple output datasets anymore

#Print information from the database
self.printTaskInfo(crabDBInfo, user)
Expand Down Expand Up @@ -227,7 +233,13 @@ def __call__(self):
# If the task is already on the grid, show the dagman status
combinedStatus = dagStatus = self.printDAGStatus(dbStatus, statusCacheInfo)

shortResult = self.printOverview(statusCacheInfo, automaticSplitt, proxiedWebDir)
usingRucio = outputLfn.startswith('/store/user/rucio')
if usingRucio:
container = 'user.%s:%s' % (user, outDataset) # add scope to get a Rucio DID
else:
container = None

shortResult = self.printOverview(statusCacheInfo, automaticSplitt, proxiedWebDir, container)
pubStatus = self.printPublication(publicationEnabled, shortResult['jobsPerStatus'], shortResult['numProbes'],
shortResult['numUnpublishable'], taskname, user, crabDBInfo)
self.printErrors(statusCacheInfo, automaticSplitt)
Expand Down Expand Up @@ -617,7 +629,7 @@ def translateJobStatus(jobid):

return sortdict

def printOverview(self, statusCacheInfo, automaticSplitt, proxiedWebDir):
def printOverview(self, statusCacheInfo, automaticSplitt, proxiedWebDir, container):
""" Give a summary of the job statuses, keeping in mind that:
- If there is a job with id 0 then this is the probe job for the estimation
This is the so called 'Automatic' splitting
Expand Down Expand Up @@ -699,6 +711,7 @@ def terminate(states, jobStatus, target='no output'):
self.logger.info("\n{0:32}{1}{2}{3}".format(jobtype + ' status:', self._printState(state_list[0], 13), self.indentation, self._percentageString(state_list[0], currStates[state_list[0]], total)))
for jobStatus in state_list[1:]:
self.logger.info("\t\t\t\t{0}{1}{2}".format(self._printState(jobStatus, 13), self.indentation, self._percentageString(jobStatus, currStates[jobStatus], total)))
self.printRucioInfo(container)
return result

def printErrors(self, dictresult, automaticSplitt):
Expand Down Expand Up @@ -989,6 +1002,14 @@ def printSort(self, sortdict, sortby):

self.logger.info('')

def printRucioInfo(self, container):
if not container:
return
msg=""
msg += "\nRucio Container: %s" % (container)
msg += "\nTips on how to check on Rucio StageOut at https://twiki.cern.ch/twiki/bin/view/CMSPublic/CRAB3FAQ#Stageout_with_Rucio "
self.logger.info(msg)

def printOutputDatasets(self, outputDatasets, includeDASURL=False):
"""
Function to print the list of output datasets (with or without the DAS URL).
Expand Down

0 comments on commit a7cc0e1

Please sign in to comment.