2.2. 命令行工具#
命令行工具是可以单独运行或作为工作流步骤运行的一类流程 (process) 对象。它是诸如 ls
、echo
、tar
等命令的包装器,由相应的 CWL 文件中 baseCommand
这一属性定义。
CWL 命令行工具还必具有 inputs
(输入)和 outputs
(输出)。以下是一个 CWL 命令行工具的极简示例,用 Linux 下的 echo
命令演示输入和输出。
CWL 命令行工具。#
echo.cwl
#cwlVersion: v1.2
class: CommandLineTool
baseCommand: echo
stdout: output.txt
inputs:
message:
type: string
inputBinding: {}
outputs:
out:
type: string
outputBinding:
glob: output.txt
loadContents: true
outputEval: $(self[0].contents)
2.2.1. 网络访问 (Network Access)#
This indicates whether a process requires outgoing IPv4/IPv6 network access. Starting with CWL v1.1, programs are not granted network access by default, so you must include the requirement for network access in the specification of your tool.
cwlVersion: v1.2
class: CommandLineTool
requirements:
NetworkAccess:
networkAccess: true
备注
CWL v1.0 command-line tools that are upgraded to v1.1
or v1.2 or v1.2 will have networkAccess: true
set automatically.