From 4efcd1b462138dedb295026d4251e3c2d1b7215d Mon Sep 17 00:00:00 2001 From: Heng Pan Date: Mon, 23 Sep 2024 11:15:53 +0100 Subject: [PATCH] resolve comments --- src/proto/flwr/proto/run.proto | 15 ++++++++----- src/py/flwr/proto/run_pb2.py | 28 ++++++++++++------------ src/py/flwr/proto/run_pb2.pyi | 40 +++++++++++++++++----------------- 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/src/proto/flwr/proto/run.proto b/src/proto/flwr/proto/run.proto index 21d5449e73a7..2c9bd877f66c 100644 --- a/src/proto/flwr/proto/run.proto +++ b/src/proto/flwr/proto/run.proto @@ -28,10 +28,13 @@ message Run { string fab_hash = 5; } -message StatusInfo { - string status = 1; // "starting", "running", "finished" - string sub_status = 2; // "completed", "failed", "stopped" or "" - string reason = 3; // failure reason +message RunStatus { + // "starting", "running", "finished" + string status = 1; + // "completed", "failed", "stopped" or "" (non-finished) + string sub_status = 2; + // failure details + string details = 3; } // CreateRun @@ -50,10 +53,10 @@ message GetRunResponse { Run run = 1; } // UpdateRunStatus message UpdateRunStatusRequest { uint64 run_id = 1; - StatusInfo info = 2; + RunStatus run_status = 2; } message UpdateRunStatusResponse {} // GetRunStatus message GetRunStatusRequest { repeated uint64 run_ids = 1; } -message GetRunStatusResponse { map info_dict = 1; } +message GetRunStatusResponse { map run_status_dict = 1; } diff --git a/src/py/flwr/proto/run_pb2.py b/src/py/flwr/proto/run_pb2.py index cfe829c06289..d59cc26fbb48 100644 --- a/src/py/flwr/proto/run_pb2.py +++ b/src/py/flwr/proto/run_pb2.py @@ -16,7 +16,7 @@ from flwr.proto import transport_pb2 as flwr_dot_proto_dot_transport__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x66lwr/proto/run.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x1a\x66lwr/proto/transport.proto\"\xd5\x01\n\x03Run\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x0e\n\x06\x66\x61\x62_id\x18\x02 \x01(\t\x12\x13\n\x0b\x66\x61\x62_version\x18\x03 \x01(\t\x12<\n\x0foverride_config\x18\x04 \x03(\x0b\x32#.flwr.proto.Run.OverrideConfigEntry\x12\x10\n\x08\x66\x61\x62_hash\x18\x05 \x01(\t\x1aI\n\x13OverrideConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"@\n\nStatusInfo\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x12\n\nsub_status\x18\x02 \x01(\t\x12\x0e\n\x06reason\x18\x03 \x01(\t\"\xeb\x01\n\x10\x43reateRunRequest\x12\x0e\n\x06\x66\x61\x62_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66\x61\x62_version\x18\x02 \x01(\t\x12I\n\x0foverride_config\x18\x03 \x03(\x0b\x32\x30.flwr.proto.CreateRunRequest.OverrideConfigEntry\x12\x1c\n\x03\x66\x61\x62\x18\x04 \x01(\x0b\x32\x0f.flwr.proto.Fab\x1aI\n\x13OverrideConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"#\n\x11\x43reateRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\".\n\x0eGetRunResponse\x12\x1c\n\x03run\x18\x01 \x01(\x0b\x32\x0f.flwr.proto.Run\"N\n\x16UpdateRunStatusRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12$\n\x04info\x18\x02 \x01(\x0b\x32\x16.flwr.proto.StatusInfo\"\x19\n\x17UpdateRunStatusResponse\"&\n\x13GetRunStatusRequest\x12\x0f\n\x07run_ids\x18\x01 \x03(\x04\"\xa2\x01\n\x14GetRunStatusResponse\x12\x41\n\tinfo_dict\x18\x01 \x03(\x0b\x32..flwr.proto.GetRunStatusResponse.InfoDictEntry\x1aG\n\rInfoDictEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.flwr.proto.StatusInfo:\x02\x38\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x66lwr/proto/run.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x1a\x66lwr/proto/transport.proto\"\xd5\x01\n\x03Run\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x0e\n\x06\x66\x61\x62_id\x18\x02 \x01(\t\x12\x13\n\x0b\x66\x61\x62_version\x18\x03 \x01(\t\x12<\n\x0foverride_config\x18\x04 \x03(\x0b\x32#.flwr.proto.Run.OverrideConfigEntry\x12\x10\n\x08\x66\x61\x62_hash\x18\x05 \x01(\t\x1aI\n\x13OverrideConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"@\n\tRunStatus\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x12\n\nsub_status\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\"\xeb\x01\n\x10\x43reateRunRequest\x12\x0e\n\x06\x66\x61\x62_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66\x61\x62_version\x18\x02 \x01(\t\x12I\n\x0foverride_config\x18\x03 \x03(\x0b\x32\x30.flwr.proto.CreateRunRequest.OverrideConfigEntry\x12\x1c\n\x03\x66\x61\x62\x18\x04 \x01(\x0b\x32\x0f.flwr.proto.Fab\x1aI\n\x13OverrideConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"#\n\x11\x43reateRunResponse\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\"\x1f\n\rGetRunRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\".\n\x0eGetRunResponse\x12\x1c\n\x03run\x18\x01 \x01(\x0b\x32\x0f.flwr.proto.Run\"S\n\x16UpdateRunStatusRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12)\n\nrun_status\x18\x02 \x01(\x0b\x32\x15.flwr.proto.RunStatus\"\x19\n\x17UpdateRunStatusResponse\"&\n\x13GetRunStatusRequest\x12\x0f\n\x07run_ids\x18\x01 \x03(\x04\"\xb1\x01\n\x14GetRunStatusResponse\x12L\n\x0frun_status_dict\x18\x01 \x03(\x0b\x32\x33.flwr.proto.GetRunStatusResponse.RunStatusDictEntry\x1aK\n\x12RunStatusDictEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12$\n\x05value\x18\x02 \x01(\x0b\x32\x15.flwr.proto.RunStatus:\x02\x38\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -27,14 +27,14 @@ _globals['_RUN_OVERRIDECONFIGENTRY']._serialized_options = b'8\001' _globals['_CREATERUNREQUEST_OVERRIDECONFIGENTRY']._options = None _globals['_CREATERUNREQUEST_OVERRIDECONFIGENTRY']._serialized_options = b'8\001' - _globals['_GETRUNSTATUSRESPONSE_INFODICTENTRY']._options = None - _globals['_GETRUNSTATUSRESPONSE_INFODICTENTRY']._serialized_options = b'8\001' + _globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._options = None + _globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._serialized_options = b'8\001' _globals['_RUN']._serialized_start=87 _globals['_RUN']._serialized_end=300 _globals['_RUN_OVERRIDECONFIGENTRY']._serialized_start=227 _globals['_RUN_OVERRIDECONFIGENTRY']._serialized_end=300 - _globals['_STATUSINFO']._serialized_start=302 - _globals['_STATUSINFO']._serialized_end=366 + _globals['_RUNSTATUS']._serialized_start=302 + _globals['_RUNSTATUS']._serialized_end=366 _globals['_CREATERUNREQUEST']._serialized_start=369 _globals['_CREATERUNREQUEST']._serialized_end=604 _globals['_CREATERUNREQUEST_OVERRIDECONFIGENTRY']._serialized_start=227 @@ -46,13 +46,13 @@ _globals['_GETRUNRESPONSE']._serialized_start=676 _globals['_GETRUNRESPONSE']._serialized_end=722 _globals['_UPDATERUNSTATUSREQUEST']._serialized_start=724 - _globals['_UPDATERUNSTATUSREQUEST']._serialized_end=802 - _globals['_UPDATERUNSTATUSRESPONSE']._serialized_start=804 - _globals['_UPDATERUNSTATUSRESPONSE']._serialized_end=829 - _globals['_GETRUNSTATUSREQUEST']._serialized_start=831 - _globals['_GETRUNSTATUSREQUEST']._serialized_end=869 - _globals['_GETRUNSTATUSRESPONSE']._serialized_start=872 - _globals['_GETRUNSTATUSRESPONSE']._serialized_end=1034 - _globals['_GETRUNSTATUSRESPONSE_INFODICTENTRY']._serialized_start=963 - _globals['_GETRUNSTATUSRESPONSE_INFODICTENTRY']._serialized_end=1034 + _globals['_UPDATERUNSTATUSREQUEST']._serialized_end=807 + _globals['_UPDATERUNSTATUSRESPONSE']._serialized_start=809 + _globals['_UPDATERUNSTATUSRESPONSE']._serialized_end=834 + _globals['_GETRUNSTATUSREQUEST']._serialized_start=836 + _globals['_GETRUNSTATUSREQUEST']._serialized_end=874 + _globals['_GETRUNSTATUSRESPONSE']._serialized_start=877 + _globals['_GETRUNSTATUSRESPONSE']._serialized_end=1054 + _globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._serialized_start=979 + _globals['_GETRUNSTATUSRESPONSE_RUNSTATUSDICTENTRY']._serialized_end=1054 # @@protoc_insertion_point(module_scope) diff --git a/src/py/flwr/proto/run_pb2.pyi b/src/py/flwr/proto/run_pb2.pyi index 53aea6e8775b..cec90c4d2d4c 100644 --- a/src/py/flwr/proto/run_pb2.pyi +++ b/src/py/flwr/proto/run_pb2.pyi @@ -52,28 +52,28 @@ class Run(google.protobuf.message.Message): def ClearField(self, field_name: typing_extensions.Literal["fab_hash",b"fab_hash","fab_id",b"fab_id","fab_version",b"fab_version","override_config",b"override_config","run_id",b"run_id"]) -> None: ... global___Run = Run -class StatusInfo(google.protobuf.message.Message): +class RunStatus(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor STATUS_FIELD_NUMBER: builtins.int SUB_STATUS_FIELD_NUMBER: builtins.int - REASON_FIELD_NUMBER: builtins.int + DETAILS_FIELD_NUMBER: builtins.int status: typing.Text """"starting", "running", "finished" """ sub_status: typing.Text - """"completed", "failed", "stopped" or "" """ + """"completed", "failed", "stopped" or "" (non-finished)""" - reason: typing.Text - """failure reason""" + details: typing.Text + """failure details""" def __init__(self, *, status: typing.Text = ..., sub_status: typing.Text = ..., - reason: typing.Text = ..., + details: typing.Text = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["reason",b"reason","status",b"status","sub_status",b"sub_status"]) -> None: ... -global___StatusInfo = StatusInfo + def ClearField(self, field_name: typing_extensions.Literal["details",b"details","status",b"status","sub_status",b"sub_status"]) -> None: ... +global___RunStatus = RunStatus class CreateRunRequest(google.protobuf.message.Message): """CreateRun""" @@ -154,17 +154,17 @@ class UpdateRunStatusRequest(google.protobuf.message.Message): """UpdateRunStatus""" DESCRIPTOR: google.protobuf.descriptor.Descriptor RUN_ID_FIELD_NUMBER: builtins.int - INFO_FIELD_NUMBER: builtins.int + RUN_STATUS_FIELD_NUMBER: builtins.int run_id: builtins.int @property - def info(self) -> global___StatusInfo: ... + def run_status(self) -> global___RunStatus: ... def __init__(self, *, run_id: builtins.int = ..., - info: typing.Optional[global___StatusInfo] = ..., + run_status: typing.Optional[global___RunStatus] = ..., ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["info",b"info"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["info",b"info","run_id",b"run_id"]) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["run_status",b"run_status"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["run_id",b"run_id","run_status",b"run_status"]) -> None: ... global___UpdateRunStatusRequest = UpdateRunStatusRequest class UpdateRunStatusResponse(google.protobuf.message.Message): @@ -188,27 +188,27 @@ global___GetRunStatusRequest = GetRunStatusRequest class GetRunStatusResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor - class InfoDictEntry(google.protobuf.message.Message): + class RunStatusDictEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.int @property - def value(self) -> global___StatusInfo: ... + def value(self) -> global___RunStatus: ... def __init__(self, *, key: builtins.int = ..., - value: typing.Optional[global___StatusInfo] = ..., + value: typing.Optional[global___RunStatus] = ..., ) -> None: ... def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ... def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ... - INFO_DICT_FIELD_NUMBER: builtins.int + RUN_STATUS_DICT_FIELD_NUMBER: builtins.int @property - def info_dict(self) -> google.protobuf.internal.containers.MessageMap[builtins.int, global___StatusInfo]: ... + def run_status_dict(self) -> google.protobuf.internal.containers.MessageMap[builtins.int, global___RunStatus]: ... def __init__(self, *, - info_dict: typing.Optional[typing.Mapping[builtins.int, global___StatusInfo]] = ..., + run_status_dict: typing.Optional[typing.Mapping[builtins.int, global___RunStatus]] = ..., ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["info_dict",b"info_dict"]) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["run_status_dict",b"run_status_dict"]) -> None: ... global___GetRunStatusResponse = GetRunStatusResponse