(status, run_id=None)
| 240 | |
| 241 | |
| 242 | def log_aggregation_status(status, run_id=None): |
| 243 | if not mlops_enabled(MLOpsStore.mlops_args): |
| 244 | return |
| 245 | |
| 246 | if run_id is not None: |
| 247 | MLOpsStore.mlops_args.run_id = run_id |
| 248 | MLOpsStore.mlops_run_id = run_id |
| 249 | set_realtime_params() |
| 250 | |
| 251 | if not MLOpsStore.mlops_bind_result: |
| 252 | return |
| 253 | |
| 254 | logging.info("log aggregation status {}".format(status)) |
| 255 | |
| 256 | setup_log_mqtt_mgr() |
| 257 | if mlops_parrot_enabled(MLOpsStore.mlops_args): |
| 258 | device_role = "simulator" |
| 259 | else: |
| 260 | device_role = "server" |
| 261 | if mlops_parrot_enabled(MLOpsStore.mlops_args): |
| 262 | MLOpsStore.mlops_metrics.broadcast_server_training_status(MLOpsStore.mlops_run_id, status, role=device_role) |
| 263 | sys_utils.save_simulator_process(ClientConstants.get_data_dir(), |
| 264 | ClientConstants.LOCAL_RUNNER_INFO_DIR_NAME, os.getpid(), |
| 265 | str(MLOpsStore.mlops_run_id), |
| 266 | run_status=status) |
| 267 | |
| 268 | # Start log processor for current run |
| 269 | if status == ServerConstants.MSG_MLOPS_SERVER_STATUS_FINISHED or \ |
| 270 | status == ServerConstants.MSG_MLOPS_SERVER_STATUS_FAILED: |
| 271 | MLOpsRuntimeLogDaemon.get_instance(MLOpsStore.mlops_args).stop_log_processor(MLOpsStore.mlops_run_id, |
| 272 | MLOpsStore.mlops_edge_id) |
| 273 | else: |
| 274 | MLOpsStore.mlops_metrics.report_server_training_status(MLOpsStore.mlops_run_id, status, role=device_role) |
| 275 | |
| 276 | |
| 277 | def log_training_finished_status(run_id=None): |
no test coverage detected