예제 #1
0
def main(component_name=None):

    log.info('Loading component configuration...')
    file_dir = os.path.dirname(os.path.realpath(__file__))
    component_cfgs = utils.load_component_cfgs(file_dir)

    def index(name, func):
        path = component_cfgs['components'][name]
        if path and os.path.isdir(path):
            log.info('Indexing component: %s...', name)
            func(file_dir, component_cfgs)

    # Index components

    components = {
        'cpuvisor-srv': index_cpuvisor,
        'limas': index_limas
    }

    if not component_name:
        log.info('Indexing all components...')
        for name, func in components.iteritems():
            index(name, func)
    else:
        if component_name not in components:
            raise RuntimeError('Could not find component: %s' % component_name)
        index(component_name, components[component_name])
예제 #2
0
def main(component_name=None):

    log.info('Loading component configuration...')
    file_dir = os.path.dirname(os.path.realpath(__file__))
    component_cfgs = utils.load_component_cfgs(file_dir)

    def prepare(name, func):
        path = component_cfgs['components'][name]
        if path and os.path.isdir(path):
            log.info('Preparing component: %s...', name)
            func(file_dir, component_cfgs)

    # Prepare components

    components = {
        'cpuvisor-srv': prepare_cpuvisor,
        'limas': prepare_limas,
        'axes-home': prepare_axes_home,
        'axes-research': prepare_axes_research,
        'imsearch-tools': prepare_imsearch_tools,
        'nginx': prepare_nginx
    }

    if not component_name:
        log.info('Linking all components...')
        for name, func in components.iteritems():
            prepare(name, func)

        # Prepare nginx config
        prepare_nginx(file_dir, component_cfgs)

        # Prepare screen-based launch script
        prepare_start_script(file_dir, component_cfgs)

        # Prepare supervisor
        prepare_supervisor(file_dir, component_cfgs)

    else:
        if component_name not in components:
            raise RuntimeError('Could not find component: %s' % component_name)
        prepare(component_name, components[component_name])
예제 #3
0
def main(component_name=None):

    log.info('Loading component configuration...')
    file_dir = os.path.dirname(os.path.realpath(__file__))
    component_cfgs = utils.load_component_cfgs(file_dir)

    def prepare(name, func):
        path = component_cfgs['components'][name]
        if path and os.path.isdir(path):
            log.info('Preparing component: %s...', name)
            func(file_dir, component_cfgs)

    # Prepare components

    components = {
        'cpuvisor-srv': prepare_cpuvisor,
        'limas': prepare_limas,
        'axes-home': prepare_axes_home,
        'axes-research': prepare_axes_research,
        'imsearch-tools': prepare_imsearch_tools,
        'nginx': prepare_nginx
    }

    if not component_name:
        log.info('Linking all components...')
        for name, func in components.iteritems():
            prepare(name, func)

        # Prepare nginx config
        prepare_nginx(file_dir, component_cfgs)

        # Prepare screen-based launch script
        prepare_start_script(file_dir, component_cfgs)

        # Prepare supervisor
        prepare_supervisor(file_dir, component_cfgs)

    else:
        if component_name not in components:
            raise RuntimeError('Could not find component: %s' % component_name)
        prepare(component_name, components[component_name])