straight-businessperson-54649
09/07/2023, 2:00 PMhigh-park-82026
workflow_notifications
in flyte-core (might be inconsistent) but you can put the same emailer
block there and it will work just the same.
Have you successfully tested it in sandbox?straight-businessperson-54649
09/07/2023, 4:03 PMstraight-businessperson-54649
09/08/2023, 4:48 PMsendgrid
setup with flyte-core
chart as such:
workflow_notifications:
enabled: true
config:
notifications:
type: sandbox
emailer:
emailServerConfig:
serviceName: sendgrid
apiKeyEnvVar: $SENDGRID_API_KEY
subject: "Notice: Execution \"{{ workflow.name }}\" has {{ phase }} in \"{{ domain }}\"."
sender: "<mailto:foo@foo.com|foo@foo.com>"
body: >
asdf
When upgrading the chart, this error appeared:
helm.go:81: [debug] template: flyte/charts/flyte-core/templates/flytescheduler/deployment.yaml:16:27: executing "flyte/charts/flyte-core/templates/flytescheduler/deployment.yaml" at <include (print .Template.BasePath "/admin/configmap.yaml") .>: error calling include: template: flyte/charts/flyte-core/templates/admin/configmap.yaml:48:28: executing "flyte/charts/flyte-core/templates/admin/configmap.yaml" at <.Values.workflow_notifications.config.notifications.region>: wrong type for value; expected string; got interface {}
UPGRADE FAILED
Which suggests that the helm chart expects the fields for the AWS setup
(region, publisher, processer) and not the sendgrid
setup, which doesn't have those fields.straight-businessperson-54649
09/08/2023, 4:51 PMstraight-businessperson-54649
09/11/2023, 7:29 PMthankful-minister-83577
high-park-82026
workflow_notifications:
enabled: true
config:
notifications:
type: sandbox
region: wrong-region
emailer:
emailServerConfig:
serviceName: sendgrid
apiKeyEnvVar: $SENDGRID_API_KEY
subject: "Notice: Execution \"{{ workflow.name }}\" has {{ phase }} in \"{{ domain }}\"."
sender: "<mailto:foo@foo.com|foo@foo.com>"
body: >
asdf
high-park-82026
thankful-minister-83577
straight-businessperson-54649
09/12/2023, 3:47 PMsendgrid
never attempts to send an email, and I don't see any evidence of flyteadmin trying to reach sendgrid in the logs (grepped on keywords sendgrid
and notification
) when running a successful execution with the following launchplan copied directly from the example in the docs:
@task
def double_int_and_print(a: int) -> str:
return str(a * 2)
@workflow
def int_doubler_wf(a: int) -> str:
doubled = double_int_and_print(a=a)
return doubled
wacky_int_doubler_lp = LaunchPlan.get_or_create(
name="wacky_int_doubler",
workflow=int_doubler_wf,
default_inputs={"a": 4},
notifications=[
Slack(
phases=[
WorkflowExecutionPhase.SUCCEEDED,
WorkflowExecutionPhase.ABORTED,
WorkflowExecutionPhase.TIMED_OUT,
WorkflowExecutionPhase.FAILED,
],
recipients_email=["<http://xxx.slack.com|xxx.slack.com>"],
),
],
)
In flyteadmin
I see the correct content passed to /etc/flyte/config/notifications.yaml
notifications:
type: sandbox
region: foo
emailer:
body: |
Execution \"{{ workflow.name }} [{{ name }}]\" has {{ phase }} in \"{{ domain }}\". View details at <a href=\<https://xxx.xxxx.com/console/projects/{{> project }}/domains/{{ domain }}/executions/{{ name }}> <https://xxx.xxx.com/console/projects/{{> project }}/domains/{{ domain }}/executions/{{ name }}</a>. {{ error }}
emailServerConfig:
apiKeyEnvVar: xxxx
serviceName: sendgrid
sender: <mailto:myemail@xxx.com|myemail@xxx.com> (<- this email is my verified sender identity on sendgrid)
subject: 'Notice: Execution "{{ workflow.name }}" has {{ phase }} in "{{ domain }}".'
Is there anything else you recommend I check? Do these configurations looks correct? Thanks!straight-businessperson-54649
09/14/2023, 12:26 PMthankful-minister-83577
logger:
show-source: true
level: 5
thankful-minister-83577
thankful-minister-83577
straight-businessperson-54649
09/14/2023, 5:10 PMstraight-businessperson-54649
09/18/2023, 6:50 AMnotifications:
type: sandbox
emailer:
emailServerConfig:
apiKeyEnvVar: "SENDGRID_API_KEY"
subject: "Notice: Execution \"{{ name }}\" has {{ phase }} in \"{{ domain }}\"."
sender: "<mailto:example@gmail.com|example@gmail.com>" # Consider using a generic email instead of personal
body: >
Execution \"{{ name }}\" has {{ phase }} in \"{{ domain }}\". View details at
<a href=\<http://example.com/projects/{{> project }}/domains/{{ domain }}/executions/{{ name }}>
<http://example.com/projects/{{> project }}/domains/{{ domain }}/executions/{{ name }}</a>. {{ error }}
straight-businessperson-54649
09/18/2023, 9:11 AMthankful-minister-83577
thankful-minister-83577
thankful-minister-83577
straight-businessperson-54649
09/18/2023, 4:54 PMtype: sandbox
thankful-minister-83577
straight-businessperson-54649
09/18/2023, 5:30 PMthankful-minister-83577
thankful-minister-83577
thankful-minister-83577
straight-businessperson-54649
09/18/2023, 5:31 PMthankful-minister-83577
straight-businessperson-54649
09/18/2023, 5:33 PM