Skip to content

Commit

Permalink
Merge branch 'main' into temp-logs-in-superexec
Browse files Browse the repository at this point in the history
  • Loading branch information
Moep90 committed Jul 17, 2024
2 parents f1d5b7c + e737515 commit b16d9f8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/py/flwr/client/supernode/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run_supernode() -> None:
authentication_keys=authentication_keys,
max_retries=args.max_retries,
max_wait_time=args.max_wait_time,
node_config=parse_config_args(args.node_config),
node_config=parse_config_args([args.node_config]),
flwr_path=get_flwr_dir(args.flwr_dir),
)

Expand Down Expand Up @@ -107,7 +107,7 @@ def run_client_app() -> None:

_start_client_internal(
server_address=args.superlink,
node_config=parse_config_args(args.node_config),
node_config=parse_config_args([args.node_config]),
load_client_app_fn=load_fn,
transport=args.transport,
root_certificates=root_certificates,
Expand Down
25 changes: 13 additions & 12 deletions src/py/flwr/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,18 @@ def parse_config_args(
return overrides

for config_line in config:
overrides_list = config_line.split(separator)
if (
len(overrides_list) == 1
and "=" not in overrides_list
and overrides_list[0].endswith(".toml")
):
with Path(overrides_list[0]).open("rb") as config_file:
overrides = flatten_dict(tomli.load(config_file))
else:
for kv_pair in overrides_list:
key, value = kv_pair.split("=")
overrides[key] = value
if config_line:
overrides_list = config_line.split(separator)
if (
len(overrides_list) == 1
and "=" not in overrides_list
and overrides_list[0].endswith(".toml")
):
with Path(overrides_list[0]).open("rb") as config_file:
overrides = flatten_dict(tomli.load(config_file))
else:
for kv_pair in overrides_list:
key, value = kv_pair.split("=")
overrides[key] = value

return overrides
2 changes: 1 addition & 1 deletion src/py/flwr/simulation/run_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def run_simulation_from_cli() -> None:
client_app_attr = app_components["clientapp"]
server_app_attr = app_components["serverapp"]

override_config = parse_config_args(args.run_config)
override_config = parse_config_args([args.run_config])
fused_config = get_fused_config_from_dir(app_path, override_config)
app_dir = args.app
is_app = True
Expand Down
2 changes: 1 addition & 1 deletion src/py/flwr/superexec/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def run_superexec() -> None:
address=address,
executor=_load_executor(args),
certificates=certificates,
config=parse_config_args(args.executor_config),
config=parse_config_args([args.executor_config]),
)

grpc_servers = [superexec_server]
Expand Down

0 comments on commit b16d9f8

Please sign in to comment.