Skip to content

Commit

Permalink
Make client-app arg optional for flower-supernode CLI (#3305)
Browse files Browse the repository at this point in the history
  • Loading branch information
panh99 authored Apr 22, 2024
1 parent 117a284 commit af1db12
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/py/flwr/client/supernode/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ def run_supernode() -> None:

event(EventType.RUN_SUPERNODE_ENTER)

args = _parse_args_run_supernode().parse_args()
_ = _parse_args_run_supernode().parse_args()

log(
DEBUG,
"Flower will load ClientApp `%s`",
getattr(args, "client-app"),
"Flower SuperNode starting...",
)

# Graceful shutdown
Expand All @@ -48,7 +47,16 @@ def _parse_args_run_supernode() -> argparse.ArgumentParser:
description="Start a Flower SuperNode",
)

parse_args_run_client_app(parser=parser)
parser.add_argument(
"client-app",
nargs="?",
default="",
help="For example: `client:app` or `project.package.module:wrapper.app`. "
"This is optional and serves as the default ClientApp to be loaded when "
"the ServerApp does not specify `fab_id` and `fab_version`. "
"If not provided, defaults to an empty string.",
)
_parse_args_common(parser)

return parser

Expand All @@ -59,6 +67,10 @@ def parse_args_run_client_app(parser: argparse.ArgumentParser) -> None:
"client-app",
help="For example: `client:app` or `project.package.module:wrapper.app`",
)
_parse_args_common(parser)


def _parse_args_common(parser: argparse.ArgumentParser) -> None:
parser.add_argument(
"--insecure",
action="store_true",
Expand Down

0 comments on commit af1db12

Please sign in to comment.