Browse Source

[doc] Add how to use resource in shell task (#10308)

3.1.0-release
QuakeWang 2 years ago committed by GitHub
parent
commit
6828c9e015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      docs/docs/en/guide/task/shell.md
  2. 7
      docs/docs/zh/guide/task/shell.md

3
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.
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).

7
docs/docs/zh/guide/task/shell.md

@ -2,8 +2,7 @@
## 综述
Shell 任务类型,用于创建 Shell 类型的任务并执行一系列的 Shell 脚本。worker 执行该任务的时候,会生成一个临时shell脚本,
并使用与租户同名的 linux 用户执行这个脚本。
Shell 任务类型,用于创建 Shell 类型的任务并执行一系列的 Shell 脚本。worker 执行该任务的时候,会生成一个临时 shell 脚本,并使用与租户同名的 linux 用户执行这个脚本。
## 创建任务
@ -23,7 +22,7 @@ Shell 任务类型,用于创建 Shell 类型的任务并执行一系列的 She
- 超时告警:勾选超时告警、超时失败,当任务超过"超时时长"后,会发送告警邮件并且任务执行失败.
- 脚本:用户开发的 SHELL 程序。
- 资源:是指脚本中需要调用的资源文件列表,资源中心-文件管理上传或创建的文件。
- 自定义参数:是SHELL局部的用户自定义参数,会替换脚本中以${变量}的内容。
- 自定义参数:是 SHELL 局部的用户自定义参数,会替换脚本中以 `${变量}` 的内容。
- 前置任务:选择当前任务的前置任务,会将被选择的前置任务设置为当前任务的上游。
## 任务样例
@ -46,3 +45,5 @@ Shell 任务类型,用于创建 Shell 类型的任务并执行一系列的 She
## 注意事项
Shell 任务类型通过解析任务日志是否包含 ```application_xxx_xxx``` 的内容来判断是否 Yarn 任务,如果是则会将相应的 ```application_id``` 的状态作为当前 Shell 节点的运行状态判断,此时如果操作停止工作流则会 Kill 相应的 ```application_id```
如果 Shell 任务中需要使用到用户自定义的脚本,可通过资源中心来上传对应的文件然后在 Shell 任务中引用他们,可参考:[文件管理](../resource/file-manage.md)。

Loading…
Cancel
Save