def serve(): 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("0.0.0.0", 9360)) server.start() try: while True: time.sleep(10) except KeyboardInterrupt: server.stop(0)
help="if standalone node mode or not ", action='store_true') args = parser.parse_args() RuntimeConfig.init_env() RuntimeConfig.set_process_role(ProcessRole.DRIVER) PrivilegeAuth.init() ServiceUtils.register() ResourceManager.initialize() Detector(interval=5 * 1000).start() DAGScheduler(interval=2 * 1000).start() 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( UnaryService(), server) server.add_insecure_port("{}:{}".format(IP, GRPC_PORT)) server.start() # start http server try: run_simple(hostname=IP, port=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: