New RunLLM response generated: >>>*# Question* Ar...
# runllm-flyte-trial
a
New RunLLM response generated: >>>*# Question* Are there any details on how to configure Flyte to send email notifications? The documentation is good on how to request it on the flytekit side: https://docs.flyte.org/en/latest/user_guide/productionizing/notifications.html, but how can I configure it on the FlyteAdmin side? Also, no info on how to configure slack. # Answer To configure email notifications on the FlyteAdmin side, you need to update the FlyteAdmin configuration file. The configuration involves setting up the notification type, email server details, and email content templates. Here are the steps: 1. For Sandbox Environment: - Register a SendGrid API key and add it to your sandbox configuration file (
config-sandbox.yaml
).
Copy code
notifications:
  type: sandbox
  emailer:
    emailServerConfig:
      serviceName: sendgrid
      apiKeyEnvVar: SENDGRID_API_KEY
    subject: "Notice: Execution \"{{ workflow.name }}\" has {{ phase }} in \"{{ domain }}\"."
    sender: "flyte-notifications@company.com"
    body: >
       Execution \"{{ workflow.name }} [{{ name }}]\" has {{ phase }} in \"{{ domain }}\". View details at
       <a href="http://flyte.company.com/console/projects/{{ project }}/domains/{{ domain }}/executions/{{ name }}">
       http://flyte.company.com/console/projects/{{ project }}/domains/{{ domain }}/executions/{{ name }}</a>. {{ error }}
2. For AWS Environment: - Set up an SNS topic and an SQS queue, and configure a verified SES email address.
Copy code
notifications:
  type: "aws"
  region: "us-east-1"
  publisher:
    topicName: "arn:aws:sns:us-east-1:{{ YOUR ACCOUNT ID }}:{{ YOUR TOPIC }}"
  processor:
    queueName: "{{ YOUR QUEUE NAME }}"
    accountId: "{{ YOUR ACCOUNT ID }}"
  emailer:
    subject: "Notice: Execution \"{{ workflow.name }}\" has {{ phase }} in \"{{ domain }}\"."
    sender: "flyte-notifications@company.com"
    body: >
       Execution \"{{ workflow.name }} [{{ name }}]\" has {{ phase }} in \"{{ domain }}\". View details at
       <a href="http://flyte.company.com/console/projects/{{ project }}/domains/{{ domain }}/executions/{{ name }}">
       http://flyte.company.com/console/projects/{{ project }}/domains/{{ domain }}/executions/{{ name }}</a>. {{ error }}
For Slack notifications, you need to configure the notifications in your Flyte platform and specify them in your launch plan: 1. Configure Notifications in Flyte Platform: - In your Helm chart configuration, add the following:
Copy code
workflow_notifications:
  enabled: true
  config:
    notifications:
      type: slack
      slack:
        url: <slack-webhook-url>
2. Specify Notifications in Launch Plan:
Copy code
from flytekit import Slack, WorkflowExecutionPhase, LaunchPlan, workflow, task

@task
def my_task():
    ...

@workflow
def my_workflow():
    my_task()

my_launch_plan = LaunchPlan.get_or_create(
    workflow=my_workflow,
    notifications=[
        Slack(
>>```
phases=[WorkflowExecutionPhase.SUCCEEDED, WorkflowExecutionPhase.FAILED], recipients_email=["my-channel@slack.com"], ) ], ) ``` Sources: - Flyte Notifications Configuration - Flyte Deployment Notifications - Flyte Discuss on Slack Notifications Slack Link https://flyte-org.slack.com/archives/CP2HDHKE1/p1719622919.153569 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.