<#CP2HDHKE1|ask-the-community> how to run the laun...
# ask-the-community
k
#ask-the-community how to run the launch plan in remote ? i m trying with a simple hello world script to send email notification. import typing from flytekit import Email, FixedRate, LaunchPlan, PagerDuty, Slack, WorkflowExecutionPhase, task, workflow @task def say_hello() -> str: return "hello world" @workflow def my_wf() -> str: res = say_hello() return res my_notifying_launch_plan = LaunchPlan.get_or_create( name="my_notifying_lp", workflow=my_wf, notifications=[ Email( phases=[WorkflowExecutionPhase.SUCCEEDED], recipients_email=["kamakshi.muthukrishnan@outlook.com"], ), Slack( phases=[WorkflowExecutionPhase.SUCCEEDED, WorkflowExecutionPhase.FAILED, WorkflowExecutionPhase.ABORTED, WorkflowExecutionPhase.TIMED_OUT,], recipients_email=["XXXX@XXX.slack.com"], ) ], )
k
you want to use flytekit remote to create LP?
k
@Kevin Su - I am using pyflyte cli to run the workflow. I dont see the launchplan is getting created as dropdown in UI
k
how did you register the workflow, pyflyte run? If so, could you try pyflyte register instead?
k
@Kevin Su Using this to run the workflow .. pyflyte run --remote --service-account spark flyte/workflows/hi_world.py my_wf. I thought this is create a launch plan also
k
pyflyte run doesn’t register LP for now. we plan to support it in the future release.
k
how should i register launch plan then
k
you could use flytekit remote or use pyflyte register a workflow, pyflyte will register the LP
k
can you help me with the full syntax for LP
k
pyflyte register flyte/workflows/hi_world.py
k
@Kevin Su - Thank u. LP is reflecting when i see flytectl get launchplan -p flytesnacks -d development ..Then i did run the wf .. Looks like I m not doing something correctly here
it never triggered any email
M i missing anything ?
@Kevin Su Also where can i see the registered LP in UI
k
image.png
k
@Kevin Su - I am only seeing this
k
which version of flyteconsole you’re using
you can click top right button to see the version
k
image.png
k
it’s pretty old version
could you upgrade it
k
let me do it
k
you can also see the LP when you launch the workflow
k
i did run the workflow pyflyte run --remote --service-account spark hi_world.py my_wf
@Kevin Su dont see the launchplan being listed.. also it never triggered any email
k
launchplan isn’t listed after upgrading flyteconsole?
k
@Kevin Su Launch plan got upgraded after using the latest image. Just that it didnt trigger any email or slack notification
k
@Yee do we need additional setup to send email and slack notification?
k
@Yee @Kevin Su - any help here ?
@Kevin Su @Ketan (kumare3) @Samhita Alla.. Can I simply use latest tag for upgrading flyte ? or any specific version u suggest ?
s
You can upgrade to the latest version. Can you share the LaunchPlan you created enabling email/Slack notification?
k
@Samhita Alla - I m not sure why the Propeller image is taking a different repo.. it is showing as flytepropeller: image: # -- Docker image for Flytepropeller deployment repository: pingsutw/flytepropeller # FLYTEPROPELLER_IMAGE tag: fcfce5e490382297e88e8f8c5ca02084acf6a4d8 # FLYTEPROPELLER_TAG pullPolicy: IfNotPresent
import typing from flytekit import Email, FixedRate, LaunchPlan, PagerDuty, Slack, WorkflowExecutionPhase, task, workflow @task def say_hello() -> str: return "hello world" @workflow def my_wf() -> str: res = say_hello() return res my_notifying_launch_plan = LaunchPlan.get_or_create( name="my_notifying_lp", workflow=my_wf, notifications=[ Email( phases=[WorkflowExecutionPhase.SUCCEEDED], recipients_email=["kamakshi.muthukrishnan@outlook.com"], ), Slack( phases=[WorkflowExecutionPhase.SUCCEEDED, WorkflowExecutionPhase.FAILED, WorkflowExecutionPhase.ABORTED, WorkflowExecutionPhase.TIMED_OUT,], recipients_email=["XXXX@XXX.slack.com"], ) ], )
s
@Kevin Su, how should we change the FlytePropeller image?
Also, are notifications supported only on AWS? @Yee
k
You have to use sendgrid or something else on other platforms
Folks can integrate if they like
k
@Ketan (kumare3).. Sorry.. I tried to upgrade the propeller version alone . But now, i dont even see the Kubernetes or python task logs not coming up...Is there specific reason >.
151 Views