From fe35032ade96d58bd2c1c02073d3b874183051eb Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 4 Sep 2024 12:29:21 +0200 Subject: [PATCH 1/3] [common] Add nanosecond timestamp + workflow info to environment events --- common/protos/common.pb.go | 111 ++++++++++- common/protos/common.proto | 7 + common/protos/events.pb.go | 396 ++++++++++++++++++++----------------- common/protos/events.proto | 4 +- 4 files changed, 322 insertions(+), 196 deletions(-) diff --git a/common/protos/common.pb.go b/common/protos/common.pb.go index 8f86d94d..da2413f6 100644 --- a/common/protos/common.pb.go +++ b/common/protos/common.pb.go @@ -109,6 +109,77 @@ func (x *User) GetName() string { return "" } +type WorkflowTemplateInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + Public bool `protobuf:"varint,4,opt,name=public,proto3" json:"public,omitempty"` // whether the environment is public or not +} + +func (x *WorkflowTemplateInfo) Reset() { + *x = WorkflowTemplateInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WorkflowTemplateInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowTemplateInfo) ProtoMessage() {} + +func (x *WorkflowTemplateInfo) ProtoReflect() protoreflect.Message { + mi := &file_protos_common_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowTemplateInfo.ProtoReflect.Descriptor instead. +func (*WorkflowTemplateInfo) Descriptor() ([]byte, []int) { + return file_protos_common_proto_rawDescGZIP(), []int{1} +} + +func (x *WorkflowTemplateInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *WorkflowTemplateInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *WorkflowTemplateInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *WorkflowTemplateInfo) GetPublic() bool { + if x != nil { + return x.Public + } + return false +} + var File_protos_common_proto protoreflect.FileDescriptor var file_protos_common_proto_rawDesc = []byte{ @@ -120,13 +191,20 @@ var file_protos_common_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x49, 0x64, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, 0x2e, - 0x63, 0x65, 0x72, 0x6e, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x30, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x32, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x64, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x22, 0x78, 0x0a, 0x14, 0x57, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, 0x2e, 0x63, 0x65, 0x72, 0x6e, 0x2e, 0x61, + 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x32, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2f, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -141,9 +219,10 @@ func file_protos_common_proto_rawDescGZIP() []byte { return file_protos_common_proto_rawDescData } -var file_protos_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_protos_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_protos_common_proto_goTypes = []interface{}{ - (*User)(nil), // 0: common.User + (*User)(nil), // 0: common.User + (*WorkflowTemplateInfo)(nil), // 1: common.WorkflowTemplateInfo } var file_protos_common_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -171,6 +250,18 @@ func file_protos_common_proto_init() { return nil } } + file_protos_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkflowTemplateInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_protos_common_proto_msgTypes[0].OneofWrappers = []interface{}{} type x struct{} @@ -179,7 +270,7 @@ func file_protos_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protos_common_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/common/protos/common.proto b/common/protos/common.proto index 635c7b71..435790e4 100644 --- a/common/protos/common.proto +++ b/common/protos/common.proto @@ -39,3 +39,10 @@ message User { // Name of the user. string name = 3; } + +message WorkflowTemplateInfo { + string name = 1; + string description = 2; + string path = 3; + bool public = 4; // whether the environment is public or not +} \ No newline at end of file diff --git a/common/protos/events.pb.go b/common/protos/events.pb.go index 2d7f2eb2..a3654453 100644 --- a/common/protos/events.pb.go +++ b/common/protos/events.pb.go @@ -246,16 +246,17 @@ type Ev_EnvironmentEvent struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - EnvironmentId string `protobuf:"bytes,1,opt,name=environmentId,proto3" json:"environmentId,omitempty"` - State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` - RunNumber uint32 `protobuf:"varint,3,opt,name=runNumber,proto3" json:"runNumber,omitempty"` // only when the environment is in the running state - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` - Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` // any additional message concerning the current state or transition - Transition string `protobuf:"bytes,6,opt,name=transition,proto3" json:"transition,omitempty"` - TransitionStep string `protobuf:"bytes,7,opt,name=transitionStep,proto3" json:"transitionStep,omitempty"` - TransitionStatus OpStatus `protobuf:"varint,8,opt,name=transitionStatus,proto3,enum=events.OpStatus" json:"transitionStatus,omitempty"` - Vars map[string]string `protobuf:"bytes,9,rep,name=vars,proto3" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // consolidated environment variables at the root role of the environment - LastRequestUser *User `protobuf:"bytes,10,opt,name=lastRequestUser,proto3" json:"lastRequestUser,omitempty"` + EnvironmentId string `protobuf:"bytes,1,opt,name=environmentId,proto3" json:"environmentId,omitempty"` + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + RunNumber uint32 `protobuf:"varint,3,opt,name=runNumber,proto3" json:"runNumber,omitempty"` // only when the environment is in the running state + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` // any additional message concerning the current state or transition + Transition string `protobuf:"bytes,6,opt,name=transition,proto3" json:"transition,omitempty"` + TransitionStep string `protobuf:"bytes,7,opt,name=transitionStep,proto3" json:"transitionStep,omitempty"` + TransitionStatus OpStatus `protobuf:"varint,8,opt,name=transitionStatus,proto3,enum=events.OpStatus" json:"transitionStatus,omitempty"` + Vars map[string]string `protobuf:"bytes,9,rep,name=vars,proto3" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // consolidated environment variables at the root role of the environment + LastRequestUser *User `protobuf:"bytes,10,opt,name=lastRequestUser,proto3" json:"lastRequestUser,omitempty"` + WorkflowTemplateInfo *WorkflowTemplateInfo `protobuf:"bytes,11,opt,name=workflowTemplateInfo,proto3" json:"workflowTemplateInfo,omitempty"` } func (x *Ev_EnvironmentEvent) Reset() { @@ -360,6 +361,13 @@ func (x *Ev_EnvironmentEvent) GetLastRequestUser() *User { return nil } +func (x *Ev_EnvironmentEvent) GetWorkflowTemplateInfo() *WorkflowTemplateInfo { + if x != nil { + return x.WorkflowTemplateInfo + } + return nil +} + type Traits struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -935,7 +943,8 @@ type Event struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + TimestampNano int64 `protobuf:"varint,2,opt,name=timestampNano,proto3" json:"timestampNano,omitempty"` // Types that are assignable to Payload: // // *Event_EnvironmentEvent @@ -989,6 +998,13 @@ func (x *Event) GetTimestamp() int64 { return 0 } +func (x *Event) GetTimestampNano() int64 { + if x != nil { + return x.TimestampNano + } + return 0 +} + func (m *Event) GetPayload() isEvent_Payload { if m != nil { return m.Payload @@ -1134,7 +1150,7 @@ var file_protos_events_proto_rawDesc = []byte{ 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xd1, 0x03, 0x0a, 0x13, 0x45, 0x76, 0x5f, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa3, 0x04, 0x0a, 0x13, 0x45, 0x76, 0x5f, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, @@ -1160,159 +1176,167 @@ var file_protos_events_proto_rawDesc = []byte{ 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6e, 0x0a, 0x06, - 0x54, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x12, 0x14, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x61, 0x77, 0x61, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x22, 0x84, 0x02, 0x0a, - 0x0c, 0x45, 0x76, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x74, - 0x73, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, - 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x22, 0xfc, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x43, 0x61, 0x6c, 0x6c, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x30, 0x0a, 0x0a, 0x63, 0x61, 0x6c, 0x6c, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0a, - 0x63, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x74, 0x75, - 0x72, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x69, - 0x74, 0x73, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, - 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x50, 0x61, 0x74, - 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x50, 0x61, 0x74, - 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, - 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x19, 0x45, 0x76, 0x5f, 0x49, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, - 0x24, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x65, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x12, 0x42, 0x0a, 0x13, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x13, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x65, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xff, 0x02, 0x0a, 0x0b, - 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x65, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x73, 0x65, 0x72, 0x12, 0x50, 0x0a, 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6e, + 0x0a, 0x06, 0x54, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x61, 0x77, 0x61, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x22, 0x84, + 0x02, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, + 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, + 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, + 0x69, 0x74, 0x73, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x65, + 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, - 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x10, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, - 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x04, 0x76, 0x61, 0x72, - 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x61, 0x72, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x0f, - 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xab, 0x05, - 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x49, 0x0a, 0x10, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, - 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x45, 0x6e, 0x76, 0x69, - 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x10, - 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x34, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, - 0x54, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x61, 0x73, - 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, - 0x00, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, - 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x43, 0x61, 0x6c, 0x6c, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x5b, 0x0a, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x49, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x31, 0x0a, 0x08, 0x72, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x75, - 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x75, 0x6e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x0e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x76, 0x65, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xfc, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x43, 0x61, 0x6c, + 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x30, 0x0a, 0x0a, 0x63, 0x61, + 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, + 0x61, 0x69, 0x74, 0x73, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, + 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x52, 0x6f, 0x6c, 0x65, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x50, + 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x19, 0x45, 0x76, + 0x5f, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x74, 0x65, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x12, 0x42, 0x0a, 0x13, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x13, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, + 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xff, 0x02, + 0x0a, 0x0b, 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, + 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, + 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, + 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x04, 0x76, + 0x61, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x56, + 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x12, 0x36, + 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xd1, 0x05, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x4e, 0x61, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x49, 0x0a, + 0x10, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x45, 0x76, 0x5f, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x10, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, + 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, + 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x6f, + 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x45, 0x76, 0x5f, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, + 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x5b, 0x0a, 0x16, 0x69, 0x6e, + 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, + 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, + 0x16, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x72, 0x75, 0x6e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, + 0x52, 0x08, 0x72, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x0e, 0x66, 0x72, + 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x65, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, + 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, + 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x72, 0x61, 0x6d, 0x65, + 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x57, 0x0a, 0x13, 0x6d, 0x65, 0x73, + 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, + 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x4d, 0x65, 0x73, + 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x48, 0x00, 0x52, 0x13, 0x6d, + 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0e, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x5f, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, - 0x00, 0x52, 0x0e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x57, 0x0a, 0x13, 0x6d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, - 0x65, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x4d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, - 0x65, 0x61, 0x74, 0x48, 0x00, 0x52, 0x13, 0x6d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, - 0x74, 0x62, 0x65, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0e, 0x63, 0x6f, - 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x67, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, - 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4a, - 0x04, 0x08, 0x02, 0x10, 0x0b, 0x4a, 0x04, 0x08, 0x11, 0x10, 0x65, 0x2a, 0x5d, 0x0a, 0x08, 0x4f, - 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x55, 0x4c, 0x4c, 0x10, - 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, - 0x0a, 0x07, 0x4f, 0x4e, 0x47, 0x4f, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x44, - 0x4f, 0x4e, 0x45, 0x5f, 0x4f, 0x4b, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x4f, 0x4e, 0x45, - 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x4f, 0x4e, 0x45, - 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x05, 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, - 0x2e, 0x63, 0x65, 0x72, 0x6e, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5a, 0x30, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, - 0x32, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x50, - 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5f, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6f, + 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x09, 0x0a, 0x07, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x0b, 0x4a, 0x04, 0x08, + 0x11, 0x10, 0x65, 0x2a, 0x5d, 0x0a, 0x08, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x08, 0x0a, 0x04, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, + 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x4e, 0x47, 0x4f, 0x49, 0x4e, + 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x4f, 0x4e, 0x45, 0x5f, 0x4f, 0x4b, 0x10, 0x03, + 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x4f, 0x4e, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, + 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x4f, 0x4e, 0x45, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, + 0x10, 0x05, 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, 0x2e, 0x63, 0x65, 0x72, 0x6e, 0x2e, 0x61, 0x6c, + 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x32, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1345,33 +1369,35 @@ var file_protos_events_proto_goTypes = []interface{}{ nil, // 12: events.Ev_EnvironmentEvent.VarsEntry nil, // 13: events.Ev_RunEvent.VarsEntry (*User)(nil), // 14: common.User + (*WorkflowTemplateInfo)(nil), // 15: common.WorkflowTemplateInfo } var file_protos_events_proto_depIdxs = []int32{ 0, // 0: events.Ev_EnvironmentEvent.transitionStatus:type_name -> events.OpStatus 12, // 1: events.Ev_EnvironmentEvent.vars:type_name -> events.Ev_EnvironmentEvent.VarsEntry 14, // 2: events.Ev_EnvironmentEvent.lastRequestUser:type_name -> common.User - 5, // 3: events.Ev_TaskEvent.traits:type_name -> events.Traits - 0, // 4: events.Ev_CallEvent.callStatus:type_name -> events.OpStatus - 5, // 5: events.Ev_CallEvent.traits:type_name -> events.Traits - 0, // 6: events.Ev_IntegratedServiceEvent.operationStatus:type_name -> events.OpStatus - 0, // 7: events.Ev_IntegratedServiceEvent.operationStepStatus:type_name -> events.OpStatus - 0, // 8: events.Ev_RunEvent.transitionStatus:type_name -> events.OpStatus - 13, // 9: events.Ev_RunEvent.vars:type_name -> events.Ev_RunEvent.VarsEntry - 14, // 10: events.Ev_RunEvent.lastRequestUser:type_name -> common.User - 4, // 11: events.Event.environmentEvent:type_name -> events.Ev_EnvironmentEvent - 6, // 12: events.Event.taskEvent:type_name -> events.Ev_TaskEvent - 8, // 13: events.Event.roleEvent:type_name -> events.Ev_RoleEvent - 7, // 14: events.Event.callEvent:type_name -> events.Ev_CallEvent - 9, // 15: events.Event.integratedServiceEvent:type_name -> events.Ev_IntegratedServiceEvent - 10, // 16: events.Event.runEvent:type_name -> events.Ev_RunEvent - 3, // 17: events.Event.frameworkEvent:type_name -> events.Ev_MetaEvent_FrameworkEvent - 1, // 18: events.Event.mesosHeartbeatEvent:type_name -> events.Ev_MetaEvent_MesosHeartbeat - 2, // 19: events.Event.coreStartEvent:type_name -> events.Ev_MetaEvent_CoreStart - 20, // [20:20] is the sub-list for method output_type - 20, // [20:20] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 15, // 3: events.Ev_EnvironmentEvent.workflowTemplateInfo:type_name -> common.WorkflowTemplateInfo + 5, // 4: events.Ev_TaskEvent.traits:type_name -> events.Traits + 0, // 5: events.Ev_CallEvent.callStatus:type_name -> events.OpStatus + 5, // 6: events.Ev_CallEvent.traits:type_name -> events.Traits + 0, // 7: events.Ev_IntegratedServiceEvent.operationStatus:type_name -> events.OpStatus + 0, // 8: events.Ev_IntegratedServiceEvent.operationStepStatus:type_name -> events.OpStatus + 0, // 9: events.Ev_RunEvent.transitionStatus:type_name -> events.OpStatus + 13, // 10: events.Ev_RunEvent.vars:type_name -> events.Ev_RunEvent.VarsEntry + 14, // 11: events.Ev_RunEvent.lastRequestUser:type_name -> common.User + 4, // 12: events.Event.environmentEvent:type_name -> events.Ev_EnvironmentEvent + 6, // 13: events.Event.taskEvent:type_name -> events.Ev_TaskEvent + 8, // 14: events.Event.roleEvent:type_name -> events.Ev_RoleEvent + 7, // 15: events.Event.callEvent:type_name -> events.Ev_CallEvent + 9, // 16: events.Event.integratedServiceEvent:type_name -> events.Ev_IntegratedServiceEvent + 10, // 17: events.Event.runEvent:type_name -> events.Ev_RunEvent + 3, // 18: events.Event.frameworkEvent:type_name -> events.Ev_MetaEvent_FrameworkEvent + 1, // 19: events.Event.mesosHeartbeatEvent:type_name -> events.Ev_MetaEvent_MesosHeartbeat + 2, // 20: events.Event.coreStartEvent:type_name -> events.Ev_MetaEvent_CoreStart + 21, // [21:21] is the sub-list for method output_type + 21, // [21:21] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_protos_events_proto_init() } diff --git a/common/protos/events.proto b/common/protos/events.proto index 478d8b6e..cc6940a1 100644 --- a/common/protos/events.proto +++ b/common/protos/events.proto @@ -64,6 +64,7 @@ message Ev_EnvironmentEvent { OpStatus transitionStatus = 8; map vars = 9; // consolidated environment variables at the root role of the environment common.User lastRequestUser = 10; + common.WorkflowTemplateInfo workflowTemplateInfo = 11; } message Traits { @@ -128,7 +129,8 @@ message Ev_RunEvent { message Event { int64 timestamp = 1; - reserved 2 to 10; + int64 timestampNano = 2; + reserved 3 to 10; reserved 17 to 100; oneof Payload { From ef3f4143ec6ff4301f4c68c381622e86682e9481 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 4 Sep 2024 12:30:12 +0200 Subject: [PATCH 2/3] [common] Include nanosecond timestamp in all Kafka events --- common/event/writer.go | 45 +++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/common/event/writer.go b/common/event/writer.go index 386a530c..9e329af4 100644 --- a/common/event/writer.go +++ b/common/event/writer.go @@ -94,48 +94,57 @@ func (w *KafkaWriter) WriteEventWithTimestamp(e interface{}, timestamp time.Time switch e := e.(type) { case *pb.Ev_MetaEvent_CoreStart: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_CoreStartEvent{CoreStartEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_CoreStartEvent{CoreStartEvent: e}, } case *pb.Ev_MetaEvent_MesosHeartbeat: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_MesosHeartbeatEvent{MesosHeartbeatEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_MesosHeartbeatEvent{MesosHeartbeatEvent: e}, } case *pb.Ev_MetaEvent_FrameworkEvent: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_FrameworkEvent{FrameworkEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_FrameworkEvent{FrameworkEvent: e}, } case *pb.Ev_TaskEvent: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_TaskEvent{TaskEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_TaskEvent{TaskEvent: e}, } case *pb.Ev_RoleEvent: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_RoleEvent{RoleEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_RoleEvent{RoleEvent: e}, } case *pb.Ev_EnvironmentEvent: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_EnvironmentEvent{EnvironmentEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_EnvironmentEvent{EnvironmentEvent: e}, } case *pb.Ev_CallEvent: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_CallEvent{CallEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_CallEvent{CallEvent: e}, } case *pb.Ev_IntegratedServiceEvent: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_IntegratedServiceEvent{IntegratedServiceEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_IntegratedServiceEvent{IntegratedServiceEvent: e}, } case *pb.Ev_RunEvent: wrappedEvent = &pb.Event{ - Timestamp: timestamp.UnixMilli(), - Payload: &pb.Event_RunEvent{RunEvent: e}, + Timestamp: timestamp.UnixMilli(), + TimestampNano: timestamp.UnixNano(), + Payload: &pb.Event_RunEvent{RunEvent: e}, } } From fe45651ba33c2cbd80e20b8c113a0b6e0a62aaa8 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 4 Sep 2024 12:31:13 +0200 Subject: [PATCH 3/3] [core] Include workflow template info (incl public) in all env events --- core/environment/environment.go | 261 ++++++++++++++++++-------------- core/environment/manager.go | 248 +++++++++++++++++------------- core/environment/utils.go | 23 ++- core/server.go | 15 +- 4 files changed, 316 insertions(+), 231 deletions(-) diff --git a/core/environment/environment.go b/core/environment/environment.go index 55171427..f55b109b 100644 --- a/core/environment/environment.go +++ b/core/environment/environment.go @@ -84,6 +84,7 @@ type Environment struct { eventStream Subscription Public bool // From workflow or user Description string // From workflow + WorkflowPath string // From workflow load callsPendingAwait map[string] /*await expression, trigger only*/ callable.CallsMap currentTransition string @@ -167,13 +168,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, trigger := fmt.Sprintf("before_%s", e.Event) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.GetCurrentRunNumber(), - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step starting", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.GetCurrentRunNumber(), + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step starting", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) // first, we execute hooks which should be executed before an event officially starts @@ -181,13 +183,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, if errHooks != nil { e.Cancel(errHooks) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.GetCurrentRunNumber(), - Error: errHooks.Error(), - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step finished", + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.GetCurrentRunNumber(), + Error: errHooks.Error(), + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step finished", + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) return } @@ -318,27 +321,29 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: trigger, - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: trigger, + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) }, "leave_state": func(_ context.Context, e *fsm.Event) { trigger := fmt.Sprintf("leave_%s", e.Src) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step starting", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step starting", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) errHooks := env.handleHooksWithNegativeWeights(env.Workflow(), trigger) @@ -357,13 +362,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, if errHooks != nil { e.Cancel(errHooks) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.GetCurrentRunNumber(), - Error: errHooks.Error(), - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step finished", + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.GetCurrentRunNumber(), + Error: errHooks.Error(), + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step finished", + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) return } @@ -379,14 +385,15 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: trigger, - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: trigger, + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) if e.Err != nil { @@ -394,13 +401,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Message: "transition step starting", - Transition: e.Event, - TransitionStep: fmt.Sprintf("tasks_%s", e.Event), - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Message: "transition step starting", + Transition: e.Event, + TransitionStep: fmt.Sprintf("tasks_%s", e.Event), + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) env.handlerFunc()(e) @@ -410,27 +418,29 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: e.Dst, // exceptionally we take the destination state here instead of the current, because the tasks have transitioned - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: fmt.Sprintf("tasks_%s", e.Event), - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: e.Dst, // exceptionally we take the destination state here instead of the current, because the tasks have transitioned + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: fmt.Sprintf("tasks_%s", e.Event), + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) }, "enter_state": func(_ context.Context, e *fsm.Event) { trigger := fmt.Sprintf("enter_%s", e.Dst) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step starting", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step starting", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) errHooks := env.handleHooksWithNegativeWeights(env.Workflow(), trigger) @@ -450,14 +460,15 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: trigger, - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: trigger, + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) if e.Err != nil { @@ -481,13 +492,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, trigger := fmt.Sprintf("after_%s", e.Event) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step starting", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step starting", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) errHooks := env.handleHooksWithNegativeWeights(env.Workflow(), trigger) @@ -617,14 +629,15 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, // publish transition step complete event the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: trigger, - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: trigger, + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) }, }, @@ -970,24 +983,26 @@ func (env *Environment) TryTransition(t Transition) (err error) { defer env.transitionMutex.Unlock() the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Message: "transition starting", - Transition: t.eventName(), - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Message: "transition starting", + Transition: t.eventName(), + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) err = t.check() if err != nil { the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: err.Error(), - Message: "transition impossible", - Transition: t.eventName(), - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: err.Error(), + Message: "transition impossible", + Transition: t.eventName(), + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) return } @@ -995,22 +1010,24 @@ func (env *Environment) TryTransition(t Transition) (err error) { if err != nil { the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: err.Error(), - Message: "transition error", - Transition: t.eventName(), - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: err.Error(), + Message: "transition error", + Transition: t.eventName(), + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) } else { the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Message: "transition completed successfully", - Transition: t.eventName(), - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Message: "transition completed successfully", + Transition: t.eventName(), + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) } return @@ -1387,6 +1404,20 @@ func (env *Environment) GetVarsAsString() string { return sortMapToString(varStack) } +func (env *Environment) GetWorkflowInfo() *pb.WorkflowTemplateInfo { + if env == nil || env.workflow == nil { + return &pb.WorkflowTemplateInfo{} + } + + out := &pb.WorkflowTemplateInfo{ + Name: env.name, + Description: env.Description, + Path: env.WorkflowPath, + Public: env.Public, + } + return out +} + // return true if the auto stop transition has been scheduled, false otherwise // if true, the expected stop time is also returned func (env *Environment) scheduleAutoStopTransition() (scheduled bool, expected time.Time) { diff --git a/core/environment/manager.go b/core/environment/manager.go index f4ead298..a20b9b4e 100644 --- a/core/environment/manager.go +++ b/core/environment/manager.go @@ -230,6 +230,17 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] _ = json.Unmarshal([]byte(lastRequestUserJ), lastRequestUser) } + // in case of err==nil, env will be false unless user + // set it to True which will be overwritten in server.go + workflowPublicInfo, err := parseWorkflowPublicInfo(workflowPath) + if err != nil { + log.WithField("public info", public). + WithField("workflow path", workflowPath). + WithError(err). + Warn("parse workflow public info failed.") + return newId, fmt.Errorf("workflow public info parsing failed: %w", err) + } + the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ EnvironmentId: newId.String(), State: "PENDING", @@ -237,6 +248,12 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] TransitionStep: "before_CREATE", Message: "instantiating", LastRequestUser: lastRequestUser, + WorkflowTemplateInfo: &evpb.WorkflowTemplateInfo{ + Path: workflowPath, + Public: workflowPublicInfo.IsPublic, + Name: workflowPublicInfo.Name, + Description: workflowPublicInfo.Description, + }, }) // userVar identifiers come in 2 forms: @@ -296,7 +313,10 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] Logf(logrus.FatalLevel, "environment creation failed") } } - if err != nil { + if err != nil || env == nil { + if env == nil { + err = errors.New("newEnvironment returned nil environment") + } log.WithError(err). WithField("partition", gotEnvId.String()). Logf(logrus.FatalLevel, "environment creation failed") @@ -308,13 +328,19 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] "partition": gotEnvId.String(), }).Info("creating new environment") + env.Public = workflowPublicInfo.IsPublic + env.name = workflowPublicInfo.Name + env.Description = workflowPublicInfo.Description + env.WorkflowPath = workflowPath + the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: "PENDING", - Transition: "CREATE", - TransitionStep: "before_CREATE", - Message: "running hooks", - LastRequestUser: lastRequestUser, + EnvironmentId: newId.String(), + State: "PENDING", + Transition: "CREATE", + TransitionStep: "before_CREATE", + Message: "running hooks", + LastRequestUser: lastRequestUser, + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) env.hookHandlerF = func(hooks task.Tasks) error { @@ -324,24 +350,14 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] // Ensure the environment_id is available to all env.UserVars.Set("environment_id", env.id.String()) - // in case of err==nil, env will be false unless user - // set it to True which will be overwritten in server.go - env.Public, env.Description, err = parseWorkflowPublicInfo(workflowPath) - if err != nil { - log.WithField("public info", env.Public). - WithField("partition", env.Id().String()). - WithError(err). - Warn("parse workflow public info failed.") - return gotEnvId, fmt.Errorf("workflow public info parsing failed: %w", err) - } - the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: "PENDING", - Transition: "CREATE", - TransitionStep: "CREATE", - Message: "loading workflow", - LastRequestUser: lastRequestUser, + EnvironmentId: newId.String(), + State: "PENDING", + Transition: "CREATE", + TransitionStep: "CREATE", + Message: "loading workflow", + LastRequestUser: lastRequestUser, + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) // We load the workflow (includes template processing) @@ -382,13 +398,14 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] cvs, _ := env.Workflow().ConsolidatedVarStack() the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: env.CurrentState(), - Transition: "CREATE", - TransitionStep: "after_CREATE", - Message: "workflow loaded", - Vars: cvs, // we push the full var stack of the root role in the workflow loaded event - LastRequestUser: lastRequestUser, + EnvironmentId: newId.String(), + State: env.CurrentState(), + Transition: "CREATE", + TransitionStep: "after_CREATE", + Message: "workflow loaded", + Vars: cvs, // we push the full var stack of the root role in the workflow loaded event + LastRequestUser: lastRequestUser, + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) log.WithField("method", "CreateEnvironment"). @@ -600,12 +617,13 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: env.CurrentState(), - Transition: "DESTROY", - TransitionStep: "before_DESTROY", - Message: "workflow teardown started", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: environmentId.String(), + State: env.CurrentState(), + Transition: "DESTROY", + TransitionStep: "before_DESTROY", + Message: "workflow teardown started", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) env.Mu.Lock() @@ -613,12 +631,13 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error env.Mu.Unlock() the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: env.CurrentState(), - Transition: "DESTROY", - TransitionStep: "leave_" + env.CurrentState(), - Message: "workflow teardown ongoing", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: environmentId.String(), + State: env.CurrentState(), + Transition: "DESTROY", + TransitionStep: "leave_" + env.CurrentState(), + Message: "workflow teardown ongoing", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) err = env.handleAllHooks(env.Workflow(), "leave_"+env.CurrentState()) @@ -698,12 +717,13 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: env.CurrentState(), - Transition: "DESTROY", - TransitionStep: "DESTROY", - Message: "releasing tasks", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: environmentId.String(), + State: env.CurrentState(), + Transition: "DESTROY", + TransitionStep: "DESTROY", + Message: "releasing tasks", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) log.WithField("method", "TeardownEnvironment"). @@ -765,25 +785,27 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error len(taskReleaseErrors), environmentId) the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: "DONE", - Transition: "DESTROY", - TransitionStep: "after_DESTROY", - Message: "environment teardown finished with error", - Error: err.Error(), - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: environmentId.String(), + State: "DONE", + Transition: "DESTROY", + TransitionStep: "after_DESTROY", + Message: "environment teardown finished with error", + Error: err.Error(), + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) return err } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: env.CurrentState(), - Transition: "DESTROY", - TransitionStep: "after_DESTROY", - Message: "running DESTROY hooks", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: environmentId.String(), + State: env.CurrentState(), + Transition: "DESTROY", + TransitionStep: "after_DESTROY", + Message: "running DESTROY hooks", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) // we trigger all cleanup hooks, first calls, then tasks immediately after @@ -847,13 +869,14 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error len(taskReleaseErrors), environmentId) the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: "DONE", - Transition: "DESTROY", - TransitionStep: "after_DESTROY", - Message: "environment teardown finished with error", - Error: err.Error(), - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: environmentId.String(), + State: "DONE", + Transition: "DESTROY", + TransitionStep: "after_DESTROY", + Message: "environment teardown finished with error", + Error: err.Error(), + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) return err @@ -874,12 +897,13 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error Debug("envman write lock") the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: "DONE", - Transition: "DESTROY", - TransitionStep: "after_DESTROY", - Message: "environment teardown complete", - LastRequestUser: env.GetLastRequestUser(), + EnvironmentId: environmentId.String(), + State: "DONE", + Transition: "DESTROY", + TransitionStep: "after_DESTROY", + Message: "environment teardown complete", + LastRequestUser: env.GetLastRequestUser(), + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) return err @@ -1167,6 +1191,16 @@ func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[str _ = json.Unmarshal([]byte(lastRequestUserJ), lastRequestUser) } + // in case of err==nil, env will be false unless user + // set it to True which will be overwritten in server.go + workflowPublicInfo, err := parseWorkflowPublicInfo(workflowPath) + if err != nil { + log.WithField("public info", workflowPublicInfo.IsPublic). + WithField("environment", newId.String()). + WithError(err). + Warn("parse workflow public info failed.") + } + the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ EnvironmentId: newId.String(), State: "PENDING", @@ -1174,6 +1208,12 @@ func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[str TransitionStep: "before_CREATE", Message: "instantiating", LastRequestUser: lastRequestUser, + WorkflowTemplateInfo: &evpb.WorkflowTemplateInfo{ + Path: workflowPath, + Public: workflowPublicInfo.IsPublic, + Name: workflowPublicInfo.Name, + Description: workflowPublicInfo.Description, + }, }) env, err := newEnvironment(envUserVars, newId) @@ -1191,13 +1231,19 @@ func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[str "partition": newEnvId.String(), }).Info("creating new automatic environment") + env.Public = workflowPublicInfo.IsPublic + env.name = workflowPublicInfo.Name + env.Description = workflowPublicInfo.Description + env.WorkflowPath = workflowPath + the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: "PENDING", - Transition: "CREATE", - TransitionStep: "before_CREATE", - Message: "running hooks", - LastRequestUser: lastRequestUser, + EnvironmentId: newId.String(), + State: "PENDING", + Transition: "CREATE", + TransitionStep: "before_CREATE", + Message: "running hooks", + LastRequestUser: lastRequestUser, + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) env.addSubscription(sub) @@ -1210,23 +1256,14 @@ func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[str // Ensure the environment_id is available to all env.UserVars.Set("environment_id", env.id.String()) - // in case of err==nil, env will be false unless user - // set it to True which will be overwriten in server.go - env.Public, env.Description, err = parseWorkflowPublicInfo(workflowPath) - if err != nil { - log.WithField("public info", env.Public). - WithField("partition", env.Id().String()). - WithError(err). - Warn("parse workflow public info failed.") - } - the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: "PENDING", - Transition: "CREATE", - TransitionStep: "CREATE", - Message: "loading workflow", - LastRequestUser: lastRequestUser, + EnvironmentId: newId.String(), + State: "PENDING", + Transition: "CREATE", + TransitionStep: "CREATE", + Message: "loading workflow", + LastRequestUser: lastRequestUser, + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) env.workflow, err = envs.loadWorkflow(workflowPath, env.wfAdapter, workflowUserVars, env.BaseConfigStack) @@ -1236,17 +1273,16 @@ func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[str return } - env.Public, env.Description, _ = parseWorkflowPublicInfo(workflowPath) - cvs, _ := env.Workflow().ConsolidatedVarStack() the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: env.CurrentState(), - Transition: "CREATE", - TransitionStep: "after_CREATE", - Message: "workflow loaded", - Vars: cvs, // we push the full var stack of the root role in the workflow loaded event - LastRequestUser: lastRequestUser, + EnvironmentId: newId.String(), + State: env.CurrentState(), + Transition: "CREATE", + TransitionStep: "after_CREATE", + Message: "workflow loaded", + Vars: cvs, // we push the full var stack of the root role in the workflow loaded event + LastRequestUser: lastRequestUser, + WorkflowTemplateInfo: env.GetWorkflowInfo(), }) log.WithField("method", "CreateAutoEnvironment"). diff --git a/core/environment/utils.go b/core/environment/utils.go index 5b6b6dbc..3270f24c 100644 --- a/core/environment/utils.go +++ b/core/environment/utils.go @@ -28,38 +28,47 @@ import ( "bytes" "encoding/json" "fmt" - "github.com/AliceO2Group/Control/core/the" - "gopkg.in/yaml.v3" "os" "sort" + + "github.com/AliceO2Group/Control/core/the" + "gopkg.in/yaml.v3" ) -func parseWorkflowPublicInfo(workflowExpr string) (bool, string, error) { +type WorkflowPublicInfo struct { + IsPublic bool + Name string + Description string +} + +func parseWorkflowPublicInfo(workflowExpr string) (WorkflowPublicInfo, error) { repoManager := the.RepoManager() resolvedWorkflowPath, _, err := repoManager.GetWorkflow(workflowExpr) //Will fail if repo unknown if err != nil { - return false, "", err + return WorkflowPublicInfo{}, err } yamlFile, err := os.ReadFile(resolvedWorkflowPath) if err != nil { - return false, "", err + return WorkflowPublicInfo{}, err } nodes := make(map[string]yaml.Node) err = yaml.Unmarshal(yamlFile, &nodes) if err != nil { - return false, "", err + return WorkflowPublicInfo{}, err } + name := nodes["name"].Value + description := "" isPublic := nodes["name"].Tag == "!public" if nodes["description"].Tag == "!public" { description = nodes["description"].Value } - return isPublic, description, nil + return WorkflowPublicInfo{IsPublic: isPublic, Name: name, Description: description}, nil } func JSONSliceToSlice(payload string) (slice []string, err error) { diff --git a/core/server.go b/core/server.go index 880b6b14..6cfa3bce 100644 --- a/core/server.go +++ b/core/server.go @@ -311,6 +311,10 @@ func (m *RpcServer) doNewEnvironmentAsync(cxt context.Context, request *pb.NewEn Error: "cannot create new environment", Message: err.Error(), LastRequestUser: request.RequestUser, + WorkflowTemplateInfo: &evpb.WorkflowTemplateInfo{ + Public: request.GetPublic(), + Path: request.GetWorkflowTemplate(), + }, }) return } @@ -323,14 +327,19 @@ func (m *RpcServer) doNewEnvironmentAsync(cxt context.Context, request *pb.NewEn Error: "cannot get newly created environment", Message: err.Error(), LastRequestUser: request.RequestUser, + WorkflowTemplateInfo: &evpb.WorkflowTemplateInfo{ + Public: request.GetPublic(), + Path: request.GetWorkflowTemplate(), + }, }) return } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: id.String(), - State: newEnv.CurrentState(), - LastRequestUser: request.RequestUser, + EnvironmentId: id.String(), + State: newEnv.CurrentState(), + LastRequestUser: request.RequestUser, + WorkflowTemplateInfo: newEnv.GetWorkflowInfo(), }) return }