Skip to content

Commit de9c7e6

Browse files
authored
Merge pull request #927 from fedml-alex/dev/v0.7.0
[CoreEngine] attach the logs to new run id when starting a new run or model deployment.
2 parents a7bb3de + 68278b6 commit de9c7e6

File tree

7 files changed

+13
-3
lines changed

7 files changed

+13
-3
lines changed

python/fedml/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
_global_training_type = None
2424
_global_comm_backend = None
2525

26-
__version__ = "0.8.3a19"
26+
__version__ = "0.8.3a21"
2727

2828

2929
def init(args=None):

python/fedml/cli/edge_deployment/client_runner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,8 @@ def callback_start_train(self, topic, payload):
722722

723723
# Start log processor for current run
724724
self.args.run_id = run_id
725+
self.args.edge_id = self.edge_id
726+
MLOpsRuntimeLog.get_instance(self.args).init_logs(show_stdout_log=True)
725727
logging.info("start the log processor")
726728
MLOpsRuntimeLogDaemon.get_instance(self.args).start_log_processor(run_id, self.edge_id)
727729

python/fedml/cli/model_deployment/device_client_runner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ def callback_start_deployment(self, topic, payload):
576576
# Start log processor for current run
577577
run_id = inference_end_point_id
578578
self.args.run_id = run_id
579+
self.args.edge_id = self.edge_id
580+
MLOpsRuntimeLog.get_instance(self.args).init_logs(show_stdout_log=True)
579581
MLOpsRuntimeLogDaemon.get_instance(self.args).set_log_source(
580582
ClientConstants.FEDML_LOG_SOURCE_TYPE_MODEL_END_POINT)
581583
MLOpsRuntimeLogDaemon.get_instance(self.args).start_log_processor(run_id, self.edge_id)

python/fedml/cli/model_deployment/device_server_runner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,10 +698,12 @@ def callback_start_deployment(self, topic, payload):
698698
inference_end_point_id = run_id
699699

700700
# Start log processor for current run
701+
self.args.run_id = run_id
702+
self.args.edge_id = self.edge_id
703+
MLOpsRuntimeLog.get_instance(self.args).init_logs(show_stdout_log=True)
701704
MLOpsRuntimeLogDaemon.get_instance(self.args).set_log_source(
702705
ServerConstants.FEDML_LOG_SOURCE_TYPE_MODEL_END_POINT)
703706
MLOpsRuntimeLogDaemon.get_instance(self.args).start_log_processor(run_id, self.edge_id)
704-
self.args.run_id = run_id
705707

706708
self.ota_upgrade(payload, request_json)
707709

python/fedml/cli/server_deployment/server_runner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,9 @@ def callback_start_train(self, topic=None, payload=None):
688688
if self.run_as_edge_server_and_agent:
689689
# Start log processor for current run
690690
logging.info("start the log processor.")
691+
self.args.run_id = run_id
692+
self.args.edge_id = self.edge_id
693+
MLOpsRuntimeLog.get_instance(self.args).init_logs(show_stdout_log=True)
691694
MLOpsRuntimeLogDaemon.get_instance(self.args).start_log_processor(run_id, self.edge_id)
692695

693696
if not self.run_as_cloud_agent and not self.run_as_cloud_server:

python/fedml/core/mlops/mlops_runtime_log.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def log_ntp_time(sec, what):
128128
else:
129129
stdout_handle.setLevel(logging.CRITICAL)
130130
self.logger.setLevel(logging.CRITICAL)
131+
self.logger.handlers.clear()
131132
self.logger.addHandler(stdout_handle)
132133
if hasattr(self, "should_write_log_file") and self.should_write_log_file:
133134
when = 'D'

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def finalize_options(self):
8989

9090
setup(
9191
name="fedml",
92-
version="0.8.3a19",
92+
version="0.8.3a21",
9393
author="FedML Team",
9494
author_email="[email protected]",
9595
description="A research and production integrated edge-cloud library for "

0 commit comments

Comments
 (0)