https://flyte.org logo
Title
o

Oliver Nguyen

08/10/2022, 4:13 AM
Hi everyone. I don't know if I can use flyte-pod-webhook to send workflow status notifications to discord app?. Thanks all
k

Ketan (kumare3)

08/10/2022, 4:16 AM
not flyte-pod-webhook, but you can send status notifications using Flyte event egress
👍 1
Another option is to simply use the Discord Email address to send notifications
this is available out of the box
o

Oliver Nguyen

08/10/2022, 4:27 AM
Thanks, @Ketan (kumare3). I will try it
I'm getting the error
function "workflow" not defined
when configuring the values file. Do I need to define it somewhere? @Ketan (kumare3)
y

Yuvraj

08/10/2022, 4:54 AM
@Oliver Nguyen Can you make your body in double quotes ? I think helm is thinking it’s helm syntax.
o

Oliver Nguyen

08/10/2022, 5:05 AM
I did add double quotes in the body and tried to remove the vertical line. it's still doesn't solve
y

Yuvraj

08/10/2022, 5:14 AM
oh i found the issue, It exist in our helm chart here https://github.com/flyteorg/flyte/blob/43ae9b335df08f7c642a03e4020a8337da7f9d71/charts/flyte-core/templates/admin/configmap.yaml#L46 We have a helm function
tpl
for substituting the
.values.usersettings
and because of that helm is also evaluating the
{{ workflow.project }}
and it is not available in helm chart helper
❤️ 1
o

Oliver Nguyen

08/10/2022, 7:01 AM
so how to fix them? @Yuvraj
y

Yuvraj

08/10/2022, 7:03 AM
In your chart replace this line https://github.com/flyteorg/flyte/blob/43ae9b335df08f7c642a03e4020a8337da7f9d71/charts/flyte-core/templates/admin/configmap.yaml#L46 with
notifications.yaml: | {{ toYaml . | nindent 4 }}
And in your values file for notification please don’t use
.values.usersettings,
Use direct values
❤️ 1
I mean this config should not have any
values.usersettings
, substitute them manually
workflow_notifications:
  enabled: false
  config:
    notifications:
      type: aws
      region: "{{ .Values.userSettings.accountRegion }}"
      publisher:
        topicName: "arn:aws:sns:{{ .Values.userSettings.accountRegion }}:{{ .Values.userSettings.accountNumber }}:flyte-notifications-topic"
      processor:
        queueName: flyte-notifications-queue
        accountId: "{{ .Values.userSettings.accountNumber }}"
      emailer:
        subject: "Flyte: {{ project }}/{{ domain }}/{{ launch_plan.name }} has '{{ phase }}'"
        sender: "<mailto:flyte@example.com|flyte@example.com>"
        body: |
          Execution {{ workflow.project }}/{{ workflow.domain }}/{{ workflow.name }}/{{ name }} has {{ phase }}.
          Details: <https://flyte.example.com/console/projects/{{> project }}/domains/{{ domain }}/executions/{{ name }}.
          {{ error }}
👍 1
k

Ketan (kumare3)

08/10/2022, 1:28 PM
Cc @Oliver Nguyen / @Yuvraj let's file a docs issue please
👍 2
o

Oliver Nguyen

08/11/2022, 6:56 AM
Hi all. after fixing according to the solution of @Yuvraj, I have successfully configured flyte notifications for sending the workflow status message to Email.
❤️ 1
k

Ketan (kumare3)

08/11/2022, 3:20 PM
Can you contribute to the docs
y

Yuvraj

08/11/2022, 5:39 PM
It need fix in helm chart, I created a issue https://github.com/flyteorg/flyte/issues/2761
❤️ 1