Exemple #1
0
def loadPlugins(environment):
    """
    Given a list of environments fully load the found Plugins into them exposing all of the relavent objects
    """
    from Ganga.Utility.Runtime import allRuntimes
    from Ganga.Utility.logging import getLogger
    logger = getLogger()
    env_dict = environment.__dict__
    for n, r in zip(allRuntimes.keys(), allRuntimes.values()):
        try:
            r.bootstrap(env_dict)
        except Exception as err:
            logger.error('problems with bootstrapping %s -- ignored', n)
            logger.error('Reason: %s' % str(err))
            raise err
        try:
            r.loadNamedTemplates(env_dict, Ganga.Utility.Config.getConfig('Configuration')['namedTemplates_ext'],
                                           Ganga.Utility.Config.getConfig('Configuration')['namedTemplates_pickle'])
        except Exception as err:
            logger.error('problems with loading Named Templates for %s', n)
            logger.error('Reason: %s' % str(err))

    for r in allRuntimes.values():
        try:
            r.loadPlugins()
        except Exception as err:
            logger.error('problems with loading Named Templates for %s', n)
            logger.error('Reason: %s' % str(err))
Exemple #2
0
def loadPlugins(environment):
    """
    Given a list of environments fully load the found Plugins into them exposing all of the relavent objects
    """
    from Ganga.Utility.Runtime import allRuntimes
    from Ganga.Utility.logging import getLogger
    logger = getLogger()
    env_dict = environment.__dict__
    logger.debug("Loading: %s PLUGINS" % str(allRuntimes.keys()))
    for n, r in allRuntimes.iteritems():
        logger.debug("Bootstrapping: %s" % n)
        try:
            r.bootstrap(env_dict)
        except Exception as err:
            logger.error('problems with bootstrapping %s -- ignored', n)
            logger.error('Reason: %s' % str(err))
            raise err
        try:
            r.loadNamedTemplates(env_dict, Ganga.Utility.Config.getConfig('Configuration')['namedTemplates_ext'],
          Ganga.Utility.Config.getConfig('Configuration')['namedTemplates_pickle'])
        except Exception as err:
            logger.error('problems with loading Named Templates for %s', n)
            logger.error('Reason: %s' % str(err))

    for n, r in allRuntimes.iteritems():
        logger.debug("Loading: %s" % n)
        try:
            r.loadPlugins()
        except Exception as err:
            logger.error('problems with loading Plugin %s', n)
            logger.error('Reason: %s' % str(err))
            raise PluginError("Failed to load plugin: %s. Ganga will now shutdown to prevent job corruption." % n)
Exemple #3
0
def loadPlugins(environment):
    """
    Given a list of environments fully load the found Plugins into them exposing all of the relavent objects
    """
    from Ganga.Utility.Runtime import allRuntimes
    from Ganga.Utility.logging import getLogger
    logger = getLogger()
    env_dict = environment.__dict__
    logger.debug("Loading: %s PLUGINS" % str(allRuntimes.keys()))
    for n, r in allRuntimes.iteritems():
        logger.debug("Bootstrapping: %s" % n)
        try:
            r.bootstrap(env_dict)
        except Exception as err:
            logger.error('problems with bootstrapping %s -- ignored', n)
            logger.error('Reason: %s' % str(err))
            raise err
        try:
            r.loadNamedTemplates(
                env_dict,
                Ganga.Utility.Config.getConfig(
                    'Configuration')['namedTemplates_ext'],
                Ganga.Utility.Config.getConfig('Configuration')
                ['namedTemplates_pickle'])
        except Exception as err:
            logger.error('problems with loading Named Templates for %s', n)
            logger.error('Reason: %s' % str(err))

    for n, r in allRuntimes.iteritems():
        logger.debug("Loading: %s" % n)
        try:
            r.loadPlugins()
        except Exception as err:
            logger.error('problems with loading Plugin %s', n)
            logger.error('Reason: %s' % str(err))
            raise PluginError(
                "Failed to load plugin: %s. Ganga will now shutdown to prevent job corruption."
                % n)
Exemple #4
0
        mp.process_objects.append(stripProxy(j).merger)
        stripProxy(j).postprocessors = mp


# ------------------------------------------------------------------------------------
# Setup the shutdown manager
from Ganga.Core.InternalServices import ShutdownManager
ShutdownManager.install()

# ------------------------------------------------------------------------------------
# start queues
exportToPublicInterface('queues', ThreadPoolQueueMonitor(), 'Objects')

# ------------------------------------------------------------------------------------
# Bootstrap all runtimes (e.g. GangaLHCb, GangaDirac, GangaAtlas, etc.)
for n, r in zip(allRuntimes.keys(), allRuntimes.values()):
    try:
        r.bootstrap(Ganga.GPI.__dict__)
    except Exception as err:
        logger.error('problems with bootstrapping %s -- ignored', n)
        logger.error('Reason: %s' % str(err))
        raise err
    try:
        r.loadNamedTemplates(
            Ganga.GPI.__dict__,
            Ganga.Utility.Config.getConfig(
                'Configuration')['namedTemplates_ext'],
            Ganga.Utility.Config.getConfig('Configuration')
            ['namedTemplates_pickle'])
    except Exception as err:
        logger.error('problems with loading Named Templates for %s', n)
Exemple #5
0
        mp.process_objects.append(stripProxy(j).merger)
        stripProxy(j).postprocessors = mp


# ------------------------------------------------------------------------------------
# Setup the shutdown manager
from Ganga.Core.InternalServices import ShutdownManager
ShutdownManager.install()

# ------------------------------------------------------------------------------------
# start queues
exportToPublicInterface('queues', ThreadPoolQueueMonitor(), 'Objects')

# ------------------------------------------------------------------------------------
# Bootstrap all runtimes (e.g. GangaLHCb, GangaDirac, GangaAtlas, etc.)
for n, r in zip(allRuntimes.keys(), allRuntimes.values()):
    try:
        r.bootstrap(Ganga.GPI.__dict__)
    except Exception as err:
        logger.error('problems with bootstrapping %s -- ignored', n)
        logger.error('Reason: %s' % str(err))
        raise err
    try:
        r.loadNamedTemplates(Ganga.GPI.__dict__,
                             Ganga.Utility.Config.getConfig('Configuration')['namedTemplates_ext'],
                             Ganga.Utility.Config.getConfig('Configuration')['namedTemplates_pickle'])
    except Exception as err:
        logger.error('problems with loading Named Templates for %s', n)
        logger.error('Reason: %s' % str(err))

for r in allRuntimes.values():