diff --git a/fedn/cli/run_cmd.py b/fedn/cli/run_cmd.py index b31ee781a..2f4afc6b1 100644 --- a/fedn/cli/run_cmd.py +++ b/fedn/cli/run_cmd.py @@ -182,8 +182,7 @@ def build_cmd(ctx, path): @click.option("-s", "--secure", required=False, default=False) @click.option("-pc", "--preshared-cert", required=False, default=False) @click.option("-v", "--verify", is_flag=True, help="Verify SSL/TLS for REST service") -@click.option("-g", "--grpc-proxy", required=False, type=str,default=None,help="url to the combiner") -@click.option("-c", "--combiner", required=False,type=str, default="combiner",help="url to the combiner or name of the preferred combiner") +@click.option("-c", "--combiner", required=False,type=str, default="combiner",help="name of the preferred combiner") @click.option("-va", "--validator", required=False, default=True) @click.option("-tr", "--trainer", required=False, default=True) @click.option("-in", "--init", required=False, default=None, help="Set to a filename to (re)init client from file state.") @@ -205,7 +204,6 @@ def client_cmd( secure, preshared_cert, verify, - grpc_proxy, combiner, validator, trainer, @@ -226,7 +224,6 @@ def client_cmd( :param secure: :param preshared_cert: :param verify_cert: - :param grpc_proxy: :param combiner: :param init: :param logfile: @@ -248,7 +245,6 @@ def client_cmd( "secure": secure, "preshared_cert": preshared_cert, "verify": verify, - "grpc_proxy":grpc_proxy, "preferred_combiner": combiner, "validator": validator, "trainer": trainer, diff --git a/fedn/network/clients/client.py b/fedn/network/clients/client.py index 469a319b5..e594d7b6d 100644 --- a/fedn/network/clients/client.py +++ b/fedn/network/clients/client.py @@ -64,6 +64,7 @@ def __init__(self, config): set_log_stream(config.get("logfile", None)) self.id = config["client_id"] or str(uuid.uuid4()) + self.connector = ConnectorClient( host=config["discover_host"], port=config["discover_port"], @@ -72,11 +73,10 @@ def __init__(self, config): remote_package=config["remote_compute_context"], force_ssl=config["force_ssl"], verify=config["verify"], - grpc_proxy=config["grpc_proxy"], combiner=config["preferred_combiner"], id=self.id, ) - print(self.connector) + # Validate client name match = re.search(VALID_NAME_REGEX, config["name"]) if not match: @@ -181,20 +181,14 @@ def connect(self, combiner_config): :param combiner_config: connection information for the combiner. :type combiner_config: dict """ - print("cobinerrrr config",combiner_config) if self._connected: logger.info("Client is already attached. ") return - if combiner_config["grpc_proxy"] is not None: - # TODO use the combiner_config['certificate'] for setting up secure comms' - host = combiner_config["grpc_proxy"] - # Add host to gRPC metadata - self._add_grpc_metadata("grpc-server", combiner_config["combiner"]) - else: - # TODO use the combiner_config['certificate'] for setting up secure comms' - host = combiner_config["combiner"] - # Add host to gRPC metadata - self._add_grpc_metadata("grpc-server", combiner_config["combiner"]) + + # TODO use the combiner_config['certificate'] for setting up secure comms' + host = combiner_config["host"] + # Add host to gRPC metadata + self._add_grpc_metadata("grpc-server", host) logger.debug("Client using metadata: {}.".format(self.metadata)) port = combiner_config["port"] secure = False diff --git a/fedn/network/clients/connect.py b/fedn/network/clients/connect.py index 52c00ef6e..2b5a10387 100644 --- a/fedn/network/clients/connect.py +++ b/fedn/network/clients/connect.py @@ -44,16 +44,16 @@ class ConnectorClient: :param id: id of client """ - def __init__(self, host, port, token, name, remote_package, force_ssl=False, verify=False, grpc_proxy=None,combiner=None, id=None): + def __init__(self, host, port, token, name, remote_package, force_ssl=False, verify=False, combiner=None, id=None): self.host = host self.port = port self.token = token self.name = name self.verify = verify - self.grpc_proxy=grpc_proxy self.preferred_combiner = combiner self.id = id self.package = "remote" if remote_package else "local" + # for https we assume a an ingress handles permanent redirect (308) if force_ssl: self.prefix = "https://"