创建execution
create_execution(workflow_source_file="", workflow_inputs_file="", workflow_options_file="", workflow_dependencies_path="", parameters={})
功能描述
提交一个cromwell分析任务。
输入参数
参数 | 是否必选 | 参数类型 | 参数描述 |
|---|---|---|---|
workflow_source_file | 否 | String | WDL的本地绝对路径。当parameters参数中存在"workflow_id"或"workflow_source"字段指定非本地wdl来源时,该参数可不赋值。 |
workflow_inputs_file | 否 | String | 输入文件的本地绝对路径。当parameters参数中存在"workflow_inputs"字段指定非本地input来源时,该参数可不赋值。 |
workflow_options_file | 否 | String | options文件本地绝对路径。当parameters参数中存在"workflow_options"字段指定非本地options来源时,该参数可不赋值。 |
workflow_dependencies_path | 否 | String | dependency本地绝对路径,必须是zip文件或目录。若为目录,将自动压缩为zip文件置于/home目录下。当parameters参数中存在"workflow_depends"字段指定非本地dependency来源时,该参数可不赋值。 |
parameters | 是 | Dictionary | 提交需要用到的其他参数,当前支持以下参数:
|
返回值
参数 | 参数类型 | 参数描述 |
|---|---|---|
id | String | 执行ID。 |
status | String | 当前execution的状态。 |
message | String | 具体提示信息。 |
示例
// 使用本地文件提交任务
wf_source = "/home/test/test.wdl"
wf_inputs = "/home/test/test.inputs"
wf_options = "/home/test/test.options"
wf_dependencies = "/home/test/dependency/" # dependency目录,将自动生成压缩包提交,也可以赋值为已压缩好的dependency文件路径
param = {
"env_name": "cromwell_env",
}
cromwell_client.create_execution(workflow_source_file=wf_source, workflow_inputs_file=wf_inputs, workflow_options_file=wf_options, workflow_dependencies_path=wf_dependencies, parameters=param)
// 使用OBS对象提交任务
param = {
"env_name": "cromwell_env",
"workflow_source": "obs://bucketName/path",
"workflow_inputs": "https://bucketName.obs.cn-north-4.myhuaweicloud.com:443/path/object",
"workflow_options": "https://bucketName.obs.cn-north-1.myhuaweicloud.com:443/path/object",
"workflow_depends": "https://bucketName.obs.cn-north-1.myhuaweicloud.com:443/path/object"
}
cromwell_client.create_execution(parameters=param)
// 使用workflow_id方式提交任务
param = {
"env_name": "cromwell_env",
"workflow_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # WDL流程在GCS中的ID
"workflow_inputs": "https://bucketName.obs.cn-north-4.myhuaweicloud.com:443/path/object",
"workflow_options": "https://bucketName.obs.cn-north-1.myhuaweicloud.com:443/path/object",
"workflow_depends": "https://bucketName.obs.cn-north-1.myhuaweicloud.com:443/path/object"
}
cromwell_client.create_execution(parameters=param) 
