Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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.")
Exemple #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.")
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)