diff --git a/e2e/test_driver.sh b/e2e/test_driver.sh index ca54dbf4852f..32314bd22533 100755 --- a/e2e/test_driver.sh +++ b/e2e/test_driver.sh @@ -16,10 +16,10 @@ esac timeout 2m flower-server $server_arg & sleep 3 -timeout 2m flower-client $client_arg --callable client:flower --server 127.0.0.1:9092 & +timeout 2m flower-client client:flower $client_arg --server 127.0.0.1:9092 & sleep 3 -timeout 2m flower-client $client_arg --callable client:flower --server 127.0.0.1:9092 & +timeout 2m flower-client client:flower $client_arg --server 127.0.0.1:9092 & sleep 3 timeout 2m python driver.py & diff --git a/examples/mt-pytorch-callable/README.md b/examples/mt-pytorch-callable/README.md index 65ef000c26f2..120e28098344 100644 --- a/examples/mt-pytorch-callable/README.md +++ b/examples/mt-pytorch-callable/README.md @@ -33,13 +33,13 @@ flower-server --insecure In a new terminal window, start the first long-running Flower client: ```bash -flower-client --callable client:flower +flower-client --insecure client:flower ``` In yet another new terminal window, start the second long-running Flower client: ```bash -flower-client --callable client:flower +flower-client --insecure client:flower ``` ## Start the Driver script diff --git a/examples/mt-pytorch-callable/client.py b/examples/mt-pytorch-callable/client.py index 6f9747784ae0..4195a714ca89 100644 --- a/examples/mt-pytorch-callable/client.py +++ b/examples/mt-pytorch-callable/client.py @@ -108,7 +108,7 @@ def client_fn(cid: str): return FlowerClient().to_client() -# To run this: `flower-client --callable client:flower` +# To run this: `flower-client client:flower` flower = fl.flower.Flower( client_fn=client_fn, ) diff --git a/src/py/flwr/client/app.py b/src/py/flwr/client/app.py index 3448e18e20c5..2a2f067c2823 100644 --- a/src/py/flwr/client/app.py +++ b/src/py/flwr/client/app.py @@ -74,10 +74,10 @@ def run_client() -> None: print(args.root_certificates) print(args.server) - print(args.callable_dir) + print(args.dir) print(args.callable) - callable_dir = args.callable_dir + callable_dir = args.dir if callable_dir is not None: sys.path.insert(0, callable_dir) @@ -101,6 +101,10 @@ def _parse_args_client() -> argparse.ArgumentParser: description="Start a long-running Flower client", ) + parser.add_argument( + "callable", + help="For example: `client:flower` or `project.package.module:wrapper.flower`", + ) parser.add_argument( "--insecure", action="store_true", @@ -120,13 +124,10 @@ def _parse_args_client() -> argparse.ArgumentParser: help="Server address", ) parser.add_argument( - "--callable", - help="For example: `client:flower` or `project.package.module:wrapper.flower`", - ) - parser.add_argument( - "--callable-dir", + "--dir", default="", - help="Add specified directory to the PYTHONPATH and load callable from there." + help="Add specified directory to the PYTHONPATH and load Flower " + "callable from there." " Default: current working directory.", )