Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(framework) Make argparse processing the first action of SuperNode and SuperLink #4332

Merged
merged 4 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/py/flwr/client/supernode/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,13 @@

def run_supernode() -> None:
"""Run Flower SuperNode."""
args = _parse_args_run_supernode().parse_args()
_warn_deprecated_server_arg(args)

log(INFO, "Starting Flower SuperNode")

event(EventType.RUN_SUPERNODE_ENTER)

args = _parse_args_run_supernode().parse_args()

_warn_deprecated_server_arg(args)

# Check if both `--flwr-dir` and `--isolation` were set
if args.flwr_dir is not None and args.isolation is not None:
log(
Expand Down Expand Up @@ -186,12 +185,12 @@ def _parse_args_run_supernode() -> argparse.ArgumentParser:
"--flwr-dir",
default=None,
help="""The path containing installed Flower Apps.
By default, this value is equal to:
The default directory is:

- `$FLWR_HOME/` if `$FLWR_HOME` is defined
- `$XDG_DATA_HOME/.flwr/` if `$XDG_DATA_HOME` is defined
- `$HOME/.flwr/` in all other cases
""",
""",
)
parser.add_argument(
"--isolation",
Expand Down
4 changes: 2 additions & 2 deletions src/py/flwr/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ def start_server( # pylint: disable=too-many-arguments,too-many-locals
# pylint: disable=too-many-branches, too-many-locals, too-many-statements
def run_superlink() -> None:
"""Run Flower SuperLink (Driver API and Fleet API)."""
args = _parse_args_run_superlink().parse_args()

log(INFO, "Starting Flower SuperLink")

event(EventType.RUN_SUPERLINK_ENTER)

args = _parse_args_run_superlink().parse_args()

# Parse IP address
driver_address, _, _ = _format_address(args.driver_api_address)

Expand Down