Esempio n. 1
0
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'glare')

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create(
                "Messaging", oslo_messaging, {}, notification.get_transport(),
                "glare", "artifacts", cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server(initialize_glance_store=True)
        server.start(config.load_paste_app('glare-api'), default_port=9494)
        server.wait()
    except KNOWN_EXCEPTIONS as e:
        fail(e)
Esempio n. 2
0
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'glare')
        notification.set_defaults()

        if CONF.profiler.enabled:
            initializer.init_from_conf(
                conf=CONF,
                context={},
                project="glare",
                service="api",
                host=CONF.bind_host
            )

        server = wsgi.Server(initialize_glance_store=True)
        server.start(config.load_paste_app('glare-api'), default_port=9494)
        server.wait()
    except KNOWN_EXCEPTIONS as e:
        fail(e)
Esempio n. 3
0
    uwsgi --module glare.wsgi:application --socket 127.0.0.1:8008

Sample apache mod_wsgi configuration:

    <VirtualHost *:80>
         ServerName example.com
         SetEnv GLARE_CONFIG_FILE=/etc/glare/glare.conf
         DocumentRoot /path/to/public_html/
         WSGIScriptAlias / /usr/lib/python2.7/site-packages/glare/wsgi.py
         ...
    </VirtualHost>

"""

import os

from oslo_config import cfg
from oslo_log import log as logging

from glare.common import config
from glare.common import utils

CONF = cfg.CONF
logging.register_options(CONF)
CONFIG_FILE = os.environ.get("GLARE_CONFIG_FILE", "etc/glare.conf")
config.parse_args(args=["--config-file", CONFIG_FILE])

utils.initialize_glance_store()

application = config.load_paste_app('glare-api')