Exemplo n.º 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))
Exemplo n.º 2
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)
Exemplo n.º 3
0
startUpQueues(ganga)

# ------------------------------------------------------------------------------------
# set the default value for the plugins

from Ganga.Utility.Runtime import setPluginDefaults
setPluginDefaults(ganga)

from Ganga.Runtime.bootstrap import manualExportToGPI
manualExportToGPI(ganga)

## Registries now add themselves to the Interface in this step
from Ganga.Runtime.Repository_runtime import startUpRegistries
startUpRegistries(ganga)

# ------------------------------------------------------------------------------------
#  bootstrap core modules
interactive = False
from Ganga.Core.GangaRepository import getRegistrySlice
Ganga.Core.bootstrap(getRegistrySlice('jobs'), interactive, my_interface=ganga)
Ganga.GPIDev.Lib.Config.bootstrap()

# ------------------------------------------------------------------------------------
# run post bootstrap hooks
for r in allRuntimes.values():
    try:
        r.postBootstrapHook()
    except Exception as err:
        logger.error("problems with post bootstrap hook for %s" % r.name)
        logger.error("Reason: %s" % str(err))
Exemplo n.º 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)
        logger.error('Reason: %s' % str(err))

for r in allRuntimes.values():
Exemplo n.º 5
0
# set the default value for the plugins

from Ganga.Utility.Runtime import setPluginDefaults
setPluginDefaults(ganga)


from Ganga.Runtime.bootstrap import manualExportToGPI
manualExportToGPI(ganga)


## Registries now add themselves to the Interface in this step
from Ganga.Runtime.Repository_runtime import startUpRegistries
startUpRegistries(ganga)

# ------------------------------------------------------------------------------------
#  bootstrap core modules
interactive = False
from Ganga.Core.GangaRepository import getRegistrySlice
Ganga.Core.bootstrap(getRegistrySlice('jobs'), interactive, my_interface=ganga)
Ganga.GPIDev.Lib.Config.bootstrap()

# ------------------------------------------------------------------------------------
# run post bootstrap hooks
for r in allRuntimes.values():
    try:
        r.postBootstrapHook()
    except Exception as err:
        logger.error("problems with post bootstrap hook for %s" % r.name)
        logger.error("Reason: %s" % str(err))