Idea: Moving the AncestorFilesAgent to the DIRAC interface
While trying to create a Pydantic model for the JDL format to enforces type hints at runtime (see https://github.com/DIRACGrid/DIRAC/discussions/6964), I noticed that LHCbDIRAC uses the additional field AncestorDepth
(see https://gitlab.cern.ch/lhcb-dirac/LHCbDIRAC/-/blob/master/src/LHCbDIRAC/WorkloadManagementSystem/Agent/AncestorFilesAgent.py).
A way around this would be to put the logic contained in this agent/optimizer directly in the DiracLHCb interface in the submit_job method. This way, the LHCbDIRAC code would encapsulate the DIRAC code which seems simpler than what's currently done.
A pseudocode of the idea
class DiracLHCb(Dirac):
def submitJob(...):
# Code logic from the AncestorFilesAgent
super().submitJob(...)
@alboyer told me that very few jobs are impacted by this change, and that getFileAncestors
method from the BookkeepingClient
is very fast. Therefore, I don't think moving this piece of code from the executor framework to the client side would be a problem.
What do you think about this idea ?