Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pilot tags are ignored if /Resources/Sites/{grid_type}/{site}/CEs/{ce_name}/Queues/Tag is set #7086

Closed
chrisburr opened this issue Jul 3, 2023 · 0 comments · Fixed by #7087
Assignees

Comments

@chrisburr
Copy link
Member

In the pilot there are two places that the Tag field can be set:

  1. /LocalSite/Tag is set here: https://github.com/DIRACGrid/Pilot/blob/15a0874e520a83243aee2fdcec20a87ccc1328d6/Pilot/pilotCommands.py#L565-L568
  2. /Resources/Computing/CEDefaults/Tag is set here: https://github.com/DIRACGrid/Pilot/blob/15a0874e520a83243aee2fdcec20a87ccc1328d6/Pilot/pilotCommands.py#L680-L681

This results in a pilot.cfg like:

LocalSite
{
  Tag = Token
}
Resources
{
  Computing
  {
    CEDefaults
    {
      Tag = /cvmfs/unpacked.cern.ch/
      Tag += /cvmfs/cernvm-prod.cern.ch/
      Tag += Token
      Tag += /cvmfs/lhcbdev.cern.ch/
      Tag += /cvmfs/lhcb.cern.ch/
      Tag += /cvmfs/lhcb-condb.cern.ch/
    }
  }
}

This is then loaded here:

# Collect global defaults first
for section in ["/Resources/Computing/CEDefaults", f"/Resources/Computing/{self.ceType}"]:
result = gConfig.getOptionsDict(section)
self.log.debug(result)
if result["OK"]:
ceOptions = result["Value"]
for key in ceOptions:
if key in INTEGER_PARAMETERS:
ceOptions[key] = int(ceOptions[key])
if key in FLOAT_PARAMETERS:
ceOptions[key] = float(ceOptions[key])
if key in LIST_PARAMETERS:
ceOptions[key] = gConfig.getValue(os.path.join(section, key), [])
self.ceParameters.update(ceOptions)
# Get local CE configuration
localConfigDict = getCEConfigDict(self.ceName)
self.ceParameters.update(localConfigDict)

/LocalSite/Tag takes priority resulting in the per pilot tags being ignored:

In[1]: import DIRAC
  ...: DIRAC.initialize(extra_config_files=["pilot.cfg"])
  ...: 
  ...: from DIRAC.Core.Utilities.ReturnValues import returnValueOrRaise
  ...: from DIRAC.Resources.Computing.ComputingElementFactory import ComputingElementFactory
  ...: ceFactory  = ComputingElementFactory()
  ...: ce = returnValueOrRaise(ceFactory.getCE("Singularity"))
  ...: ce.initializeParameters()
  ...: returnValueOrRaise(ce.getDescription())
Out[1]:
{'InstallDIRACInContainer': 'False',
 'Tag': 'Token',
 'FileCatalog': 'FileCatalog'}

Related, it looks like getCEConfigDict is buggy and doesn't consider INTEGER_PARAMETERS/FLOAT_PARAMETERS/LIST_PARAMETERS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants