Ejemplo n.º 1
0
def run(procname, manager_cls, config_files, config_dirs=None):
    configure(manager_cls.agent_type,
              config_files=config_files,
              config_dirs=config_dirs)

    from goperation import threadpool
    from simpleservice.server import LaunchWrapper
    from simpleservice.server import launch
    from simpleservice.rpc.service import LauncheRpcServiceBase

    wrappers = []
    rpc_service = LauncheRpcServiceBase(manager_cls(),
                                        plugin_threadpool=threadpool)
    rpc_wrapper = LaunchWrapper(service=rpc_service, workers=1)
    wrappers.append(rpc_wrapper)
    launch(wrappers, procname)
Ejemplo n.º 2
0
def run(procname, config_files, config_dirs=None):
    conf = configure(config_files=config_files, config_dirs=config_dirs)

    from simpleservice.server import LaunchWrapper
    from simpleservice.server import launch
    from simpleservice.rpc.service import LauncheRpcServiceBase
    from goperation.manager.rpc.server import RpcServerManager
    from goperation import threadpool

    wrappers = []
    rpc_service = LauncheRpcServiceBase(RpcServerManager(),
                                        user=conf.rpc_user,
                                        group=conf.rpc_group,
                                        plugin_threadpool=threadpool)
    rpc_wrapper = LaunchWrapper(service=rpc_service, workers=conf.rpc_process)
    wrappers.append(rpc_wrapper)
    launch(wrappers, procname=procname)
Ejemplo n.º 3
0
def run(topdir):
    if os.path.isdir(topdir):
        config_file = os.path.join(topdir, '%s.conf' % center_group.name)
    else:
        config_file = topdir
    paste_config = configure(config_files=[
        config_file,
    ])
    app = load_paste_app(center_group, paste_config)
    servers = []
    wsgi_server = LauncheWsgiServiceBase(center_group.name, app,
                                         CONF[center_group.name].bind_ip,
                                         CONF[center_group.name].bind_port)
    wsgi_wrapper = LaunchWrapper(wsgi_server,
                                 CONF[center_group.name].wsgi_process)
    servers.append(wsgi_wrapper)
    launch(servers, CONF.user, CONF.group)
Ejemplo n.º 4
0
def run(procname, config_files, config_dirs=None):
    name, paste_config = configure(config_files=config_files,
                                   config_dirs=config_dirs)
    LOG.debug('Paste config file is %s' % paste_config)

    from simpleservice.wsgi.service import load_paste_app
    from simpleservice.wsgi.service import LauncheWsgiServiceBase
    from simpleservice.server import LaunchWrapper
    from simpleservice.server import launch
    from goperation import threadpool

    app = load_paste_app(name, paste_config)
    wrappers = []
    wsgi_service = LauncheWsgiServiceBase(name,
                                          app,
                                          plugin_threadpool=threadpool)
    wsgi_wrapper = LaunchWrapper(service=wsgi_service,
                                 workers=wsgi_service.conf.wsgi_process)
    wrappers.append(wsgi_wrapper)
    launch(wrappers, procname=procname)
Ejemplo n.º 5
0
from simpleservice.rpc.service import LauncheRpcServiceBase
from simpleservice.server import ServerWrapper
from simpleservice.server import launch
from simpleutil.config import cfg
from simpleutil.log import log as logging
from simpleservice.rpc.target import Target

CONF = cfg.CONF
LOG = logging.getLogger(__name__)

config_file = 'C:\\Users\\loliz_000\\Desktop\\etc\\agent.conf'
config_files = [
    config_file,
]

# config.set_default_for_default_log_levels(['routes=INFO', ])

CONF(project='agent', default_config_files=config_files)
config.configure()
agent_group = cfg.OptGroup(name='agent', title='agent options')
CONF.register_group(agent_group)
logging.setup(CONF, 'agent')
default_logging.captureWarnings(True)

servers = []
manager = base.ManagerBase(Target(topic='agent', namespace='manager'))
rpc_server = LauncheRpcServiceBase(manager)
wsgi_wrapper = ServerWrapper(rpc_server, workers=1)
servers.append(wsgi_wrapper)
launch(servers)