Example #1
0
def flower(*args, **kwargs):
    """
    Run Flower monitoring tool.
    """
    args = ('flower', ) + args
    flower_cmd = FlowerCommand(app=app)
    flower_cmd.execute_from_commandline(argv=args)
Example #2
0
def main():
    try:
        flower = FlowerCommand()
        flower.execute_from_commandline(argv=[__name__, '-A maestro.app', '--port=20000', '--address=127.0.0.1'])
    except:
        import sys
        print(bugreport(app=flower.app), file=sys.stderr)
        raise
Example #3
0
def main():
    try:
        flower = FlowerCommand()
        flower.execute_from_commandline()
    except Exception:
        import sys
        print(bugreport(app=flower.app), file=sys.stderr)
        raise
Example #4
0
def main():
    try:
        flower = FlowerCommand()
        flower.execute_from_commandline()
    except:
        import sys
        print(bugreport(), file=sys.stderr)
        raise
    def flowerStart(self, url="redis://localhost:9999/0"):
        from flower.command import FlowerCommand
        from flower.utils import bugreport

        flower = FlowerCommand()

        argv = ['flower.py', '--broker=%s' % url]

        flower.execute_from_commandline(argv=argv)
Example #6
0
    def flowerStart(self):
        from flower.command import FlowerCommand
        from flower.utils import bugreport

        flower = FlowerCommand()

        argv = ['flower.py', '--broker=%s' % self.url]

        flower.execute_from_commandline(argv=argv)
    def flowerStart(self,url="redis://localhost:9999/0"):
        from flower.command import FlowerCommand
        from flower.utils import bugreport

        flower = FlowerCommand()

        argv= ['flower.py', '--broker=%s'%url]
        

        flower.execute_from_commandline(argv=argv)
Example #8
0
    def flower_start(self):
        """
        js9 'c=j.clients.celery.get();c.flower_start()'
        """
        from flower.command import FlowerCommand
        from flower.utils import bugreport

        flower = FlowerCommand()

        argv = ['flower.py', '--broker=%s' % self.url]

        flower.execute_from_commandline(argv=argv)
def main():
    args = docopt(__doc__)
    app_options = ConfigParser.parse_config_file(SERVER_CONFIG_FILE)
    application = IUBackendService(app_options)
    application.connect()
    options.port = 8888
    try:
        flower = FlowerCommand(app=application.celery_app)
        flower.app = application.celery_app
        flower.execute_from_commandline()
    except:
        import sys
        print(bugreport(app=flower.app), file=sys.stderr)
        raise
def flower(args):
    """Starts Flower, Celery monitoring tool"""
    options = [
        conf.get('celery', 'BROKER_URL'),
        f"--address={args.hostname}",
        f"--port={args.port}",
    ]

    if args.broker_api:
        options.append(f"--broker-api={args.broker_api}")

    if args.url_prefix:
        options.append(f"--url-prefix={args.url_prefix}")

    if args.basic_auth:
        options.append(f"--basic-auth={args.basic_auth}")

    if args.flower_conf:
        options.append(f"--conf={args.flower_conf}")

    flower_cmd = FlowerCommand()

    if args.daemon:
        pidfile, stdout, stderr, _ = setup_locations(
            process="flower",
            pid=args.pid,
            stdout=args.stdout,
            stderr=args.stderr,
            log=args.log_file,
        )
        with open(stdout, "w+") as stdout, open(stderr, "w+") as stderr:
            ctx = daemon.DaemonContext(
                pidfile=TimeoutPIDLockFile(pidfile, -1),
                stdout=stdout,
                stderr=stderr,
            )
            with ctx:
                flower_cmd.execute_from_commandline(argv=options)
    else:
        flower_cmd.execute_from_commandline(argv=options)
Example #11
0
    Returns: args parsed

    """
    arg_solver = ArgumentParser(description=f'{server_name} server')
    arg_solver.add_argument('-c', '--config', required=True, help='Configuration file path')

    return vars(arg_solver.parse_args())


if __name__ == '__main__':
    args = args_parser('Flower')
    load_config(args['config'])
    if 'RABBIT_URL_PREFIX' in os.environ:
        broker_api = 'http://{user}:{password}@{host}:15672/' + os.environ.get('RABBIT_URL_PREFIX') + '/api/'
    else:
        broker_api = 'http://{user}:{password}@{host}:15672/api/'
    broker_url = 'amqp://{user}:{password}@{host}:{port}'
    flower_command = FlowerCommand()
    if 'URL_PREFIX' in os.environ:
        flower_command.execute_from_commandline(
            ['Nlp celery monitor', '--address=0.0.0.0',
             '--broker-api=' + broker_api.format(**config.rabbit),
             '--broker=' + broker_url.format(**config.rabbit),
             '--url_prefix=' + os.environ.get('URL_PREFIX')])
    else:
        flower_command.execute_from_commandline(
            ['Nlp celery monitor', '--address=0.0.0.0',
             '--broker-api=' + broker_api.format(**config.rabbit),
             '--broker=' + broker_url.format(**config.rabbit)])
Example #12
0
def main():
    flower = FlowerCommand()
    flower.execute_from_commandline()