Skip to content

Commit

Permalink
Merge pull request #7683 from andresailer/multiVoInput
Browse files Browse the repository at this point in the history
[8.0] Transformation InputDataAgent with MultiVOMetadata
  • Loading branch information
fstagni authored Jun 25, 2024
2 parents 9f392cd + 43d4df4 commit cbd2304
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/DIRAC/TransformationSystem/Agent/InputDataAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self, *args, **kwargs):
self.transClient = TransformationClient()
self.metadataClient = FileCatalogClient()
self.transformationTypes = None
self.multiVO = False

#############################################################################
def initialize(self):
Expand All @@ -64,6 +65,8 @@ def initialize(self):
self.transformationTypes.remove(extendable)
# This is because the Extendables do not use this Agent (have no Input data query)

self.multiVO = self.am_getOption("MultiVO", self.multiVO)

return S_OK()

##############################################################################
Expand Down Expand Up @@ -116,7 +119,13 @@ def execute(self):
# Perform the query to the metadata catalog
self.log.verbose("Using input data query for transformation", "%d: %s" % (transID, str(inputDataQuery)))
start = time.time()
result = self.metadataClient.findFilesByMetadata(inputDataQuery)
mdc = self.metadataClient
if self.multiVO:
ownerDN = transDict["AuthorDN"]
ownerGroup = transDict["AuthorGroup"]
self.log.debug(f"Querying file catalog as {ownerDN}, {ownerGroup}")
mdc = FileCatalogClient(useCertificates=True, delegatedDN=ownerDN, delegatedGroup=ownerGroup)
result = mdc.findFilesByMetadata(inputDataQuery)
rtime = time.time() - start
self.log.verbose("Metadata catalog query time", f": {rtime:.2f} seconds.")
if not result["OK"]:
Expand Down
2 changes: 2 additions & 0 deletions src/DIRAC/TransformationSystem/ConfigTemplate.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Agents
PollingTime = 120
FullUpdatePeriod = 86400
RefreshOnly = False
# If True, query the FileCatalog as the owner of the transformation, needed for MultiVO*MetaData filecatalogs
MultiVO = False
}
##END
##BEGIN MCExtensionAgent
Expand Down

0 comments on commit cbd2304

Please sign in to comment.