Ejemplo n.º 1
0
    PrivilegeAuth.init()
    ServiceUtils.register()
    # start job detector
    job_detector.JobDetector(interval=5 * 1000).start()
    # start scheduler
    scheduler = dag_scheduler.DAGScheduler(
        queue=RuntimeConfig.JOB_QUEUE, concurrent_num=MAX_CONCURRENT_JOB_RUN)
    scheduler.start()
    # start grpc server
    server = grpc.server(
        futures.ThreadPoolExecutor(max_workers=10),
        options=[(cygrpc.ChannelArgKey.max_send_message_length, -1),
                 (cygrpc.ChannelArgKey.max_receive_message_length, -1)])

    proxy_pb2_grpc.add_DataTransferServiceServicer_to_server(
        UnaryServicer(), server)
    server.add_insecure_port("{}:{}".format(IP, GRPC_PORT))
    server.start()
    # start http server
    try:
        run_simple(hostname=IP,
                   port=RuntimeConfig.HTTP_PORT,
                   application=app,
                   threaded=True)
        stat_logger.info("FATE Flow server start Successfully")
    except OSError as e:
        traceback.print_exc()
        os.kill(os.getpid(), signal.SIGKILL)
    except Exception as e:
        traceback.print_exc()
        os.kill(os.getpid(), signal.SIGKILL)
Ejemplo n.º 2
0
    queue_manager.init_job_queue()
    job_controller.JobController.init()
    PrivilegeAuth.init()
    CenterConfig.init(ZOOKEEPER_HOSTS, USE_CONFIGURATION_CENTER, FATE_FLOW_ZK_PATH, HTTP_PORT,
                      FATE_FLOW_MODEL_TRANSFER_PATH)
    # start job detector
    job_detector.JobDetector(interval=5 * 1000).start()
    # start scheduler
    scheduler = dag_scheduler.DAGScheduler(queue=RuntimeConfig.JOB_QUEUE, concurrent_num=MAX_CONCURRENT_JOB_RUN)
    scheduler.start()
    # start grpc server
    server = grpc.server(futures.ThreadPoolExecutor(max_workers=10),
                         options=[(cygrpc.ChannelArgKey.max_send_message_length, -1),
                                  (cygrpc.ChannelArgKey.max_receive_message_length, -1)])

    proxy_pb2_grpc.add_DataTransferServiceServicer_to_server(UnaryServicer(), server)
    server.add_insecure_port("{}:{}".format(IP, GRPC_PORT))
    server.start()
    # start http server
    try:
        run_simple(hostname=IP, port=RuntimeConfig.HTTP_PORT, application=app, threaded=True)
        stat_logger.info("FATE Flow server start Successfully")
    except OSError as e:
        traceback.print_exc()
        os.kill(os.getpid(), signal.SIGKILL)
    except Exception as e:
        traceback.print_exc()
        os.kill(os.getpid(), signal.SIGKILL)

    try:
        while True: