dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[QUESTION] A scheduling problem 前置依赖调度问题(能否实现前置任务完成后就触发调用相关任务)

Open xiaot502 opened this issue 7 years ago • 8 comments

dolphin scheduler 1.1.0 version 我需要a任务执行完了,就自动执行b任务(b任务不需要配置时间调度器,只需要满足了前置条件就可会执行)。b任务对a任务配置了前置依赖。在海豚里面怎么实现这个配置或者有没有这个功能? +++++++++++++++++++++++++++++++++ I need task a to execute and then automatically execute task b (task b does not need to configure the time scheduler, but only needs to meet the preconditions to execute).Task b is configured with pre-dependencies on task a.How does this configuration work in dolphins or does it work?

xiaot502 avatar Nov 13 '19 09:11 xiaot502

What you are asking should be that the B workflow does not have time scheduler, and does the A workflow have time scheduler?You can import the B workflow in A's workflow so that the task flow in the A workflow is completed and the B workflow is executed. ++++++++++++++++++++++++++++++++++ 你问的应该是B工作流没有设置时间调度,A工作流有时间调度么?你可以在A的工作流里面,把B工作流引入的,这样A工作流中的任务节点完成后,就会执行B工作流

lfyee avatar Nov 13 '19 11:11 lfyee

根据当前我对这个调度组件的分工理解整理如下: 定时器才是调度被启动的唯一入口,然后工作流调用子工作流实现执行顺序,那么依赖组件具体又是什么功能?这个组件实现的是整个工作流中某一个小组件在被执行的前一步来判断其他工作流的某个或者多个组件是否被执行完成?满足条件就会根据连接线顺序执行组件的功能,如果不满足呢我推测有两种可能(1:中断整个工作流,记录日志2:工作流陷入休眠直到前置条件被满足,又重新从休眠状态继续执行)。不知道老师能否解答依赖组件的实际工作机制呢?

=================================================

According to my current understanding of the division of labor of this scheduling component, it is arranged as follows:

The timer is the only entry into which the schedule is started, and the workflow invokes the execution sequence of the sub-workflow implementation.This component implements a component in the entire workflow before it is executed to determine whether one or more components of other workflows have been executed.If the condition is met, the function of the component will be executed in sequence according to the connection line. If not, I guess there are two possibilities (1: interrupt the entire workflow, log 2: the workflow will go to sleep until the preconditions are met and resume execution from sleep).Can the teacher explain how the dependent components actually work?

