Exemplo n.º 1
0
def start_client(sg, wf, args):
    #
    # Instantiate a still client instance
    #

    if args.init is True:   # See if we were told to initiate the database
        sg.dbi.createdb()
        print("Database has been initialized")
        sys.exit(0)
    try:
        # Testing the database to make sure we made a connection, its fun..
        if sg.dbi.test_db() is False:
            print("Incorrect number of tables read from the database")
            sys.exit(1)
    except:
        print("We could not run a test on the database and are aborting.  Please check the DB config settings")
        sys.exit(1)

    print("My Log Path : %s") % sg.log_path
    sg.logger = setup_logger("Scheduler", "DEBUG", sg.log_path)
    task_clients = [TaskClient(sg.dbi, s, wf, sg.port, sg) for s in sg.hosts]

    # Screw it going to just break a bunch of the unittest stuff and simplify
    # the calling of the scheduler to take SpawnerClass
    myscheduler = StillScheduler(task_clients, wf, sg)  # Init scheduler daemon
    myscheduler.start(dbi=sg.dbi, ActionClass=Action)

    return 0
Exemplo n.º 2
0
def start_client(sg, wf, args):
    #
    # Instantiate a still client instance
    #

    if args.init is True:   # See if we were told to initiate the database
        sg.dbi.createdb()
        print("Database has been initialized")
        sys.exit(0)
    try:
        if sg.dbi.test_db() is False:  # Testing the database to make sure we made a connection, its fun..
            print("Incorrect number of tables read from the database")
            sys.exit(1)
    except:
        print("We could not run a test on the database and are aborting.  Please check the DB config settings")
        sys.exit(1)

    print("My Log Path : %s") % sg.log_path
    sg.logger = setup_logger("Scheduler", "DEBUG", sg.log_path)
    task_clients = [TaskClient(sg.dbi, s, wf, sg.port, sg) for s in sg.hosts]

    # Screw it going to just break a bunch of the unittest stuff and simplify the calling of the scheduler to take SpawnerClass
    myscheduler = StillScheduler(task_clients, wf, sg)  # Init scheduler daemon
    myscheduler.start(dbi=sg.dbi, ActionClass=Action)

    return 0
Exemplo n.º 3
0
def start_server(sg, wf, args):
    #
    # Instantiate a still server instance
    #
    if args.data_dir:
        mydata_dir = args.data_dir
    else:
        mydata_dir = sg.data_dir
    if args.port:
        my_port = int(args.port)
    else:
        my_port = sg.port
    sg.logger = setup_logger("TS", "DEBUG", sg.log_path)
    sg.preflight_check_ts(wf)

    task_server = TaskServer(sg.dbi, sg, data_dir=mydata_dir, port=my_port, path_to_do_scripts=sg.path_to_do_scripts, drmaa_shared=sg.drmaa_shared)
    task_server.start()
    return
Exemplo n.º 4
0
def start_server(sg, wf, args):
    #
    # Instantiate a still server instance
    #
    if args.data_dir:
        mydata_dir = args.data_dir
    else:
        mydata_dir = sg.data_dir
    if args.port:
        my_port = int(args.port)
    else:
        my_port = sg.port
    sg.logger = setup_logger("TS", "DEBUG", sg.log_path)
    sg.preflight_check_ts(wf)

    task_server = TaskServer(sg.dbi, sg, data_dir=mydata_dir, port=my_port, path_to_do_scripts=sg.path_to_do_scripts, drmaa_shared=sg.drmaa_shared)
    task_server.start()
    return