def get_command_federation_channel(): engine = "PROXY" if get_base_config("independent_scheduling_proxy", False) else "EGGROLL" address = conf_utils.get_base_config(engine).get("address") channel = grpc.insecure_channel('{}:{}'.format(address.get("host"), address.get("port"))) stub = proxy_pb2_grpc.DataTransferServiceStub(channel) return engine, channel, stub
def get_command_federation_channel(): proxy_config = get_base_config("fateflow", {}).get("proxy", None) if isinstance(proxy_config, str): if proxy_config == CoordinateProxyService.rollsite: address = get_base_config("fate_on_eggroll", {}).get(proxy_config) elif proxy_config == CoordinateProxyService.nginx: address = get_base_config("fate_on_spark", {}).get(proxy_config) else: raise RuntimeError(f"can not support coordinate proxy {proxy_config}") elif isinstance(proxy_config, dict): address = proxy_config else: raise RuntimeError(f"can not support coordinate proxy config {proxy_config}") channel = grpc.insecure_channel('{}:{}'.format(address.get("host"), address.get("port"))) stub = proxy_pb2_grpc.DataTransferServiceStub(channel) return channel, stub
def get_command_federation_channel(host, port): print(f"connect {host}:{port}") channel = grpc.insecure_channel('{}:{}'.format(host, port)) stub = proxy_pb2_grpc.DataTransferServiceStub(channel) return channel, stub
def get_command_federation_channel(host, port): channel = grpc.insecure_channel(f"{host}:{port}") stub = proxy_pb2_grpc.DataTransferServiceStub(channel) return channel, stub
def get_proxy_data_channel(): channel = grpc.insecure_channel('{}:{}'.format(ServiceUtils.get_item("proxy", "host"), ServiceUtils.get_item("proxy", "port"))) stub = proxy_pb2_grpc.DataTransferServiceStub(channel) return channel, stub
def get_proxy_data_channel(): channel = grpc.insecure_channel('{}:{}'.format(PROXY_HOST, PROXY_PORT)) stub = proxy_pb2_grpc.DataTransferServiceStub(channel) return channel, stub
def get_proxy_data_channel(): channel = grpc.insecure_channel('{}:{}'.format("127.0.0.1", 9361)) stub = proxy_pb2_grpc.DataTransferServiceStub(channel) return channel, stub