------------------ 原始邮件 ------------------ 发件人: "老佛爷"<[email protected]>; 发送时间: 2019年11月13日(星期三) 晚上7:17 收件人: "apache/incubator-dolphinscheduler"<[email protected]>; 抄送: "涛"<[email protected]>;"Author"<[email protected]>; 主题: Re: [apache/incubator-dolphinscheduler] [QUESTION] A scheduling problem 前置依赖调度问题(能否实现前置任务完成后就触发调用相关任务) (#1223)

What you are asking should be that the B workflow does not have time scheduler, and does the A workflow have time scheduler?You can import the B workflow in A's workflow so that the task flow in the A workflow is completed and the B workflow is executed. ++++++++++++++++++++++++++++++++++ 你问的应该是B工作流没有设置时间调度,A工作流有时间调度么?你可以在A的工作流里面,把B工作流引入的,这样A工作流中的任务节点完成后,就会执行B工作流

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

xiaot502 avatar Nov 14 '19 06:11 xiaot502

Interrupt workflow: Set a stop flag for the task flow. It does not interrupt tasks that are already running. After the running task is completed, when the task flow has a stop flag, it will not continue to run. Prerequisite: The prerequisite is the end state of the predecessor. If successful, the current task can continue to execute. If you have multiple tasks ahead, you can execute them after waiting for multiple tasks to execute successfully. The triggering of the workflow depends on the timer. The task set constitutes a workflow, and the task type can be Shell, Spark or other workflow. The task set is a DAG diagram. If the task fails, it will check its retry and retry interval, and if the task fails after retry, the entire workflow will be interrupted. ++++++++++++++++++++++++++++++++++ 中断工作流:尝试停止任务流,可以理解为给任务流设置停止标记,不会去中断已经在运行的任务,已经运行的任务运行完后,如果工作流存在停止标记,则不会往下继续运行。 前置条件:前置条件,均为前置任务的结束状态,如果是成功,则当前任务可以继续执行,如果前面有多个任务,则为等待多个任务都执行成功后,才能执行。 工作流的触发依赖定时器。任务集合组成工作流,任务类型可以是shell、spark、其他工作流。任务集合是一个DAG图,如果一个任务执行失败后,会检查其重试次数和重试间隔,如果重试后任务还是失败,此时,会中断整个工作流。

lfyee avatar Nov 14 '19 10:11 lfyee

您要问的是B工作流程没有时间表,而A工作流程没有时间表吗?您可以将B工作流程导入A的工作流程中,以便完成A工作流程中的任务流程,并且B工作流程为被执行。 ++++++++++++++++++++++++++++++++++++ 你问的应该是B工作流没有设置时间调度,A工作流有时间调度么?你可以在A的工作流里面,把B工作流约会的,这样A工作流中的任务例程完成后,就会执行B工作流

不是你说的这样,例如建数据仓库,分为ods、dw、dm三层,每一层都是一个项目,我在一个账户下分别建立这三个项目,每一层都由一批同事在做,我需要ods层拿到今天的数据然后触发dw层的清洗再触发dm层的计算,每一层都是环环相扣的,需要依赖的,而且是跨项目依赖,而不是你说的那样,扭成一锅粥,非要建到一个工作流下,odsTask---->dwTast----->dmTask,这种做法不就乱套了么,ods的同事写完工作流,dw的同事再后面补上一层,dm的同事再补上一层?

Not you say so, for example to build data warehouse, divided into ods, dw, dm three layers, each layer is a project, I am under an account established respectively the three projects, each layer by a group of colleagues in do, I need to get today's ods layer data and then trigger the calculation of dw cleaning to trigger the dm layer, each layer is linked together, need to rely on, and it is cross project dependencies, rather than you say, a mess, have to build to a working flow, odsTask -- -- -- -- > dwTast -- -- -- -- -- > dmTask, this action is not just muddle up?Ods colleagues finish the workflow, dw colleagues add another layer, dm colleagues add another layer?

wangsvip avatar Nov 21 '19 08:11 wangsvip

依赖任务可能满足您的需求 依赖任务,可以选择其他的工作流,两种工作流程都有各自独立的调度时间,当前工作流程在指定时间触发执行,依赖任务会配置检测另一个工作流的状态,当依赖工作流执行成功,当前任务流才可以继续执行,依赖任务可以配置检测重试检查机制。 ++++++++++++++++++++++++++++++++++++ Dependent tasks may meet your needs Depending on the task, you can choose another workflow. Both workflows have their own scheduling time. The current workflow triggers execution at the specified time. The rules configured in the dependent task will detect the status of another workflow. If the workflow is executed successfully, the current task flow can continue to execute. Dependent tasks can be configured to detect the retry checking mechanism.

lfyee avatar Nov 25 '19 03:11 lfyee

我觉得 这位同学wangsvip 想要的功能是 1)配置依赖的时候不用进入工作流里面去配置,可以单独配置A任务依赖B任务(甚至可以配置上依赖的条件),只要B执行完以后就会自动去触发A任务的执行 2)其实这个问题很早就讨论过,DS目前只支持依赖任务,也就是需要自己去启动多一个定时任务去检测所依赖的任务是否执行完成,根据状态再执行后续操作 3)针对这种基于条件触发(任务完成或者)的需求可以参考azkaban的做法,通过引入消息队列,将任务的执行结果发送到消息队列,定义一个消息处理模块,定时消费数据,如果发现A任务所依赖的任务B已经完成,那么就自动触发A任务,如果失败则告警

zixi0825 avatar Nov 26 '19 09:11 zixi0825

我觉得 这位同学wangsvip 想要的功能是 1)配置依赖的时候不用进入工作流里面去配置,可以单独配置A任务依赖B任务(甚至可以配置上依赖的条件),只要B执行完以后就会自动去触发A任务的执行 2)其实这个问题很早就讨论过,DS目前只支持依赖任务,也就是需要自己去启动多一个定时任务去检测所依赖的任务是否执行完成,根据状态再执行后续操作 3)针对这种基于条件触发(任务完成或者)的需求可以参考azkaban的做法,通过引入消息队列,将任务的执行结果发送到消息队列,定义一个消息处理模块,定时消费数据,如果发现A任务所依赖的任务B已经完成,那么就自动触发A任务,如果失败则告警

其实我不单单要依赖的问题,我还需要跨项目依赖的功能,详细需求在这个问题下https://github.com/apache/incubator-dolphinscheduler/issues/1307

wangsvip avatar Nov 26 '19 09:11 wangsvip

可以考慮用呼叫API的方式去觸發另一個獨立的工作流

tonycnlin avatar Jul 28 '21 07:07 tonycnlin