Currently flyteadmin notifications are delivered using the PagerDuty, Github and Slack email APIs. On AWS deployments FlyteAdmin uses SES to trigger emails, for all others the only alternative email implementation is SendGrid integration.
Setting up SES or SendGrid can be somewhat complicated. Furthermore, asking your Flyte users to configure the aforementioned services with email integrations adds even more overhead. It would be simpler as an alternative to provide webhook integration for notification so that users only have to configure existing API keys for PagerDuty/Github/Slack.
Flyte currently only allows sending notifications by email and requires users to explicitly define notification rules in their launchplans.
Add A webhook in flyteAdmin, triggered by an event in a source system and sent to a destination system (Slack, Gmail, Discord), with a payload of data (task, node, workflow envent / cloud event).
type WebHookConfig struct {
// Type of webhook service to use. Currently only "slack" is supported.
Name string `json:"name"`
URL string `json:"url"`
Payload string `json:"payload"`
SecretName string `json:"secret"`
NotificationsProcessorConfig NotificationsProcessorConfig `json:"processor"`
}
// WebhooksNotificationConfig defines the configuration for the webhook service.
type WebhooksNotificationConfig struct {
// Defines the cloud provider that backs the scheduler. In the absence of a specification the no-op, 'local'
// scheme is used.
Type string `json:"type"`
AWSConfig AWSConfig `json:"aws"`
GCPConfig GCPConfig `json:"gcp"`
NotificationsPublisherConfig NotificationsPublisherConfig `json:"publisher"`
WebhooksConfig []WebHookConfig `json:"webhooks"`
// Number of times to attempt recreating a notifications processor client should there be any disruptions.
ReconnectAttempts int `json:"reconnectAttempts"`
// Specifies the time interval to wait before attempting to reconnect the notifications processor client.
ReconnectDelaySeconds int `json:"reconnectDelaySeconds"`
}
# FlyteAdmin ConfigMap
webhook:
- name: Slack
url: https://hooks.slack.com/services/T00000000
secret: <secret_name>
trigger:
- when: workflow.status.phase not in ['Succeeded']
send: [slack-notification-1]
- when: workflow.status.phase in ['Succeeded']
send: [slack-notification-2]
template:
// TBD: should we support fine-grain notification?
- slack-notification-1
message: |
Workflow {{.workflow.name}} status is {{.workflow.status}}.
- slack-notification-2
message: |
Workflow {{.workflow.name}} Succeeded
Use Launch Plan to override default webhook system config.
int_doubler_wf_lp = LaunchPlan.get_or_create(
name="int_doubler_wf",
workflow=int_doubler_wf,
default_inputs={"a": 4},
notifications=[
Webhook(
phases=[WorkflowExecutionPhase.SUCCEEDED],
url=["https://slack/..."],
message="Workflow {{.workflow.name}} status is {{.workflow.status}}."
)
],
)
Add wehbook config to MatchableResource, people can defines a webhook config that can be configured by customizable Project-, ProjectDomain.
We can add a sandbox publisher in the flyteadmin, this publisher directly sends the event or message to the exteranl service (slack) without setting up sns/sqs. We utilize a message queue because it ensures the delivery of events to external services. we can sacrifice the guaranteed delivery in the sandbox.
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing