-
Notifications
You must be signed in to change notification settings - Fork 81
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
notification improvements #1420
Comments
Hi @zsaltys - also want to link these comments from an earlier discussion on persistent reminders feature that begin to start thinking through the above issue described #1248 (comment) Ultimately I envision we would have a list of different "NotificationEvents" (i.e. Also this list of events should be easily extendable if tomorrow we wanted to add a notification for I think it may be best to take some time and iron our a good generic and flexible design on how this notification system would look like in data.all. I think once we define it once it will be seamless to extend to more and more type of events or more and more type of delivery channels to send outbound notifications (on top of already in the UI and (optionally) via email) Please let me know if you are thinking the same and let's use this issue here to discuss further on what that design could entail |
Another small issue - Currently if the share is with a consumption role then the email notification body text contains something like - share request for dataset <DATASET_NAME> for principal ggief66q. The principal name is not readable and it is the internal id used by data.all for that principal. Instead of id this should be replaced with a user friendly readable consumption role name |
ProposalSummarizing the notifications improvements which need to be made
Stage 1There are instances in which someone approves a share, thinking it will succeed, only later to find out that the share failed. Also, since the bucket / kms and IAM policies can be modified in an environment account apart from data.all, there are instance in which the verifier detects unhealthy share but the share requestor and dataset owner are not aware. Apart from this, all ECS tasks which are scheduled fail sometime and this failure is not notified to data.all DAAdmins. Thus adding these notifications is very important. Since these notifications are share related notifications and there already exist share notifications code base, in the first stage, additional notification support can be added. Following will be covered as a part of Stage 1,
Stage 2 ( WIP )In this stage the notifications system will be refactored so that each module can hook up their own notifications (which will conform with some standards set by the notification module ) Currently notifications are only created for shares in the In the case of notifications created for reminders - with persistent email reminders and weekly email reminders tasks -, the code has to specifically find out each data.all resource ( shares, datasets, environments, etc ) and then create a custom email for them. For any additional data.all resource ( e.g. MLStudio ) which needs to be added to these notifications - persistent email / weekly reminders - new functions have to be added to fetch the details in the reminder tasks and then modify the email content. To avoid doing this every time a new resource has to be added to these email, the responsibility of fetching these resources should be handled by the modules themselves and then they should send the data ( with an agreed contract ) to the reminder task, which can then construct the email. In order to solve above issues, there has to be
Before diving into the design for notification improvement, the config.json has to be modified to accommodate new notifications ( dataset notifications, environment notifications , etc ). Also, any additional transport type should be added to the config.json.
"datasets_base": {
"active": true,
"features": {
"**dataset_notifications**": {
"email": {
"active": true,
"persistent_reminders": true
}
}
....
"shares_base": {
"active": true,
"features": {
"show_share_logs": "admin-only",
"**share_notifications**": {
"email": {
"active": true,
"persistent_reminders": true,
"parameters": {
"group_notifications": true
}
}
}
},
"notifications" : {
"email" : true/false,
"slack" : true/false,
"UI" : true/false,
}
....
"core": {
"features": {
"env_aws_actions": false,
"cdk_pivot_role_multiple_environments_same_account": false,
"enable_quicksight_monitoring": false,
"show_stack_logs": "admin-only",
"**environment_notifications**" : {
"email": {
"active": true,
"persistent_reminders": true
}
}
},
OR "notifications": {
"active" : "active/inactive"
"shares_base" : {
"email" : "active",
"slack" : "inactive",
"persistent_reminders (reminders)": true
},
"dataset_base" : {
"email" : "active",
"slack" : "inactive"
}
...
}
OR [UPDATE] - Noah : +1 on this "notifications": {
"email" : "active",
"slack" : "active"
"shares_base" : {
"active" : "active/inactive"
"persistent_reminders (reminders)": true,
.....
},
"dataset_base" : {
"active" : "active/inactive",
"persistent_reminders (reminders)": true,
.....
}
....
} Q1. Can transport and notification separated in a meaningful way ? In order to de-couple notification from the transport of sending the notification, a """
Notification Transport will be registered while initializing the NotificationsModule
"""
class NotificationTransport(ABC):
@abc.abstractVariable
NotificationTransportType: TransportType
@abc.abstractmethod
# This method has to be implemented by the NotificationTransport ( e.g. email , slack, sms, UI notification, etc )
def send_notification(self, NotificationEvent(Interface) ):
raise NotImplementedError
def send_notification_async(self, NotificationEvent(Interface) ):
raise NotImplementedError
class NotificationTransportManager():
self._registered_transport_types: List[NotificationTransport] = []
def **send_notifications_for_type**(self, NotificationEvent, NotificationTransportTypes: List[TransportTypes])
# First, check if the Notification module for the NotificationEvent is enabled
# If notification tranports are specified as a parameter use those types and send notification via those types
notification_tranports = self._registered_transport_types
if NotificationTransportTypes != None:
notification_tranports = [ notificationTranpsport for notificationTransport in NotificationTransportTypes if notificationTransport in self._registered_transport_types]
# Send notifications for different types of transport types
# e.g. one way could be
for transport_type in self._registered_transport_types:
transport_type.send_notification(NotificationEvent) NotificationTransport's concrete implementation will be initialized in the The TransportTypes( Enum ) will be an enum class describing the types of notifications( e.g. email, slack, UI , etc ). These transport types can later be used as a filter to send notification only via certain transport. e.g. sending email notification but not UI notifications. Q2. How should the notification template look like ? e.g class NotificationsBase:
@abc.abstractMethod
def get_resources_for_reminders() -> List[NotificationEvent]
raise NotImplemetedError() Q3. What is most common and important things in the template for notification event ? Any event can be described by the following NotificationEvent class. In the future if needed this class can be extended.. class NotificationEvent:
def __init__():
self.message = message
self.receivers = receivers
self.title / subject = title
self.notification_module = module_name ( 'shares_base', 'dataset_base', 'environment', etc notification )
self.resource_status = Any string / enum describing notification ( Optional for email notifications but required for UI notifications)
self.resource_identifier = Any identifier for that event ( e.g. {shareUri}|{datasetUri} )
self.uri_path = contains path of the weblink ( e.g. /console/shares/{shareUri} )
self.async_process = true/false ( This is used for determining if the Notification should be send synchronously of asynchronously ) Q4. Simplifying Share Notification msg / email body, subject so as to avoid repeated template ? Part of refactoring,
|
@dlpzx , @noah-paige , do you know why we converted notifications from core to modules ? I wanted to add admin notifications for stacks but I noticed that notifications is in modules and there should not be imports from modules to core |
There are various actions in data.all that happen asynchronously such as a share being processed, dataset and environment stacks being updates, health of shares being verified etc. All of these actions can fail for whatever reason. Currently when things fail users are not able to find out until they check the logs or inspect data.all UI.
I'd like to propose that all asynchronous actions in data.all that can fail would send notifications and also be integrated with the recent reminder service that was implemented for shares to remind users that approvals for shares are pending.
A list of actions that should send notifications and to whom they should be sent:
a) An approved share fails (or revoked) to become successfully processed - both dataset owner and requester team should be notified and reminded. Optionally DA admins should also be able to subscribe to these notifications.
b) Dataset or Environment stack fails to update environment admin team should be notified as well as the dataset owner team. Reminders should be sent. DA admins should be able to optionally subscribe as well.
c) Any background task such as catalog reindexing, share health verified - if it fails (throws an exception) then DA admins should be notified ONCE.
d) If a share becomes unhealthy both the requester and dataset owner should be notified and reminded. DA admins should be able to optionally subscribe also.
e) If attempting to re-apply a share fails both the requester and dataset owner should be notified ONCE. DA admins should be able to optionally subscribe also.
There are already a few tickets filed for this effort that we should combine into this major story:
#1251
#1299
There might be more that I was not able to find.
The text was updated successfully, but these errors were encountered: