-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagating informational & error messages from workers to frontend #38
Comments
I definitely want to extend the possibilities on this topic (handling model feedback, logging, progress reporting, and so on) in the ESDL MapEditor as well, so for asset-feedback there is no work (or hardly any work), but in general this statement is not valid. |
Too add to Arguments to not use codes but rather forward the messages as is: I know that the mesido team has decided not to use message codes, which I prefer. The mapeditor will directly display the This will mean that:
Regarding the Remaining questions: I think is useful to have general feedback messages (also as an option in the ESDL validator). We have to discuss the best way for displaying these and implement. |
True.... adding non-asset specific feedback to the MapEditor is easy and good to add! |
I would prefer to forward the messages as they are from a maintenance perspective.
For the time being, if we constantly receiving similar support requests from the users, I would look into the direction of having a Q&A section on the (architecture) documentation page that lists a few commonly seen technical/error messages to help users with the next steps. |
Hea Cheng-Kai!
From MapEditor perspective it doesn't add much but for frontends e.g. NWN-DTK by TPG it is a must to have some form of standardization so they can attach both user-friendly messages and also provide the option to have technical messages available.
Definitely a concern and it seems this is also the core of Mark's worries on how to proceed here.
Definitely good to add! Currently they are not receiving any technical/error messages so lets provide both some form of message and also a Q&A section. Going to reply with another message shortly to alter the proposal to one that seems to have the most support currently. |
Currently it is a step too far to use codes for messages. Conversation with TPG has shown that some form of parsing will have to happen in the future, but there is no necessity currently. There is also not enough support from the development teams to pick it up now, so we are going to move forward with sending messages transparantly through OMOTES and keep the option open to use codes at a later point in time. The motivation to immediately move to codes was due to the expected investment needed by the optimizer and simulator teams but the current investigation has shown that the immediate investment is very little (~10ish messages expected). Therefore, the proposed plan for now:
@MichielTukker @MarkTNO @edwinmatthijssen @KobusVanRooyen : Does this altered proposal have your support? If so, I will also check with the others before proceeding with a detailed design. Otherwise, please share your thoughts and proposed alterations. |
@MichielTukker @MarkTNO @edwinmatthijssen @KobusVanRooyen I haven't had a reply yet on my Q if this altered proposal fits for you all. If so, we can start work on it at the cloud side. |
This sounds good! |
To me too....! |
@lfse-slafleur in principle it all sounds good, except the last bullet point about documentation. But I think we can discuss this item further and it will should not prevent code development work. |
@KobusVanRooyen Discussed through Teams. We will hold off on generating more documentation for each issue. Instead, we will see if the messages are info enough for users. |
First version is integrated in mapeditor. |
Staggered approach. First we are going to focus on transporting messages transparantely from the worker to the frontend without any type of parsing by OMOTES. There is currently not enough support nor value in providing informational messages through codes. However, we may introduce codes at a later stage if it becomes a requirement.
New plan detailed below. Left this starting comment as is for when we will continue the work using codes.
Issue description
The worker expresses multiple types of information that is useful to show to a user of the frontend regarding their submitted job. The following types of information have been gathered:
Currently errors are caught and the logs of a job are forwarded to the frontend. However, this is not a user-friendly way of showing any type of errors. Mostly because it doesn't only show the error but also all kinds of debug information. While this debug information is useful for developers, a user is unable to currently interpret it. Therefore, we should provide a way for user-friendly error messages to be propagated from the worker to the frontend.
Also, in the near future, we expect that the workers are able to supply additional information to a user regarding the output ESDL. This is also referred to as 'Asset Feedback'. Specifically MapEditor already supports a method for showing informational messages tied to a specific asset and MapEditor requires a specific format to be used for these informational messages.
Origin of messages
While the worker will perform the job, the orchestrator may also introduce informational messages. Specifically if a job timeout or delivery limit was reached the orchestrator will provide the necessary error message.
Solution direction
Displaying the informational message(s) at the frontend
Each frontend will have their own interface on how to display the messages. Specifically localization (language in which the message is shown) may be different depending on the frontend and the user. A frontend may want to:
DEBUG
.Job A could not be processed because the worker was unable to finish the job repeatedly
. A frontend may rather choose to show the messagePlease contact our support desk with the following reference: E012
.In order to fit all the requirement informational messages will not use a message in a single language, but rather a message code. Currently we expect 3 different message codes for errors from the optimizer, around 3 error codes from the orchestrator and an unknown amount from the simulator. This list will grow in the future.
This code will be accompanied with a number of key-value pairs that make up the dynamic parts of the error message. Example: 'The heatdemand in <asset_id> could not be met by <number_of_wh> wh' where
asset_id
andnumber_of_wh
are dynamic values.Identifiers
The identifiers to use for messages codes will be of string type. This allows a message code to be descriptive and human-readable without the corresponding message. This leads to more readable source code, easier to understand errors during system administration as well as reduce the amount of bugs if messages codes would be only an integer (easy to make a simple typing mistake).
Severity
The proposal is to use the same levels for severity as the logging module follow:
DEBUG
<-- Useful only for developers. Should not be shown to users per default. Specifically optimizer team expects this level to be useful.INFO
<-- Shows extra information regarding the output ESDL without questioning the validity of the result.WARNING
<-- Something regarding the output ESDL is questioning its validity. The user should inspect if the warning is a cause of concern.ERROR
<-- Job (optimization or simulation) could not succeed because there was something wrong in the input data or the job couldn't be processed due to an IT infrastructure issue (e.g. job timeout, job reached delivery limit). It is also possible that an ESDL may be invalid but an output esdl is still given. For this situation, it may occur that a message exists with severity error and an output ESDL is still generated.Categories
The proposal is to prefix message codes with a category based on the origin of the message. An example list:
orchestrator_<message code identifier>
simulator_<message code identifier>
optimizer_<message code identifier>
This allows message codes to be divided across the origin component of the message and prevents overlap. This also allows OMOTES to use the same message code identifier as the component underneath uses by just prefixing a category.
Dynamic values in informational message
A message may reference a message code to denote the meaning, but to convert the message into a language e.g. English or Dutch the message may contain a number of dynamic values. For instance a message e.g.
The peak of heatdemand for asset {{asset_id}} exceeds the total heatproduction by {{exceeded_by_kwh}} kwh of thermal energy.
contains 2 dynamic values:asset_id
andexceeded_by_kwh
. Therefore, messages codes may be accompanied by a number of key-value pairs to further describe the message.Datastructure
An informational message may pertain to a ESDL or a specific asset. It has a severity, a message code and a number of key-value pairs for dynamic values. The following datastructure (within OMOTES) is proposed:
severity: Enum[DEBUG,INFO,WARNING,ERROR]
message_code: str
<-- Examplesimulator_unable_to_parse_esdl
dynamic_values: dict[str, union[str, int, float, bool]]
<-- specifically we allowint
andfloat
as well because a frontend may want to define their own precision when converting a number to text. This dict may be empty.asset_id: str
<-- If this message pertains to a specific asset, theasset_id
field contains the asset id. If the informational message is regarding the job or ESDL as a whole, this field is empty.technical_message: str
<-- The original message from mesido, simulator-core or orchestrator. This is useful for developers and/or support agents. Also for users in case they need to communicate directly with the developers and need to relay the errors that they received. The messages shown to users by the frontend are not necessarily the messages generated by mesido, simulator-core or orchestrator. This message, together with themessage_code
should provide the necessary context for support.Documentation & default template
We should extend the wiki with a 'message code' page that describes what each message code means, the expected dynamic value keys, the expected severity and what type of ESDL asset the message code may reference. We should also maintain a file to with default messages for each message code in English.
Support
The perspective of 'providing support' is essential for this feature. The informational messages may be interpreted solely by the user and/or also by a support agent and/or developer. As such, the informational message is targeting multiple readers at once which each have different use cases for the message:
Users interact with a frontend and how this frontend works is not defined from the scope of OMOTES. Therefore, how to proceed when a specific message is provided should be defined by the frontend. This ties into the requirement for a frontend to be able to define the text which is shown to the user based on a message code and dynamic values.
Architectural division of responsibilities
OMOTES <-> Frontend conversion layer: Proposal is to create a new, optional layer which can convert OMOTES-specific datastructures to Frontend-specific datastructures. This adapter layer uses the SDK and is maintained by the respective frontend team in collaboration with the cloud team. This layer allows the message code to the converted to a message in any format or language.MapEditor will support this adapter layer by extending their generic interface to connect with external models (if necessary) which allows us to keep omotes-rest generic and still the way to connect MapEditor with OMOTES.Proposed extra actions:
Introduce a new architectural layer: OMOTES <-> Frontend conversion layer. This is implicitely defined when the SDK is used directly but this layer is missing when the omotes-rest interface is used.Not (yet) needed for MapEditor.Currently omotes-rest is an opensource REST api that is designed to work around mapeditor AND provide a generic REST interface for other frontends. This dual-purpose creates tension in the design of the component. Now that we have proposed the new OMOTES <-> Frontend architectural layer, we would propose to rename omotes-rest to omotes-rest-mapeditor and redefines its purpose to only work with mapeditor. We could fork a version of the current omotes-rest to a new repository which keeps the name omotes-rest in case we want to provide a generic REST interface later. Specifically, this split allows us to convert the informational messages in OMOTES format to Mapeditor format.Not needed due to change above regarding MapEditor.Example walkthrough at each component in case of an exception at worker
{ "asset_id": "pipe1", "operating_threshold": 30.0, "supply_low_point": 25C, "when": "2024-04-01T01:00:00" }
. The optimizer-worker recognizes this exception and converts it to a JobResult with the informational message{ "severity": "ERROR", "message_code": "optimizer_error_supply_temp_too_low", "dynamic_values": <same as MesidoException>, "technical_message": "<The str(MesidoException)>", "asset_id": "pipe1" }
ResultType.ERROR
.asset feedback
messages. Any DEBUG messages are removed and any messages without anasset_id
?are handled in a different way? (see question below)Arguments to not use codes but rather forward the messages as is
Currently we propose to capture messages from the optimizer/worker and convert them into standardized codes due to the arguments in the previous sections. However, @MarkTNO has made some valid points and voiced some concerns on why we shouldn't use codes but rather forward the messages as-is:
There are trade-offs here that we will want to navigate in the architecture team.
Work due to proposal
Cloud team
Optimizer team
Simulator team
TPG team
MapEditor team
Remaining questions
The text was updated successfully, but these errors were encountered: