Exemplo n.º 1
0
def cmd_join(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    response = client.join_experiment(args.id, args.peer_id, args.peer_path)
    if response.type == 'rq_ok':
        pass
    disp.view(response)
Exemplo n.º 2
0
def cmd_join(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    response = client.join_experiment(args.id, args.peer_id, args.peer_path)
    if response.type == 'rq_ok':
        pass
    disp.view(response)
Exemplo n.º 3
0
def cmd_new(args):
    if args.launch_file:
        launch_f = os.path.abspath(args.launch_file)
    else:
        launch_f = ''
    client = client_server_prep()
    if not client:
        sys.exit(1)
    response = client.send_create_experiment(launch_f, args.sandbox_dir, args.name)
    disp.view(response)
Exemplo n.º 4
0
def cmd_info(args):
    client = client_server_prep(start_srv=False)
    if not client:
        sys.exit(1)
    if not args.experiment:
        response = client.send_list_experiments()
    else:
        response = client.get_experiment_details(args.experiment, args.peer_id)
    if response is None:
        response = "whyyyy"
    disp.view(response)
Exemplo n.º 5
0
def cmd_new(args):
    if args.launch_file:
        launch_f = os.path.abspath(args.launch_file)
    else:
        launch_f = ''
    client = client_server_prep()
    if not client:
        sys.exit(1)
    response = client.send_create_experiment(launch_f, args.sandbox_dir,
                                             args.name)
    disp.view(response)
Exemplo n.º 6
0
def cmd_info(args):
    client = client_server_prep(start_srv=False)
    if not client:
        sys.exit(1)
    if not args.experiment:
        response = client.send_list_experiments()
    else:
        response = client.get_experiment_details(args.experiment, args.peer_id)
    if response is None:
        response = "whyyyy"
    disp.view(response)
Exemplo n.º 7
0
def cmd_config(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    ovr = dict(local_params=args.local_params,
               external_params=args.external_params,
               launch_dependencies=args.launch_dependencies,
               config_sources=args.config_sources)

    response = client.configure_peer(args.experiment, args.peer_id, ovr,
                                     args.config_file)
    disp.view(response)
Exemplo n.º 8
0
def cmd_config(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    ovr = dict(local_params=args.local_params,
               external_params=args.external_params,
               launch_dependencies=args.launch_dependencies,
               config_sources=args.config_sources)

    response = client.configure_peer(args.experiment, args.peer_id, ovr,
                                     args.config_file)
    disp.view(response)
Exemplo n.º 9
0
def cmd_tail(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    if not args.e:
        response = client.send_list_experiments()
    elif not args.p:
        response = client.get_experiment_details(args.e, args.p)
    else:
        response = client.get_tail(args.e, args.p, args.l)
    if response is None:
        response = "whyyyy"
    disp.view(response)
Exemplo n.º 10
0
def cmd_tail(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    if not args.e:
        response = client.send_list_experiments()
    elif not args.p:
        response = client.get_experiment_details(args.e, args.p)
    else:
        response = client.get_tail(args.e, args.p, args.l)
    if response is None:
        response = "whyyyy"
    disp.view(response)
Exemplo n.º 11
0
def cmd_morph(args):
    launch_f = os.path.abspath(args.launch_file)
    overwrites = args.ovr
    if overwrites:
        pack = peer_cmd.peer_overwrites_pack(overwrites)
        print(pack)
    else:
        pack = None

    client = client_server_prep()
    if not client:
        sys.exit(1)
    print(args.leave_on)
    response = client.morph(args.experiment, launch_f, args.name, pack, args.leave_on)
    disp.view(response)
Exemplo n.º 12
0
def cmd_launch(args):
    launch_f = os.path.abspath(args.launch_file)
    overwrites = args.ovr
    if overwrites:
        pack = peer_cmd.peer_overwrites_pack(overwrites)
        print(pack)
    else:
        pack = None

    client = client_server_prep(start_srv=False)
    if not client:
        sys.exit(1)

    response = client.launch(launch_f, args.sandbox_dir, args.name, pack)
    disp.view(response)
Exemplo n.º 13
0
def cmd_launch(args):
    launch_f = os.path.abspath(args.launch_file)
    overwrites = args.ovr
    if overwrites:
        pack = peer_cmd.peer_overwrites_pack(overwrites)
        print(pack)
    else:
        pack = None

    client = client_server_prep(start_srv=False)
    if not client:
        sys.exit(1)

    response = client.launch(launch_f, args.sandbox_dir, args.name, pack)
    disp.view(response)
Exemplo n.º 14
0
def cmd_morph(args):
    launch_f = os.path.abspath(args.launch_file)
    overwrites = args.ovr
    if overwrites:
        pack = peer_cmd.peer_overwrites_pack(overwrites)
        print(pack)
    else:
        pack = None

    client = client_server_prep()
    if not client:
        sys.exit(1)
    print(args.leave_on)
    response = client.morph(args.experiment, launch_f, args.name, pack,
                            args.leave_on)
    disp.view(response)
Exemplo n.º 15
0
def cmd_srv_kill(args):
    running = server_process_running(expected_dead=True)
    if not running:
        disp.view("Server was not running...")
        return

    client = client_server_prep()
    if not client:
        print("srv_kill unsuccessful (client creation error)")
        sys.exit(1)
    client.srv_kill()

    if server_process_running(expected_dead=True):
        disp.view('obci server kill signal unsuccesful, try killing the process')
    else:
        disp.view("Server process terminated.")
Exemplo n.º 16
0
def cmd_srv_kill(args):
    running = server_process_running(expected_dead=True)
    if not running:
        disp.view("Server was not running...")
        return

    client = client_server_prep()
    if not client:
        print("srv_kill unsuccessful (client creation error)")
        sys.exit(1)
    client.srv_kill()

    if server_process_running(expected_dead=True):
        disp.view(
            'obci server kill signal unsuccesful, try killing the process')
    else:
        disp.view("Server process terminated.")
Exemplo n.º 17
0
def cmd_kill(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    response = client.kill_exp(args.id)
    disp.view(response)
Exemplo n.º 18
0
def cmd_start(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    response = client.start_chosen_experiment(args.experiment)
    disp.view(response)
Exemplo n.º 19
0
def cmd_kill(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    response = client.kill_exp(args.id)
    disp.view(response)
Exemplo n.º 20
0
def cmd_start(args):
    client = client_server_prep()
    if not client:
        sys.exit(1)
    response = client.start_chosen_experiment(args.experiment)
    disp.view(response)