Skip to content

Commit

Permalink
Revert "--proxy flag added"
Browse files Browse the repository at this point in the history
This reverts commit f75159c.
  • Loading branch information
sowmyasris committed Aug 12, 2024
1 parent f75159c commit 99feaeb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
6 changes: 1 addition & 5 deletions fedn/cli/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -205,7 +204,6 @@ def client_cmd(
secure,
preshared_cert,
verify,
grpc_proxy,
combiner,
validator,
trainer,
Expand All @@ -226,7 +224,6 @@ def client_cmd(
:param secure:
:param preshared_cert:
:param verify_cert:
:param grpc_proxy:
:param combiner:
:param init:
:param logfile:
Expand All @@ -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,
Expand Down
20 changes: 7 additions & 13 deletions fedn/network/clients/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions fedn/network/clients/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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://"
Expand Down

0 comments on commit 99feaeb

Please sign in to comment.