Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 08:39:16

0001 # Licensed under the Apache License, Version 2.0 (the "License");
0002 # you may not use this file except in compliance with the License.
0003 # You may obtain a copy of the License at
0004 # http://www.apache.org/licenses/LICENSE-2.0
0005 #
0006 # Authors:
0007 # - Alexey Anisenkov, anisyonk@cern.ch, 2018
0008 
0009 """
0010 Pilot Config specific info provider mainly used to customize Queue, Site, etc data of Information Service
0011 with details fetched directly from local Pilot instance configuration
0012 
0013 :author: Alexey Anisenkov
0014 :contact: anisyonk@cern.ch
0015 :date: January 2018
0016 """
0017 
0018 from ..util.config import config
0019 
0020 import logging
0021 logger = logging.getLogger(__name__)
0022 
0023 
0024 class PilotConfigProvider(object):
0025     """
0026         Info provider which is used to extract settings specific for local Pilot instance
0027         and overwrite general configuration used by Information Service
0028     """
0029 
0030     config = None  # Pilot Config instance
0031 
0032     def __init__(self, conf=None):
0033         self.config = conf or config
0034 
0035     def resolve_schedconf_sources(self):
0036         """
0037             Resolve prioritized list of source names to be used for SchedConfig data load
0038             :return: prioritized list of source names
0039         """
0040 
0041         # ## FIX ME LATER
0042         # an example of return data:
0043         # return ['AGIS', 'LOCAL', 'CVMFS']
0044 
0045         return None  # ## Not implemented yet
0046 
0047     def resolve_queuedata(self, pandaqueue, **kwargs):
0048         """
0049             Resolve queue data details
0050 
0051             :param pandaqueue: name of PandaQueue
0052             :return: dict of settings for given PandaQueue as a key
0053         """
0054 
0055         import ast
0056         data = {
0057             'maxwdir_broken': self.config.Pilot.maximum_input_file_sizes,  # ## Config API is broken -- FIXME LATER
0058             #'container_type': 'singularity:pilot;docker:wrapper',  # ## for testing
0059             #'container_options': '-B /cvmfs,/scratch,/etc/grid-security --contain',  ## for testing
0060             #'catchall': "singularity_options='-B /cvmfs000' catchx=1",  ## for testing
0061             'es_stageout_gap': 601,  # in seconds, for testing: FIXME LATER,
0062         }
0063 
0064         if hasattr(self.config.Information, 'acopytools'):  ## FIX ME LATER: Config API should reimplemented/fixed later
0065             data['acopytools'] = ast.literal_eval(self.config.Information.acopytools)
0066 
0067         logger.info('queuedata: following keys will be overwritten by config values: %s' % data)
0068 
0069         return {pandaqueue: data}