You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/06/14 11:58:23 UTC

[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #10397: [Feature]Blocking task UI and Doc

zhongjiajie commented on code in PR #10397:
URL: https://github.com/apache/dolphinscheduler/pull/10397#discussion_r896719792


##########
docs/docs/zh/guide/task/blocking.md:
##########
@@ -0,0 +1,57 @@
+# Blocking节点
+
+blocking节点是阻断节点,它回根据其前置任务的运行状态,并结合用户在添加节点时配置的阻断逻辑,决定是否在合适的时机暂停整个工作流的运行。同时,用户可以配置在工作流被阻断时向相关用户发出告警。当用户介入后,可以决定是否要继续执行工作流。
+
+## 创建任务
+
+- 点击项目管理-项目名称-工作流定义,点击“创建工作流”按钮,进入DAG编辑界面;
+- 拖动工具栏中<img src="../../../../img/blocking.png" width="20"/>任务节点到画板中。
+
+## 任务参数
+
+- 节点名称:一个工作流定义中的节点名称是唯一的。
+- 运行标志:标识这个节点是否能正常调度,如果不需要执行,可以打开禁止执行开关。
+- 描述:描述该节点的功能。
+- 任务优先级:worker线程数不足时,根据优先级从高到低依次执行,优先级一样时根据先进先出原则执行。
+- worker分组:任务分配给worker组的机器执行,选择default,会随机选择一台worker机执行。
+- 失败重试次数:任务失败重新提交的次数。
+- 失败重试间隔:任务失败重新提交任务的时间间隔。
+- 超时告警:勾选超时告警、超时失败,当任务超过“超时时长”后,会发送告警邮件并且任务执行失败。
+- 阻断条件:有以下两个选项,它们定义了将工作流阻断的时机。
+  - 用户自定义条件失败时阻断:即自定义参数的逻辑判断结果为**假**时阻断工作流。
+  - 用户自定义条件成功时阻断:即自定义参数的逻辑判断结果为**真**时阻断工作流。
+- 阻断时告警:当工作流被阻断时,是否要向用户发送告警。
+- 添加前置检查条件:即**自定义参数**。它可为blocking节点选择一个或多个上游任务,构建阻断逻辑。
+  - 增加上游依赖:通过选择第一个参数,选择对应的任务名称;通过第二个参数,选择该任务的期望状态。
+  - 上游任务关系选择:当有多个上游任务时,可以通过`且`以及`或`操作符实现任务间执行结果的复杂关系逻辑关系判断。
+
+## 任务样例
+
+该样例通过[Shell](shell.md)任务和[Python](python.md)任务来演示blocking节点的操作流程
+
+### 1、创建工作流
+
+进入工作流定义页面,然后分别创建如下任务节点
+
+- Shell-01:Shell任务,输出`hello word`,用于blocking节点的上游任务
+- Py-01:Python任务,内容为`print('Hello Word'`,注意,这里的语法错误是故意的。用于blocking节点的上游任务
+- Blocking-01:blocking节点,设置阻断逻辑为:Shell-01成功**且**Py-01成功;阻断逻辑为**真**时阻断;阻断时告警
+- Shell-02:Shell任务,输出`Process end`
+
+![blocking-task01](../../../../img/tasks/demo/blocking_task01.png)
+
+![blocking-task02](../../../../img/tasks/demo/blocking_task02.png)
+
+## 2、查看执行结果
+
+当完成工作流创建之后,可以运行该工作流,会发现工作流最终会处在阻断状态
+
+![blocking-task03](../../../../img/tasks/demo/blocking_task04.png)
+
+![blocking-task03](../../../../img/tasks/demo/blocking_task03.png)
+
+这时,你可以选择:**重跑**或者**继续执行**工作流
+
+如果你有配置告警相关组件(例如email),那么将会收到一封告警邮件
+
+## 

Review Comment:
   It seems that is unnecessary adding



##########
docs/docs/en/guide/task/blocking.md:
##########
@@ -0,0 +1,55 @@
+# Blocking
+
+Blocking is a node that decides whether or not to suspend the whole running workflow, i.e. blocking. It based on the running status of its predecessor and the parameters configured by the user when adding the node. Users can also set whether to alert when a workflow is blocked. After user intervention, they will decide to continue or re-run the workflow.
+
+## Create Task
+
+- Click `Project -> Management-Project -> Name-Workflow Definition`, and click the "Create Workflow" button to enter the DAG editing page.
+- Drag from the toolbar <img src="../../../../img/blocking.png" width="20"/> task node to canvas.
+
+## Parameter
+
+- Node name:The node name in a workflow definition is unique.
+- Run flag:Identifies whether this node can be scheduled normally, if it does not need to be executed, you can turn on the prohibition switch.
+- Description:describe the function of the node.
+- Task priority:When the number of worker threads is insufficient, they are executed in order from high to low, and when the priority is the same, they are executed according to the first-in first-out principle.
+- Worker grouping:Tasks are assigned to the machines of the worker group to execute. If Default is selected, a worker machine will be randomly selected for execution.
+- Number of failed retry attempts:The number of times the task failed to be resubmitted.
+- Failed retry interval:The time interval for resubmitting the task after a failed task.
+- Timeout alarm:Check the timeout alarm and timeout failure. When the task exceeds the "timeout period", an alarm email will be sent and the task execution will fail.
+- Blocking condition:There are two options, which define the opportunity of blocking the workflow:
+    - Blocking on custom param failed:That is, the workflow is blocked when the result of the custom parameter is **false**.
+    - Blocking on custom param success:That is, the workflow is blocked when the result of the custom parameter is **success**.
+- Alert on blocking:Whether to send alerts to relevant users when a workflow is blocked.
+- Add pre task check condition:i.e. **custom parameter**. One or more upstream tasks can be selected for blocking node to build workflow blocking logic.
+    - Add the upstream dependency:Use the first parameter to choose task name, and the second parameter for status of the upsteam task.
+    - Upstream task relationship:we use `and` and `or`operators to handle complex relationship of upstream when multiple upstream tasks for Conditions task.
+
+## Example
+
+This sample demonstrates the operation of the Condition task by using the [Shell](shell.md) task and [Python](python.md) task.
+
+### 1. Create Workflow

Review Comment:
   should avoid using number in title, the leading number of `#` represent the level
   ```suggestion
   ### Create Workflow
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org