|
| 1 | +/* |
| 2 | + * === This file is part of ALICE O² === |
| 3 | + * |
| 4 | + * Copyright 2024 CERN and copyright holders of ALICE O². |
| 5 | + * Author: Teo Mrnjavac <[email protected]> |
| 6 | + * |
| 7 | + * This program is free software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU General Public License as published by |
| 9 | + * the Free Software Foundation, either version 3 of the License, or |
| 10 | + * (at your option) any later version. |
| 11 | + * |
| 12 | + * This program is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License |
| 18 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | + * |
| 20 | + * In applying this license CERN does not waive the privileges and |
| 21 | + * immunities granted to it by virtue of its status as an |
| 22 | + * Intergovernmental Organization or submit itself to any jurisdiction. |
| 23 | + */ |
| 24 | + |
| 25 | +syntax = "proto3"; |
| 26 | + |
| 27 | +package events; |
| 28 | +option java_package = "ch.cern.alice.o2.control.events"; |
| 29 | +option go_package = "github.com/AliceO2Group/Control/common/protos;pb"; |
| 30 | + |
| 31 | +import public "protos/common.proto"; |
| 32 | + |
| 33 | +//////////////// Common event messages /////////////// |
| 34 | + |
| 35 | +enum OpStatus { |
| 36 | + NULL = 0; |
| 37 | + STARTED = 1; |
| 38 | + ONGOING = 2; |
| 39 | + DONE_OK = 3; |
| 40 | + DONE_ERROR = 4; |
| 41 | + DONE_TIMEOUT = 5; |
| 42 | +} |
| 43 | + |
| 44 | +message Ev_MetaEvent_MesosHeartbeat { |
| 45 | +} |
| 46 | + |
| 47 | +message Ev_MetaEvent_CoreStart { |
| 48 | + string frameworkId = 1; |
| 49 | +} |
| 50 | + |
| 51 | +message Ev_MetaEvent_FrameworkEvent { |
| 52 | + string frameworkId = 1; |
| 53 | + string message = 2; |
| 54 | +} |
| 55 | + |
| 56 | +message Ev_EnvironmentEvent { |
| 57 | + string environmentId = 1; |
| 58 | + string state = 2; |
| 59 | + uint32 runNumber = 3; // only when the environment is in the running state |
| 60 | + string error = 4; |
| 61 | + string message = 5; // any additional message concerning the current state or transition |
| 62 | + string transition = 6; |
| 63 | + string transitionStep = 7; |
| 64 | + OpStatus transitionStatus = 8; |
| 65 | + map<string, string> vars = 9; // consolidated environment variables at the root role of the environment |
| 66 | + common.User lastRequestUser = 10; |
| 67 | + common.WorkflowTemplateInfo workflowTemplateInfo = 11; |
| 68 | +} |
| 69 | + |
| 70 | +message Traits { |
| 71 | + string trigger = 1; |
| 72 | + string await = 2; |
| 73 | + string timeout = 3; |
| 74 | + bool critical = 4; |
| 75 | +} |
| 76 | + |
| 77 | +message Ev_TaskEvent { |
| 78 | + string name = 1; // task name, based on the name of the task class |
| 79 | + string taskid = 2; // task id, unique |
| 80 | + string state = 3; // state machine state for this task |
| 81 | + string status = 4; // posible values: ACTIVE/INACTIVE/PARTIAL/UNDEFINED/UNDEPLOYABLE as defined in status.go. |
| 82 | + string hostname = 5; |
| 83 | + string className = 6; // name of the task class from which this task was spawned |
| 84 | + Traits traits = 7; |
| 85 | + string environmentId = 8; |
| 86 | + string path = 9; // path to the parent taskRole of this task within the environment |
| 87 | +} |
| 88 | + |
| 89 | +message Ev_CallEvent { |
| 90 | + string func = 1; // name of the function being called, within the workflow template context |
| 91 | + OpStatus callStatus = 2; // progress or success/failure state of the call |
| 92 | + string return = 3; // return value of the function |
| 93 | + Traits traits = 4; |
| 94 | + string output = 5; // any additional output of the function |
| 95 | + string error = 6; // error value, if returned |
| 96 | + string environmentId = 7; |
| 97 | + string path = 8; // path to the parent callRole of this call within the environment |
| 98 | +} |
| 99 | + |
| 100 | +message Ev_RoleEvent { |
| 101 | + string name = 1; // role name |
| 102 | + string status = 2; // posible values: ACTIVE/INACTIVE/PARTIAL/UNDEFINED/UNDEPLOYABLE as defined in status.go. Derived from the state of child tasks, calls or other roles |
| 103 | + string state = 3; // state machine state for this role |
| 104 | + string rolePath = 4; // path to this role within the environment |
| 105 | + string environmentId = 5; |
| 106 | +} |
| 107 | + |
| 108 | +message Ev_IntegratedServiceEvent { |
| 109 | + string name = 1; // name of the context, usually the path of the callRole that calls a given integrated service function e.g. readout-dataflow.dd-scheduler.terminate |
| 110 | + string error = 2; // error message, if any |
| 111 | + string operationName = 3; // name of the operation, usually the name of the integrated service function being called e.g. ddsched.PartitionTerminate()" |
| 112 | + OpStatus operationStatus = 4; // progress or success/failure state of the operation |
| 113 | + string operationStep = 5; // if the operation has substeps, this is the name of the current substep, like an API call or polling phase |
| 114 | + OpStatus operationStepStatus = 6; // progress or success/failure state of the current substep |
| 115 | + string environmentId = 7; |
| 116 | + string payload = 8; // any additional payload, depending on the integrated service; there is no schema, it can even be the raw return structure of a remote API call |
| 117 | +} |
| 118 | + |
| 119 | +message Ev_RunEvent { |
| 120 | + string environmentId = 1; |
| 121 | + uint32 runNumber = 2; |
| 122 | + string state = 3; |
| 123 | + string error = 4; |
| 124 | + string transition = 5; |
| 125 | + OpStatus transitionStatus = 6; |
| 126 | + reserved 7; // 7 was used for `vars` field that was removed |
| 127 | + common.User lastRequestUser = 8; |
| 128 | +} |
| 129 | + |
| 130 | +/** |
| 131 | + * Beam mode changes are propagated as Kafka events and to be sent by the BKP-LHC-Client on a dedicated topic |
| 132 | + * e.g. dip.lhc.beam_mode |
| 133 | + */ |
| 134 | +message Ev_BeamModeEvent { |
| 135 | + int64 timestamp = 1; // milliseconds since epoch when the beam mode change happened |
| 136 | + common.BeamInfo beamInfo = 2; |
| 137 | +} |
| 138 | + |
| 139 | +message Event { |
| 140 | + int64 timestamp = 1; |
| 141 | + int64 timestampNano = 2; |
| 142 | + reserved 3 to 10; |
| 143 | + reserved 17 to 100; |
| 144 | + |
| 145 | + oneof Payload { |
| 146 | + Ev_EnvironmentEvent environmentEvent = 11; |
| 147 | + Ev_TaskEvent taskEvent = 12; |
| 148 | + Ev_RoleEvent roleEvent = 13; |
| 149 | + Ev_CallEvent callEvent = 14; |
| 150 | + Ev_IntegratedServiceEvent integratedServiceEvent = 15; |
| 151 | + Ev_RunEvent runEvent = 16; |
| 152 | + |
| 153 | + Ev_MetaEvent_FrameworkEvent frameworkEvent = 101; |
| 154 | + Ev_MetaEvent_MesosHeartbeat mesosHeartbeatEvent = 102; |
| 155 | + Ev_MetaEvent_CoreStart coreStartEvent = 103; |
| 156 | + |
| 157 | + Ev_BeamModeEvent beamModeEvent = 110; |
| 158 | + } |
| 159 | +} |
0 commit comments