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/06/01 09:28:32 UTC

[dolphinscheduler] branch dev updated: [doc] Add how to use resource in shell task (#10308)

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

zhongjiajie pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 6828c9e015 [doc] Add how to use resource in shell task (#10308)
6828c9e015 is described below

commit 6828c9e015d02b792c14aabf0a99394a158e9a87
Author: QuakeWang <45...@users.noreply.github.com>
AuthorDate: Wed Jun 1 17:28:27 2022 +0800

    [doc] Add how to use resource in shell task (#10308)
---
 docs/docs/en/guide/task/shell.md |  5 ++++-
 docs/docs/zh/guide/task/shell.md | 17 +++++++++--------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/docs/docs/en/guide/task/shell.md b/docs/docs/en/guide/task/shell.md
index 5f6a6411f5..5a2d09cd44 100644
--- a/docs/docs/en/guide/task/shell.md
+++ b/docs/docs/en/guide/task/shell.md
@@ -43,6 +43,9 @@ After running this example, we would see "param_val" print in the log.
 ![demo-shell-custom-param](/img/tasks/demo/shell_custom_param.jpg)
 
 ## Attention
+
 The shell task type resolves whether the task log contains ```application_xxx_xxx``` to determine whether is the yarn task. If so, the corresponding application
 will be use to judge the running state of the current shell node. At this time, if stops the operation of the workflow, the corresponding ```application_id```
-will be killed.
\ No newline at end of file
+will be killed.
+
+If you want to use resource files in Shell tasks, you can upload corresponding files through the resource center and then use the resources in the Shell task. Reference: [file-manage](../resource/file-manage.md).
diff --git a/docs/docs/zh/guide/task/shell.md b/docs/docs/zh/guide/task/shell.md
index a656c098e7..239c00aecf 100644
--- a/docs/docs/zh/guide/task/shell.md
+++ b/docs/docs/zh/guide/task/shell.md
@@ -2,12 +2,11 @@
 
 ## 综述
 
-Shell 任务类型,用于创建 Shell 类型的任务并执行一系列的 Shell 脚本。worker 执行该任务的时候,会生成一个临时shell脚本,
-并使用与租户同名的 linux 用户执行这个脚本。
+Shell 任务类型,用于创建 Shell 类型的任务并执行一系列的 Shell 脚本。worker 执行该任务的时候,会生成一个临时 shell 脚本,并使用与租户同名的 linux 用户执行这个脚本。
 
 ## 创建任务
 
-- 点击项目管理-项目名称-工作流定义,点击"创建工作流"按钮,进入DAG编辑页面。
+- 点击项目管理-项目名称-工作流定义,点击"创建工作流"按钮,进入 DAG 编辑页面。
 - 工具栏中拖动 <img src="/img/tasks/icons/shell.png" width="15"/> 到画板中,即可完成创建。
 
 ## 任务参数
@@ -15,15 +14,15 @@ Shell 任务类型,用于创建 Shell 类型的任务并执行一系列的 She
 - 任务名称:设置任务的名称。一个工作流定义中的节点名称是唯一的。
 - 运行标志:标识这个节点是否能正常调度,如果不需要执行,可以打开禁止执行开关。
 - 描述:描述该节点的功能。
-- 任务优先级:worker线程数不足时,根据优先级从高到低依次执行,优先级一样时根据先进先出原则执行。
-- Worker分组:任务分配给worker组的机器机执行,选择Default,会随机选择一台worker机执行。
+- 任务优先级:worker 线程数不足时,根据优先级从高到低依次执行,优先级一样时根据先进先出原则执行。
+- Worker 分组:任务分配给 worker 组的机器机执行,选择 Default,会随机选择一台 worker 机执行。
 - 环境名称:配置运行脚本的环境。
 - 失败重试次数:任务失败重新提交的次数,支持下拉和手填。
 - 失败重试间隔:任务失败重新提交任务的时间间隔,支持下拉和手填。
 - 超时告警:勾选超时告警、超时失败,当任务超过"超时时长"后,会发送告警邮件并且任务执行失败.
-- 脚本:用户开发的SHELL程序。
+- 脚本:用户开发的 SHELL 程序。
 - 资源:是指脚本中需要调用的资源文件列表,资源中心-文件管理上传或创建的文件。
-- 自定义参数:是SHELL局部的用户自定义参数,会替换脚本中以${变量}的内容。
+- 自定义参数:是 SHELL 局部的用户自定义参数,会替换脚本中以 `${变量}` 的内容。
 - 前置任务:选择当前任务的前置任务,会将被选择的前置任务设置为当前任务的上游。
 
 ## 任务样例
@@ -45,4 +44,6 @@ Shell 任务类型,用于创建 Shell 类型的任务并执行一系列的 She
 
 ## 注意事项
 
-Shell 任务类型通过解析任务日志是否包含 ```application_xxx_xxx``` 的内容来判断是否 Yarn 任务,如果是则会将相应的 ```application_id``` 的状态作为当前 Shell 节点的运行状态判断,此时如果操作停止工作流则会 Kill 相应的 ```application_id```
\ No newline at end of file
+Shell 任务类型通过解析任务日志是否包含 ```application_xxx_xxx``` 的内容来判断是否 Yarn 任务,如果是则会将相应的 ```application_id``` 的状态作为当前 Shell 节点的运行状态判断,此时如果操作停止工作流则会 Kill 相应的 ```application_id```
+
+如果 Shell 任务中需要使用到用户自定义的脚本,可通过资源中心来上传对应的文件然后在 Shell 任务中引用他们,可参考:[文件管理](../resource/file-manage.md)。