damp-lion-88352
07/25/2023, 5:59 AM{
"json": {
"exec_id": "f43c091b4c09c415c911",
"src": "execution_manager.go:1510"
},
"level": "info",
"msg": "@@@ publishing notifications for execution [project:\"flytesnacks\" domain:\"development\" name:\"f43c091b4c09c415c911\" ] in state [SUCCEEDED] for notifications [[]]",
"ts": "2023-07-25T03:34:13+08:00"
}
This is my log in flyteadmin
I use the below code and run
pyflyte run --copy-all --remote launch-plan.py int_doubler_wf --a 8
from datetime import timedelta
from flytekit import Email, FixedRate, LaunchPlan, PagerDuty, Slack, WorkflowExecutionPhase, task, workflow
@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
int_doubler_wf_lp = LaunchPlan.get_or_create(
name="int_doubler_wf",
workflow=int_doubler_wf,
default_inputs={"a": 4},
notifications=[
Email(
phases=[
WorkflowExecutionPhase.FAILED,
WorkflowExecutionPhase.ABORTED,
WorkflowExecutionPhase.TIMED_OUT,
WorkflowExecutionPhase.SUCCEEDED,],
recipients_email=["<mailto:eric901201@gmail.com|eric901201@gmail.com>"],
)
],
)
Thank you very muchfaint-activity-87590
07/25/2023, 12:03 PMdamp-lion-88352
07/25/2023, 12:16 PM```python
# remote_register.py
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config, ImageConfig
from workflows.example import wf
from flytekit import ImageSpec
from flytekit import workflow, LaunchPlan, CronSchedule
from flytekit import Email,WorkflowExecutionPhase
remote = FlyteRemote(config=Config.auto(), \
default_project="flytesnacks", default_domain="development")
launch_plan = LaunchPlan.get_or_create(
wf,
name="<http://workflows.example.wf|workflows.example.wf>",
default_inputs={"name": "Elmo"},
notifications=[
Email(
phases=[
WorkflowExecutionPhase.FAILED,
WorkflowExecutionPhase.ABORTED,
WorkflowExecutionPhase.TIMED_OUT,
WorkflowExecutionPhase.SUCCEEDED,],
recipients_email=["<mailto:eric901201@gmail.com|eric901201@gmail.com>"],
)],
)
execution = remote.execute(launch_plan, inputs={"name": "Kermit"}, image_config=ImageConfig.auto(img_name="futureoutlier/flyte-practice:latest"))
```
damp-lion-88352
07/25/2023, 12:17 PMfaint-activity-87590
07/25/2023, 1:35 PMdamp-lion-88352
07/25/2023, 1:36 PM