You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by zh...@apache.org on 2022/04/02 01:53:25 UTC

[dolphinscheduler-website] branch history-docs updated: cherry pick latest change from master

This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch history-docs
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler-website.git


The following commit(s) were added to refs/heads/history-docs by this push:
     new 8427776  cherry pick latest change from master
8427776 is described below

commit 8427776a50a671be8923447361f394eaeb165ed3
Author: Jiajie Zhong <zh...@hotmail.com>
AuthorDate: Sat Apr 2 09:49:08 2022 +0800

    cherry pick latest change from master
---
 docs/2.0.5/docs/en/guide/task/python.md        |  62 ++++++++++++++++++++-----
 docs/2.0.5/docs/zh/guide/task/python.md        |  62 ++++++++++++++++++++-----
 img/tasks/demo/python.jpg                      | Bin 0 -> 235373 bytes
 img/tasks/demo/python_custom_param.jpg         | Bin 0 -> 230867 bytes
 img/tasks/demo/python_custom_param_ui_next.jpg | Bin 0 -> 396899 bytes
 img/tasks/demo/python_ui_next.jpg              | Bin 0 -> 450888 bytes
 img/tasks/icons/python.png                     | Bin 0 -> 34066 bytes
 7 files changed, 102 insertions(+), 22 deletions(-)

diff --git a/docs/2.0.5/docs/en/guide/task/python.md b/docs/2.0.5/docs/en/guide/task/python.md
index d70ef5c..6edb29d 100644
--- a/docs/2.0.5/docs/en/guide/task/python.md
+++ b/docs/2.0.5/docs/en/guide/task/python.md
@@ -1,15 +1,55 @@
-# Python
+# Python Node
 
-- Using python nodes, you can directly execute python scripts. For python nodes, workers will use `python **` to submit tasks.
+## Overview
 
