Commit 96d0c457 authored by Daniele Venzano's avatar Daniele Venzano

Add sample supervisor config files

Add options to run the client without rpyc autodiscovery
parent c033c1c5
[program:rpyc-registry]
command=/usr/local/bin/rpyc_registry.py
directory=/tmp
autostart=true
autorestart=true
startretries=3
stderr_logfile=/var/log/rpyc/registry.err.log
stdout_logfile=/var/log/rpyc/registry.out.log
user=ubuntu
[program:zoe-scheduler]
command=/usr/bin/python3 /home/ubuntu/zoe/zoe-scheduler.py
directory=/home/ubuntu/zoe
autostart=true
autorestart=true
startretries=3
stderr_logfile=/var/log/zoe/scheduler.err.log
stdout_logfile=/var/log/zoe/scheduler.out.log
user=ubuntu
[program:zoe-web]
command=/usr/bin/python3 /home/ubuntu/zoe/zoe-web.py
directory=/home/ubuntu/zoe
autostart=true
autorestart=true
startretries=3
stderr_logfile=/var/log/zoe/web.err.log
stdout_logfile=/var/log/zoe/web.out.log
user=ubuntu
......@@ -20,8 +20,11 @@ NOTEBOOK_IMAGE = REGISTRY + "/zoe/spark-notebook-1.4.1:1.2"
class ZoeClient:
def __init__(self):
self.server_connection = rpyc.connect_by_service("ZoeSchedulerRPC")
def __init__(self, rpyc_server=None, rpyc_port=4000):
if rpyc_server is None:
self.server_connection = rpyc.connect_by_service("ZoeSchedulerRPC")
else:
self.server_connection = rpyc.connect(rpyc_server, rpyc_port)
self.server = self.server_connection.root
self.state = AlchemySession()
......
......@@ -7,6 +7,17 @@ from zipfile import is_zipfile
from zoe_client import ZoeClient
from common.state import create_tables
argparser = None
def get_zoe_client(args):
if args.rpyc_server is None:
return ZoeClient()
if args.rpyc_server is not None and args.rpyc_port is None:
return ZoeClient(args.rpyc_server)
else:
return ZoeClient(args.rpyc_server, args.rpyc_port)
def status_cmd(_):
client = ZoeClient()
......@@ -121,6 +132,8 @@ def log_get_cmd(args):
def process_arguments() -> Namespace:
argparser = ArgumentParser(description="Zoe - Container Analytics as a Service command-line client")
argparser.add_argument('-d', '--debug', action='store_true', default=False, help='Enable debug output')
argparser.add_argument('--rpyc-server', default=None, help='Specify an RPyC server instead of using autodiscovery')
argparser.add_argument('--rpyc-port', default=4000, type=int, help='Specify an RPyC server port, default is 4000')
subparser = argparser.add_subparsers(title='subcommands', description='valid subcommands')
argparser_status = subparser.add_parser('status', help="Show the platform status")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment