Thanks


---原始邮件---
发件人: "David Dai"<[email protected]&gt;
发送时间: 2021年10月6日(周三) 晚上11:00
收件人: "dev"<[email protected]&gt;;
主题: Re: 回复: [PROPOSAL] Add Python API implementation of workflows-as-code


hi, you can send mail to [email protected]
to unsubscribe the mailing list


Best Regards



---------------
Apache DolphinScheduler PMC Chair
David Dai
[email protected]
Linkedin: https://www.linkedin.com/in/dailidong
Twitter: @WorkflowEasy
---------------

On Sat, Oct 2, 2021 at 9:18 PM Marlone <[email protected]&gt; wrote:
&gt;
&gt; 提示邮箱满了,哪位负责处理的?
&gt;
&gt;
&gt;
&gt; ---原始邮件---
&gt; 发件人: "感谢政府"<[email protected]&amp;gt;
&gt; 发送时间: 2021年9月30日(周四) 上午10:42
&gt; 收件人: "dev"<[email protected]&amp;gt;;
&gt; 主题: 回复:回复: [PROPOSAL] Add Python API implementation of workflows-as-code
&gt;
&gt;
&gt; 在开始发送给你的邮件里有取消订阅邮箱链接
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; ------------------ 原始邮件 ------------------
&gt; 
发件人:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
"dev"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <[email protected]&amp;gt;;
&gt; 发送时间:&amp;nbsp;2021年9月30日(星期四) 上午10:36
&gt; 收件人:&amp;nbsp;"dev"<[email protected]&amp;gt;;
&gt;
&gt; 主题:&amp;nbsp;回复:回复: [PROPOSAL] Add Python API implementation of 
workflows-as-code
&gt;
&gt;
&gt;
&gt; 无法取消订阅?
&gt;
&gt;
&gt;
&gt; ---原始邮件---
&gt; 发件人: "zhang junfan"<[email protected]&amp;amp;gt;
&gt; 发送时间: 2021年9月30日(周四) 上午10:35
&gt; 收件人: 
"[email protected]"<[email protected]&amp;amp;gt;;
&gt; 主题: 回复: [PROPOSAL] Add Python API implementation of workflows-as-code
&gt;
&gt;
&gt; Good job, thanks focusing on multi-lang support.
&gt;
&gt; Minor discussion.
&gt;
&gt; &amp;amp;nbsp; 1.&amp;amp;nbsp; Could you please provide some spark/flink 
process examples?
&gt; &amp;amp;nbsp; 2.&amp;amp;nbsp; I'm confused with workflow-as-code, you 
means it just define the DAG and workflow parameters? Could we combine workflow 
and user task code(like spark/flink programs)?
&gt;
&gt; ________________________________
&gt; 发件人: Jiajie Zhong <[email protected]&amp;amp;gt;
&gt; 发送时间: 2021年9月28日 11:42
&gt; 收件人: [email protected] 
<[email protected]&amp;amp;gt;
&gt; 主题: [PROPOSAL] Add Python API implementation of workflows-as-code
&gt;
&gt; Hey guys,
&gt;
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Apache DolphinScheduler is a 
good tool for workflow scheduler, it’s easy-to-extend,
&gt; distributed and have nice UI to create and maintain workflow. Our workflow 
only support
&gt; define in UI, which is easy to use and user friendly, it’s good but could 
be batter by
&gt; adding extend API and make workflow could define as code or yaml file. And 
consider yaml
&gt; file it’s hard to maintain manually I think it better to use code to 
define it, aka workflows-as-code.
&gt;
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; When workflow definitions as 
code, we could easy to modify some configure and do
&gt; some batch change for it. It’s could more easy to define similar task by 
loop statement,
&gt; and it give ability adding unittest for workflow too. I hope Apache 
DolphinScheduler could
&gt; combine the benefit of define by code and by UI, so I raise proposal for 
adding
&gt; workflows-as-code to Apache DolphinScheduler.
&gt;
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Actually, I already start it by 
adding POC PR[1]. In this PR, I adding Python API give
&gt; user define workflow by Python code. This feature use *Py4J* connect Java 
and Python,
&gt; which mean I never add any new database model and infra to Apache 
DolphinScheduler,
&gt; I just reuse layer service in dolphinscheduler-api package to create 
workflow. And we could
&gt; consider Python API just another interface for Apache DolphinScheduler, 
just like our UI, it
&gt; allow we define and maintain workflow follow their rule.
&gt;
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Here it’s an tutorial workflow 
definitions by Python API, which you could find it in PR file[2]
&gt;
&gt; ```python
&gt; from pydolphinscheduler.core.process_definition import ProcessDefinition
&gt; from pydolphinscheduler.tasks.shell import Shell
&gt;
&gt; with ProcessDefinition(name="tutorial") as pd:
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; task_parent = 
Shell(name="task_parent", command="echo hello pydolphinscheduler")
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; task_child_one = 
Shell(name="task_child_one", command="echo 'child one'")
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; task_child_two = 
Shell(name="task_child_two", command="echo 'child two'")
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; task_union = 
Shell(name="task_union", command="echo union")
&gt;
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; task_group = [task_child_one, 
task_child_two]
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; 
task_parent.set_downstream(task_group)
&gt;
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; task_union << task_group
&gt;
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; pd.run()
&gt; ```
&gt;
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; In tutorial, we define a new 
ProcessDefinition named ‘tutorial’ using python context,
&gt; and then we add four Shell tasks to ‘tutorial’, just five line we could 
create one process
&gt; definition with four tasks.
&gt; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Beside process definition and 
tasks, another think we have to
&gt; add to workflow it’s task dependent, we add function `set_downstream` and 
`set_upstream`
&gt; to describe task dependent. At the same time, we overwrite bit operator 
and add a shortcut
&gt; `&amp;amp;gt;&amp;amp;gt;` and&amp;amp;nbsp; `<<` to do it.
&gt; &amp;amp;nbsp;&amp;amp;nbsp; After dependent set, we done our workflow 
definition, but all definition are in Python API
&gt; side, which mean it not persist to Apache DolphinScheduler database, and 
it could not runs
&gt; by Apache DolphinScheduler until declare `pd.submit()` or directly run it 
by `pd.run()`
&gt;
&gt;
&gt; [1]: https://github.com/apache/dolphinscheduler/pull/6269 
<https://github.com/apache/dolphinscheduler/pull/6269&amp;amp;gt;
&gt; [2]: 
https://github.com/apache/dolphinscheduler/pull/6269/files#diff-5561fec6b57cc611bee2b0d8f030965d76bdd202801d9f8a1e2e74c21769bc41
 
<https://github.com/apache/dolphinscheduler/pull/6269/files#diff-5561fec6b57cc611bee2b0d8f030965d76bdd202801d9f8a1e2e74c21769bc41&amp;amp;gt;
&gt;
&gt;
&gt; Best Wish
&gt; — Jiajie

Reply via email to