-> Drag in the toolbar![PNG](https://analysys.github.io/easyscheduler_docs_cn/images/toolbar_PYTHON.png)The task node to the drawing board, as shown in the following figure:
+Use `Python Task` to create a python-type task and execute python scripts. When the worker executes `Python Task`,
+it will generate a temporary python script, and executes the script by the Linux user with the same name as the tenant.
 
-<p align="center">
-   <img src="/img/python-en.png" width="80%" />
- </p>
+## Create Task
 
-- Script: Python program developed by the user
-- Environment Name: Specific which Python interpreter would be use and run `Script`. If you want to use Python virtualenv, you should create multiply environments for each virtualenv.
-- Resources: refers to the list of resource files that need to be called in the script
-- User-defined parameter: It is a local user-defined parameter of Python, which will replace the content with \${variable} in the script
-- Note: If you import the python file under the resource directory tree, you need to add the `__init__.py` file
+- Click Project Management-Project Name-Workflow Definition, and click the "Create Workflow" button to enter the DAG editing page.
+- Drag <img src="/img/tasks/icons/python.png" width="15"/> from the toolbar to the canvas.
+
+## Task 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.
+- Descriptive information: Describe the function of the node.
+- Task priority: When the number of worker threads is insufficient, execute in the order of priority from high to low, and tasks with the same priority will execute in a first-in first-out order.
+- Worker grouping: Assign tasks to the machines of the worker group to execute. If `Default` is selected, randomly select a worker machine for execution.
+- Environment Name: Configure the environment name in which to run the script.
+- Number of failed retry attempts: The failure task resubmitting times. It supports drop-down and hand-filling.
+- Failed retry interval: The time interval for resubmitting the task after a failed task. It supports drop-down and hand-filling.
+- Timeout alarm: Check the timeout alarm and timeout failure. When the task exceeds the "timeout period", an alarm email will send and the task execution will fail.
+- Script: Python program developed by the user.
+- Resource: Refers to the list of resource files that need to be called in the script, and the files uploaded or created by the resource center-file management.
+- Custom parameters: It is the user-defined parameters of Python, which will replace the content with \${variable} in the script.
+
+## Task Example
+
+### Simply Print
+
+This example simulates a common task that runs by a simple command. The example is to print one line in the log file, as shown in the following figure:
+"This is a demo of python task".
+
+![demo-python-simple](/img/tasks/demo/python.jpg)
+
+```python
+print("This is a demo of python task")
+```
+
+### Custom Parameters
+
+This example simulates a custom parameter task. We use parameters for reusing existing tasks as template or coping with the dynamic task. In this case,
+we declare a custom parameter named "param_key", with the value "param_val". Then we use echo to print the parameter "${param_key}" we just declared.
+After running this example, we would see "param_val" print in the log.
+
+![demo-python-custom-param](/img/tasks/demo/python_custom_param.jpg)
+
+```python
+print("${param_key}")
+```
+
+## Notice
+
+None
diff --git a/docs/2.0.5/docs/zh/guide/task/python.md b/docs/2.0.5/docs/zh/guide/task/python.md
index ec01f2f..31ea986 100644
--- a/docs/2.0.5/docs/zh/guide/task/python.md
+++ b/docs/2.0.5/docs/zh/guide/task/python.md
@@ -1,15 +1,55 @@
-# Python节点
+# Python Node
 
-- 使用python节点,可以直接执行python脚本,对于python节点,worker会使用`python **`方式提交任务。
+## Overview
 
-> 拖动工具栏中的![PNG](https://analysys.github.io/easyscheduler_docs_cn/images/toolbar_PYTHON.png)任务节点到画板中,如下图所示:
+Use `Python Task` to create a python-type task and execute python scripts. When the worker executes `Python Task`,
+it will generate a temporary python script, and executes the script by the Linux user with the same name as the tenant.
 
-<p align="center">
-   <img src="/img/python_edit.png" width="80%" />
- </p>
+## Create Task
 
-- 脚本:用户开发的Python程序
-- 环境名称:执行Python程序的解释器路径,指定运行脚本的解释器。当你需要使用 Python **虚拟环境** 时,可以通过创建不同的环境名称来实现。
-- 资源:是指脚本中需要调用的资源文件列表
-- 自定义参数:是Python局部的用户自定义参数,会替换脚本中以${变量}的内容
-- 注意:若引入资源目录树下的python文件,需添加 `__init__.py` 文件
+- Click Project Management-Project Name-Workflow Definition, and click the "Create Workflow" button to enter the DAG editing page.
+- Drag <img src="/img/tasks/icons/python.png" width="15"/> from the toolbar to the canvas.
+
+## Task 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.
+- Descriptive information: Describe the function of the node.
+- Task priority: When the number of worker threads is insufficient, execute in the order of priority from high to low, and tasks with the same priority will execute in a first-in first-out order.
+- Worker grouping: Assign tasks to the machines of the worker group to execute. If `Default` is selected, randomly select a worker machine for execution.
+- Environment Name: Configure the environment name in which to run the script.
+- Number of failed retry attempts: The failure task resubmitting times. It supports drop-down and hand-filling.
+- Failed retry interval: The time interval for resubmitting the task after a failed task. It supports drop-down and hand-filling.
+- Timeout alarm: Check the timeout alarm and timeout failure. When the task exceeds the "timeout period", an alarm email will send and the task execution will fail.
+- Script: Python program developed by the user.
+- Resource: Refers to the list of resource files that need to be called in the script, and the files uploaded or created by the resource center-file management.
+- Custom parameters: It is the user-defined parameters of Python, which will replace the content with \${variable} in the script.
+
+## Task Example
+
+### Simply Print
+
+This example simulates a common task that runs by a simple command. The example is to print one line in the log file, as shown in the following figure:
+"This is a demo of python task".
+
+![demo-python-simple](/img/tasks/demo/python_ui_next.jpg)
+
+```python
+print("This is a demo of python task")
+```
+
+### Custom Parameters
+
+This example simulates a custom parameter task. We use parameters for reusing existing tasks as template or coping with the dynamic task. In this case,
+we declare a custom parameter named "param_key", with the value "param_val". Then we use echo to print the parameter "${param_key}" we just declared.
+After running this example, we would see "param_val" print in the log.
+
+![demo-python-custom-param](/img/tasks/demo/python_custom_param_ui_next.jpg)
+
+```python
+print("${param_key}")
+```
+
+## Notice
+
+None
diff --git a/img/tasks/demo/python.jpg b/img/tasks/demo/python.jpg
new file mode 100644
index 0000000..3de8651
Binary files /dev/null and b/img/tasks/demo/python.jpg differ
diff --git a/img/tasks/demo/python_custom_param.jpg b/img/tasks/demo/python_custom_param.jpg
new file mode 100644
index 0000000..399ee03
Binary files /dev/null and b/img/tasks/demo/python_custom_param.jpg differ
diff --git a/img/tasks/demo/python_custom_param_ui_next.jpg b/img/tasks/demo/python_custom_param_ui_next.jpg
new file mode 100644
index 0000000..de041f0
Binary files /dev/null and b/img/tasks/demo/python_custom_param_ui_next.jpg differ
diff --git a/img/tasks/demo/python_ui_next.jpg b/img/tasks/demo/python_ui_next.jpg
new file mode 100644
index 0000000..bff7135
Binary files /dev/null and b/img/tasks/demo/python_ui_next.jpg differ
diff --git a/img/tasks/icons/python.png b/img/tasks/icons/python.png
new file mode 100644
index 0000000..9775b28
Binary files /dev/null and b/img/tasks/icons/python.png differ