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

Fixed the args.log_config setting. #86

Merged
merged 2 commits into from
Jan 5, 2022
Merged
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
17 changes: 10 additions & 7 deletions nvflare/private/fed/app/client/worker_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@

"""Provides a command line interface for a federated client trainer"""

import traceback

import argparse
import os
import sys
import traceback

from nvflare.apis.fl_constant import FLContextKey
from nvflare.apis.workspace import Workspace
Expand Down Expand Up @@ -57,7 +56,6 @@ def main():
args.client_config = os.path.join(config_folder, "config_fed_client.json")
args.config_folder = config_folder
args.env = os.path.join("config", "environment.json")
args.log_config = None

try:
remove_restart_file(args)
Expand Down Expand Up @@ -90,12 +88,19 @@ def main():
)
)

workspace = os.path.join("/tmp/fl", client_name) # TODO: find a way to replace "/tmp/fl"
workspace = os.path.join("/tmp/fl", client_name)
app_root = os.path.join(args.workspace, "run_" + str(run_number), "app_" + client_name)

app_log_config = os.path.join(app_root, config_folder, "log.config")
if os.path.exists(app_log_config):
args.log_config = app_log_config
else:
args.log_config = os.path.join(workspace, "log.config")

conf = FLClientStarterConfiger(
app_root=workspace,
client_config_file_name=args.fed_client,
log_config_file_name=os.path.join(workspace, "log.config"),
log_config_file_name=args.log_config,
kv_list=args.set,
)
conf.configure()
Expand All @@ -110,8 +115,6 @@ def main():
federated_client.fl_ctx.set_prop(EngineConstant.FL_TOKEN, token, private=False)
federated_client.fl_ctx.set_prop(FLContextKey.WORKSPACE_ROOT, args.workspace, private=True)

app_root = os.path.join(args.workspace, "run_" + str(run_number), "app_" + client_name)

client_config_file_name = os.path.join(app_root, args.client_config)
conf = ClientJsonConfigurator(
config_file_name=client_config_file_name,
Expand Down