华为云用户手册

  • 参数说明 表1 参数说明 参数名称 是否必选 描述 FILENAME 是 YAML 格式的模板文件,语法详见流程语法参考。 --name 否 对此job指定名称。 --input 否 如果不希望使用 workflow YAML 文件默认的 inputs值,可以在此指定一个 json 文件覆盖掉inputs输入。例如使用新样本时,可以在 json 文件中,定义新的样本名称。json文件示例:{"name":"gcsdemo","age":1},其中"name"、"age"对应模板里的inputs参数名称。 --timeout 否 execution超时时间单位分钟,默认一天,1440分钟。
  • 参数说明 表1 参数说明 参数名称 是否必选 简写 描述 FILENAME 是 不涉及 执行job的脚本文件路径。 如果是cci环境,请将脚本上传到对应的sfs中,参数值使用sfs中的脚本的绝对路径。 --cpu 否 -c 所需CPU核数,单位为C。此处填写“数字”,数字支持小数,默认值为“1”。 须知: 请确保请求CPU核数,小于容器集群中最大节点剩余核数大小。 --memory 否 -m 所需内存资源大小,单位为G。此处填写“数字+单位”,默认值为“1G”。 数字支持小数。 单位为G或是g。 例如,需要内存大小为4G,则此处可填写为“4G”或是“4g”。 须知: 请确保请求内存量,小于容器集群中最大节点剩余内存大小。 --shell 否 -s job 使用的 Linux 脚本 shell 环境,如 sh / bash /zsh。 默认值为“sh”。 --tool 否 -l job 使用的工具。工具支持公有或者私有容器镜像,为简化使用,基因容器服务工具仓库集成了常见镜像,您可以直接使用。 默认值为“bwa:0.7.12”,即bwa工具0.7.12版本。 --name 否 -n 对此 job 指定名称。 --timeout 否 -t execution超时时间单位分钟,默认一天(1440分钟)。 --obs-path 否 -o 支持多盘挂载,通过逗号分隔。 --obs-path mountPath1:pvcName1,mountPath2:pvcName2 mountPath 是容器内的挂载路径。 PvcName 是对应的pvc名称。 --sfs-path 否 -f 支持多盘挂载。 --sfs-path mountPath1:pvcName1,mountPath2:pvcName2 mountPath 是容器内的挂载路径。 PvcName 是对应的pvc名称。 --ref-path 否 -r 支持多盘挂载。 --ref-path mountPath1:pvcName1,mountPath2:pvcName2 mountPath 是容器内的挂载路径。 PvcName 是对应的pvc名称。
  • 使用示例 更新某个流程的描述信息 gcs update workflow 1ec895ca-18b3-162d-82d6-65e2d4955ca6 --description "t est for update"update workflow succeed!update workflow succeed! workflow id : 1ec895ca-18b3-162d-82d6-65e2d4955ca6
  • 修订记录 表1 修订记录 发行时间 说明 2019-12-13 不再支持python2版本,新增以下特性: set_aksk_auth_param/set_user_auth_param:新增project_id参数 get_finished_execution_resource_usage:查询已完成execution各Job监控数据 get_running_execution_resource_usage:查询正在执行的execution各Job监控数据 2019-11-06 新增pip包管理 优化认证入参 优化Token缓存方式 新增cromwell相关接口 2019-10-23 支持Cromwell类型任务接口: CromwellClient():初始化Cromwell客户端 create_execution():投递Cromwell任务 get_execution():获取某个execution的具体信息 get_executions():获取符合某种要求的批量execution具体信息 delete_execution():删除某个execution delete_executions():批量删除指定execution stop_execution():停止某个execution 2019-08-08 删除如下接口: 创建基于CCI的environment:create_cci_environment 创建基于CCE的environment:create_cce_environment 预览execution:preview_execution 修复了一些已知bug 2019-03-28 create_execution接口新增job_retry_count参数。 2019-02-19 新增创建环境接口:create_cci_environment和create_cce_environment。 新增删除已有环境接口:delete_environment。 create_execution新增target参数,兼容支持创建基于CCI和CCE的execution。 create_execution接口支持邮件、短信通知特性。 create_execution接口支持镜像拉取策略特性。 2018-12-28 修改SDK下载地址。 create_workflow接口删除入参version字段。 2018-12-22 支持AK/SK方式认证。 支持Token本地缓存。 支持基于优先级的execution操作。 G CS Client初始化方式修改。
  • 返回值 表1 response body字典树第1层key值 参数 参数类型 描述 job-name Array 流程中各Job的名称,具体内容见表2 表2 response body字典树各Job元素key值 参数 参数类型 描述 metric Dictionary 监控元信息,具体内容见表3 max_value_metric Dictionary 各监控数据点最大值 min_value_metric Dictionary 各监控数据点最小值 average_value_metric Float 各监控数据点平均值 dataPoints Array 当show_datapoints置为True时,该字段展示所有监控数据点详情 表3 监控元信息 参数 参数类型 描述 namespace String 默认值“PAAS.CONTAINER” metricName String 监控指标,当前支持: memUsed:已使用内存量,单位为M cpuCoreLimit:CPU核数申请量,单位为Core cpuUsage:CPU使用量所占百分比 memUsage:内存使用量所占百分比 memCapacity:内存容量,单位为M cpuCoreUsed:已使用CPU核数,单位为Core dimensions Array 监控维度说明,具体内容见表4 表4 监控维度说明 参数 参数类型 描述 name String 监控维度项,默认为以下2项: clusterId,集群ID,默认为“CCI-ClusterID” podID,CCI中Pod ID value String 监控维度值 表5 监控数据结构体 参数 参数类型 描述 timestamps Long 监控数据获取时刻时间戳 unit String 监控数据单位 statistics Array 监控数据详情,具体内容见表6 表6 监控数据详情 参数 参数类型 描述 statistic String 统计学方法,支持 maximum,average,minimum value Float 监控数据值
  • 异常抛出 执行请求失败会抛出异常,异常类型如表1所示,进一步查看实现可以参阅requests包: 表1 异常列表 异常类型 异常说明 requests.RequestException(*args, **kwargs) 该异常未所有异常的基类,但错误异常不明确无法分类到具体的异常时返回此异常。 requests.ConnectionError(*args, **kwargs) 遇到网络问题(如:DNS 查询失败、拒绝连接等)。 requests.HTTPError(*args, **kwargs) HTTP 请求返回了不成功的状态码。 requests.URLRequired(*args, **kwargs) 请求的URL非法。 requests.TooManyRedirects(*args, **kwargs) 请求超过了设定的最大重定向次数。 requests.ConnectTimeout(*args, **kwargs) 连接服务器超时。 requests.ReadTimeout(*args, **kwargs) 连接成功后读取超时。 requests.Timeout(*args, **kwargs) 请求超时,包括ConnetTimeout和ReadTimeout。
  • 返回值 表1 Execution事件结构 参数 参数类型 描述 metadata 表2 简化的元信息结构 元信息。 involvedObject 表2 简化的元信息结构 事件相关主体信息。 reason String 事件描述。 message String 事件详细信息。 firstTimestamp String 事件首次上报时间。 lastTimestamp String 事件末次上报时间。 count int 事件发生次数。 type String 事件类型。 Normal:普通事件 warning:异常事件 elemType String 元素type。 elemId String 元素名称。 actionName String 执行动作名称。 表2 简化的元信息结构 参数 参数类型 描述 name String 名称。 namespace String 命名空间。
  • 输入参数 参数 是否必选 参数类型 参数描述 execution_id 是 String 执行结果ID,可以为创建execution接口的返回值。 action 是 String 操作类型,可以取如下两个值: cancel:停止正在执行的execution。 retry:启动已停止的execution或重试已失败的execution。 priority 否 Int64 该操作的优先级,取值范围[0,999],0表示优先级最低,999表示优先级最高,默认值为0。 timeout 否 Int64 超时时间,单位为分钟,如果不填,则默认是1440分钟。 如果action为retry,则表示execution从当前状态到开始启动(即Running状态)的超时时间,若超过该时间,仍然没有成功启动/重试任务,则GCS不再尝试启动/重试任务。 如果action为cancel,则表示execution从当前状态到已停止(即Cancelled状态)的超时时间,若超过该时间,仍然没有停止成功,则GCS不再尝试停止任务。 inputs_json 否 Map 编辑流程输入参数,启动时替换流程文件中的inputs值,例如{"key1":"value1", "key2":"value2"}。 说明: 仅当action为retry时,填写该参数有效。
  • 功能描述 停止正在执行的execution、启动已停止的execution或重试已失败的execution。 建议在使用本接口前,先调用查询execution接口,查询已有execution的状态。 如果要停止正在执行的execution,则需要确保该查询execution接口返回值object.status.actionName为create,且object.status.objectStatus.phase为Running或是Pending。 如果要重新启动execution,则该execution的状态可以如下二选一: object.status.actionName为create,且object.status.objectStatus.phase为Failed或Cancelled。 object.status.actionName为delete,且object.status.objectStatus.phase为Failed。
  • 环境准备 在安装使用SDK前,请确保已完成必要的环境准备。 已注册华为云帐号,并已开通基因容器服务。基因容器在控制台的访问链接为https://console.huaweicloud.com/gcs。 已完成开发环境准备,包括: 根据操作系统从Python官网下载并安装Python版本。 当前SDK包仅支持python3。 安装完成后请输入如下命令,查看是否安装成功。 python3 -VPython 3.6.8 已获取项目名称(project_name),若未获取请参见API凭证。如未自定义项目名称,无需关注此参数 已有可用的AK/SK,若未创建请参见访问密钥。
  • 示例代码说明 编辑XXX_demo.py文件,配置认证信息(ak/sk或username/password),以gcs_demo.py为例。 1 2 3 4 5 6 7 8 910111213141516171819 # -*- coding: UTF-8 -*-import requestsfrom gcs import GCSClient# 初始化gcs客户端gcs = GCSClient()# [二选一]设置用户名密码,默认region='cn-north-4',如在北京四运行无需设置,# 默认project_name=region,无需指定username="XXXXX"password="XXXXX"project_id="XXXXX"gcs.set_user_auth_param(username, password, project_id)# [二选一]# 设置AK,SK 默认region='cn-north-4',如在北京四运行无需设置,# 默认project_name=region,无需指定# ak="xxxxx"# sk="xxxxx"# project_id="XXXXX"# gcs.set_aksk_auth_param(ak, sk, project_id) 执行demo文件 $ python3 gcs_demo.py SDK接口使用方法请参见接口列表。 使用GCS客户端调用成功后均会返回 python对象requests.Response,关于Response的使用方法,请参见Response对象使用方法。
  • 基因容器SDK简介 基因容器服务软件开发工具包(GCS SDK,Gene Container Service Software Development Kit)对GCS服务提供的REST API接口进行封装,以简化您的开发工作。当前仅支持Python3语言的SDK,您可以使用GCS SDK提供的接口进行开发。当前SDK版本支持基于GCS环境和Cromwell环境两种任务运行方式,请根据需要进行选择。 在开始SDK开发前,请确保您已了解基因容器的基本概念,详细请参见基本概念。 SDK的版本迭代记录,请参见修订记录。
  • 安装SDK 获取GCS SDK安装包 cloud-sdk-python3-gcs-x.x.x.zip。 登录GCS控制台,下载基因容器Python SDK开发包,如下图所示。 图1 Python SDK开发包下载地址 解压SDK安装包。 目录结构如下: |-- cloud-sdk-python-gcs-x.x.x.zip |-- gcs-sdk-x.x.x.tar.gz python3 SDK |-- cromwell-demo.zip |-- cromwell_demo |-- cromwell_demo.py Cromwell引擎接口使用示例 |-- example.inputs 输入文件 |-- example.options options文件 |-- example.wdl WDL描述文件 |-- gcs-demo.zip |-- gcs_demo |-- gcs-grammr.yaml GCS流程语法文件 |-- gcs_demo.py GCS接口使用示例 |-- README.md 下载安装包管理工具pip,并更新到最新版本。 安装SDK。 pip3 install gcs-sdk-x.x.x.tar.gz 如果由于pip版本过低安装失败,请使用如下命令更新pip到最新版本之后再重新安装。 python3 -m pip install --upgrade pip 在Ubuntu中,升级了pip,如果版本跨度较大,再次使用pip 安装相关的python包的时候可能会出现以下错误 ImportError: cannot import name main 解决方法:pip3文件在usr/bin目录下,cd进去,进行以下修改 把下面的三行 123 from pip import mainif __name__ == '__main__': sys.exit(main()) 换成下面的三行 123 from pip import __main__if __name__ == '__main__': sys.exit(__main__._main()) 安装完成后,您就可以参考示例代码说明使用。
  • 返回值 表1 response body字典树第1层key值 参数 参数类型 描述 job-name Array 流程中各Job的名称,具体内容见表2 表2 response body字典树各Job元素key值 参数 参数类型 描述 metric Dictionary 监控元信息,具体内容见表3 max_value_metric Dictionary 各监控数据点最大值 min_value_metric Dictionary 各监控数据点最小值 average_value_metric Float 各监控数据点平均值 current_value_metric Dictionary 最近一次采集到的监控数据点 dataPoints Array 当show_datapoints置为True时,该字段展示所有监控数据点详情 表3 监控元信息 参数 参数类型 描述 namespace String 默认值“PAAS.CONTAINER” metricName String 监控指标,当前支持: memUsed:已使用内存量,单位为M cpuCoreLimit:CPU核数申请量,单位为Core cpuUsage:CPU使用量所占百分比 memUsage:内存使用量所占百分比 memCapacity:内存容量,单位为M cpuCoreUsed:已使用CPU核数,单位为Core dimensions Array 监控维度说明,具体内容见表4 表4 监控维度说明 参数 参数类型 描述 name String 监控维度项,默认为以下2项: clusterId,集群ID,默认为“CCI-ClusterID” podID,CCI中Pod ID value String 监控维度值 表5 监控数据结构体 参数 参数类型 描述 timestamps Long 监控数据获取时刻时间戳 unit String 监控数据单位 statistics Array 监控数据详情,具体内容见表6 表6 监控数据详情 参数 参数类型 描述 statistic String 统计学方法,支持 maximum,average,minimum value Float 监控数据值
  • 输入参数 参数 是否必选 参数类型 参数描述 username 是 String 华为云用户名,如果没有用户名,请填写账号名。 password 是 String 华为云密码。 project_id 是 String 项目ID domain_name 是 String 华为云账号名 region 否 String 华为云region,默认为北京四"cn-north-4"。 当前GCS支持的Region如下。 北京一:cn-north-1 北京四:cn-north-4 上海二:cn-east-2 project_name 否 String 如有自建项目请填写。 默认值等同于region,无需填写。 项目名称,请参见API凭证。
  • Response对象使用方法 使用GCS客户端调用成功后均会返回 SDK公共结果对象requests.Response,若调用失败,则抛出异常,可参考通用示例从SDK公共结果对象中获取HTTP状态码及返回内容,进一步判断错误详情。 用户可以通过Response.json()方法获取服务返回的json内容,通过Response.text 获取返回信息。下面返回值为通过Response.text获得的内容。 表1中展示了Response中常用的字段和方法,Response中的字段和方法还有很多,用户可以自行查阅requests包里的Response结构进行查看 表1 requests.Response 字段或方法 说明 content 以二进制(bytes)方式返回的响应内容。 encoding 获取text属性时采用的解码方式。 headers 以小写方式返回响应headers。 json(**kwargs) 将返回结果以json格式读入,即调用json.loads读取返回体,最终返回一个字典。如果返回体非json格式,则会抛出ValueError。 kwargs为调用json.loads传入的可选参数。 ok 如果响应码小于400,则返回True。 status_code 请求的响应码,例如404 or 200。 text 返回内容解码后的文本,以unicode的方式表示文本内容。 即按照Response.encoding中的编码方式来解码Response.content中的内容,若Response.encoding为空,则根据返回内容推断编码方式进行解码。
  • 返回值 响应中含有一个execution结构,建议通过response.json()方式获取返回值,结构如表1所示。 表1 返回值 参数 参数类型 参数描述 execution JSONObject execution基本属性,详见表3。 metadata JSONObject cromwell metadata status JSONObject 节点状态,详见表4, 如果为空,则不返回。 enterprise_project JSONObjec 企业项目,详见表表2 表2 enterprise_project 参数 参数类型 描述 id String 企业项目id name String 企业项目的名称 表3 Execution基本属性 参数 参数类型 描述 guid String execution guid。 name String execution名称。 namespace String execution所属命名空间。 project_id String execution所属项目ID。 domain_id String execution所属租户ID。 status String execution状态: Running:执行中 Aborting:停止中 Deleting: 删除中 Submitted:已提交 Succeeded:执行成功 Failed:执行失败 Aborted:已停止 workflow_name String 若使用GCS中的wdl流程提交,该字段表示流程名称;若使用其他方式提交,该字段表示wdl文件名称 wdl_name String 该execution所使用的workflow的名称 workflow_id String 若用GCS中的wdl流程提交任务,该字段表示该流程的ID inputs_json String execution输入。 outputs_json String execution输出。 image String 流程拓扑图。 time_duration int 处理持续时间。 target String execution的运行环境 create_at String execution创建时间。 update_at String execution更新时间。 task_status String 任务状态,详见表4, 如果为空,则不返回。 engine_deployment String cromwell对应的无状态负载名称 env_guid String execution执行环境id node_number int 流程任务数量 metadata_json String cromwell metadata resources Dictionary execution消耗的资源(CPU,Memory,GPU等)以及时间比,该时间比表示execution的实际执行时间所占总时间(包括执行时间、调度时间、失败处理时间等时间总和)的百分比,其中百分号已省略。 tae_resources Dictionary execution重试消耗的资源(CPU,Memory,GPU等)以及时间比,该时间比表示execution的重试执行时间所占总时间(包括重试执行时间、调度时间、失败处理时间等时间总和)的百分比,其中百分号已省略。 表4 task_status 参数 参数类型 描述 node_number int excution中步骤数量。 finished_node_number int 已完成步骤个数。 actual_node_status JSONObject,详见表5 各步骤的状态。 表5 actual_node_status 参数 参数类型 描述 name String 节点名称。 status String 该操作步骤的执行状态: Pending:等待处理中 Running:处理中 Cancelling:取消中 ForceCancelling:强制取消中 Retrying:重试中 Succeeded:执行成功 Failed:执行失败 Cancelled:取消 sub_job_num int 子job的数量。 finished_sub_job_num int 已完成子job的数量。 sub_job_status map 子job的状态: Submitted:已提交 Aborted:已停止 Aborting:停止中 Done:已完成 QueuedInCromwell:等待执行 Starting:执行中 Failed:执行失败 time_duration int 持续时间。 resources map job在持续时间内的资源消耗情况: CPU:单位为“ch”(核数*秒数) GPU:单位为“ch”(核数*秒数) Memory:单位为“gs”(内存数*秒数,内存单位为g)
  • 返回值 表1 response body字典树第1层key值 参数 参数类型 描述 job-name Array 流程中各Job的名称,具体内容见表2 表2 response body字典树各Job元素key值 参数 参数类型 描述 metric Dictionary 监控元信息,具体内容见表3 max_value_metric Dictionary 各监控数据点最大值 min_value_metric Dictionary 各监控数据点最小值 average_value_metric Float 各监控数据点平均值 current_value_metric Dictionary 最近一次采集到的监控数据点 dataPoints Array 当show_datapoints置为True时,该字段展示所有监控数据点详情 表3 监控元信息 参数 参数类型 描述 namespace String 默认值“PAAS.CONTAINER” metricName String 监控指标,当前支持: memUsed:已使用内存量,单位为M cpuCoreLimit:CPU核数申请量,单位为Core cpuUsage:CPU使用量所占百分比 memUsage:内存使用量所占百分比 memCapacity:内存容量,单位为M cpuCoreUsed:已使用CPU核数,单位为Core dimensions Array 监控维度说明,具体内容见表4 表4 监控维度说明 参数 参数类型 描述 name String 监控维度项,默认为以下2项: clusterId,集群ID,默认为“CCI-ClusterID” podID,CCI中Pod ID value String 监控维度值 表5 监控数据结构体 参数 参数类型 描述 timestamps Long 监控数据获取时刻时间戳 unit String 监控数据单位 statistics Array 监控数据详情,具体内容见表6 表6 监控数据详情 参数 参数类型 描述 statistic String 统计学方法,支持 maximum,average,minimum value Float 监控数据值
  • 返回值 响应中含有一个execution结构,建议通过response.json()方式获取返回值,结构如表1所示。 表1 返回值 参数 参数类型 参数描述 execution JSONObject execution基本属性,详见表3。 object JSONObject k8s execution部分,详见表3 K8s execution结构。 status JSONObject 节点状态,详见表11, 如果为空,则不返回。 enterprise_project JSONObjec 企业项目,详见表表2 表2 enterprise_project 参数 参数类型 描述 id String 企业项目id name String 企业项目的名称 表3 Execution基本属性 参数 参数类型 描述 guid String execution guid。 name String execution名称。 namespace String execution所属命名空间。 cluster_name String execution所属集群名称。 cluster_id String execution所属集群ID。 project_id String execution所属项目ID。 domain_id String execution所属租户ID。 description String execution描述。 status String execution状态: Pending:等待处理中 Running:处理中 Cancelling:取消中 ForceCancelling:强制取消中 Retrying:重试中 Succeeded:执行成功 Failed:执行失败 Cancelled:取消 workflow_id String 创建execution的流程ID。 workflow_name String 创建execution的流程名称。 workflow_scope String 创建execution的流程使用范围。 inputs_json String execution输入。 outputs_json String execution输出。 image String 流程拓扑图。 time_duration int 处理持续时间。 sfs_volume_name String 中间件存储卷名称。 job_type String execution的任务类型,可选值为: CCE.Job:job任务运行于CCE服务。 CCI.Job:job任务运行于CCI服务。 DLI .Job:job任务运行于DLI服务。 target String execution的运行环境,可选值为: cce:execution运行于CCE服务 cci:execution运行于CCI服务 create_at String execution创建时间。 update_at String execution更新时间。 label Dictionary 标签集合 resources Dictionary execution消耗的资源和时间比,该时间比表示execution的实际执行时间所占总时间(包括执行时间、调度时间、失败处理时间等时间总和)的百分比,其中百分号已省略 priority int execution的优先级,取值范围[0,999],默认为0 表4 K8s execution结构 参数 参数类型 描述 kind String 值为“execution”,表示是execution类型。 apiVersion String 值为“gene.kubedag/v1alpha1”,表示api版本。 metadata 表4 Execution Metadata结构 execution的元属性。 spec 表5 Execution Spec参数 execution的创建细节属性。 status 表7 Execution Spec Metadata参数 execution的运行状态。 表5 Execution Metadata结构 参数 参数类型 描述 name String execution名字,与表2中name字段一致。 namespace String execution所属命名空间。 selfLink String 访问该资源的连接。 uid String execution资源的ID,与表2的guid字段一致。 annotations JSONObject execution的特殊属性。 resourceVersion等其余字段 - k8s自带属性。 表6 Execution Spec参数 参数 参数类型 描述 metadata JSONObject,参见表7 execution的元信息。 actionName String excution操作的名称。 create:创建 start:启动 stop:停止 delete:删除 scale:伸缩 reconfig:重配置 retry:重试 timeoutInMinutes int execution的超时时间。 onFailureStrategy String execution的超时重试逻辑: DoNothing:不作处理 Rollback:回滚 Resume:恢复 Delete:删除 objectData String execution所使用的workflow数据,base64编码。 location String 指定的execution执行者的容器ip。 表7 Execution Spec Metadata参数 参数 参数类型 描述 labels JSONObject,内部每个key-value表示有个名为key值为value的标签 execution的标签,标签与创建时的stack.spec.selector.matchlabels一致。 namespace String 命名空间。 表8 Execution Status结构 参数 参数类型 描述 actionName String 操作的名称。 create:创建 start:启动 stop:停止 delete:删除 scale:伸缩 reconfig:重配置 retry:重试 progress int 执行进度。 objectStatus ActionStatus 操作的总体执行进度,表8 ExecutionStatus ActionStatus结构。 subObjectStatuses JSONObject 分步操作的执行进度, 每个key-value结构表示key对应的节点的执行进度,value为表9 ExecutionStatus SubActionStatus结构 。 elementStatuses JSONObject 各步骤的实际状态。 表9 ExecutionStatus ActionStatus结构 参数 参数类型 描述 phase String 该操作步骤的执行状态: Pending:等待处理中 Running:处理中 Cancelling:取消中 ForceCancelling:强制取消中 Retrying:重试中 Succeeded:执行成功 Failed:执行失败 Cancelled:取消 message String 详细的出错信息。 reason String 简短的CamelCase格式的错误描述信息。 updateAt String 以RFC3339格式表示的信息更新的UTC时间戳。 表10 ExecutionStatus SubActionStatus结构 参数 参数类型 描述 phase String 该操作步骤的执行状态: Pending:等待处理中 Running:处理中 Cancelling:取消中 ForceCancelling:强制取消中 Retrying:重试中 Succeeded:执行成功 Failed:执行失败 Cancelled:取消 message String 详细的出错信息。 reason String 简短的CamelCase格式的错误描述信息。 updateAt String 以RFC3339格式表示的信息更新的UTC时间戳。 subActionName String 操作的名称。 createAt String 以RFC3339格式表示的信息创建的UTC时间戳。 表11 步骤状态概览 参数 参数类型 描述 node_number int excution中步骤数量。 finished_node_number int 已完成步骤个数。 actual_node_status JSONObject,详见表12 各步骤的状态。 表12 步骤状态 参数 参数类型 描述 name String 节点名称。 status String 该操作步骤的执行状态: Pending:等待处理中 Running:处理中 Cancelling:取消中 ForceCancelling:强制取消中 Retrying:重试中 Succeeded:执行成功 Failed:执行失败 Cancelled:取消 sub_job_num int 子job的数量。 finished_sub_job_num int 已完成子job的数量。 sub_job_status map 子job的状态: Pending:等待处理中 Running:处理中 Cancelling:取消中 ForceCancelling:强制取消中 Retrying:重试中 Succeeded:执行成功 Failed:执行失败 Cancelled:取消 time_duration int 持续时间。 resources map job在持续时间内的资源消耗情况: CPU:单位为“ch”(核数*秒数) GPU:单位为“ch”(核数*秒数) Memory:单位为“gs”(内存数*秒数,内存单位为g)
  • 返回值 响应中含有指定流程的结构,结构如表1所示。 表1 返回值 参数 参数类型 参数描述 id String 流程ID。 name String 流程名称。 description String 流程描述。 vendor String 流程发布者。 scope String 流程范围。 project_id String 流程所属项目ID。 domain_id String 流程所属租户ID。 domain String 流程所属租户名称。 create_at String 流程创建时间。 update_at String 流程更新时间。 workflow_url String 流程模板文件在OBS桶中的url存储地址,用于下载对应的流程文件。 logo String 流程logo。 enterprise_project JSONObjec 企业项目,详见表表2 表2 enterprise_project 参数 参数类型 描述 id String 企业项目id name String 企业项目的名称
  • 输入参数 参数 是否必选 参数类型 参数描述 ak 是 String 用户的Access Key ID,即访问密钥ID,是与私有访问密钥关联的唯一标识符。访问密钥ID和私有访问密钥一起使用,对请求进行加密签名。获取方法请参见访问密钥。 sk 是 String 用户的Secret Access Key,获取方法请参见访问密钥。 project_id 是 String 项目ID region 否 String 华为云region,默认为北京四"cn-north-4" 当前GCS支持的Region如下。 北京一:cn-north-1 北京四:cn-north-4 上海二:cn-east-2 project_name 否 String 如有自建项目请填写。 默认值等同于region,无需填写 项目名称,请参见API凭证。
  • 返回值 表1 返回值参数 参数 参数类型 描述 guid String 工具ID。 name String 工具名称。 description String 工具描述。 project_id String 工具所属项目ID。 version String 工具版本。 scope String 工具可用范围。 domain:租户内可用 public:全局可用(跨租户可用) domain String 工具所属租户名称。 domain_id String 工具所属租户ID。 vendor String 工具创建者。 image String 工具包含镜像地址。 create_at String 工具创建时间。 update_at String 工具更新时间。 category String 工具分类。 instruction String 工具使用说明。 cpu String 使用工具,设置的虚机节点cpu限制。 memory String 使用工具,设置的虚机节点内存限制。 command String 使用工具,常用指令。 logo String 工具logo图片地址。 type String 类型,分为container(容器)、spark。 enterprise_project:id String 企业项目id 表2 enterprise_project 参数 参数类型 描述 id String 企业项目id name String 企业项目的名称
  • 返回值 响应中含有多个流程的结构,结构如表1所示。 表1 workflow结构 参数 参数类型 参数描述 id String 流程ID。 name String 流程名称。 description String 流程描述。 vendor String 流程发布者。 scope String 流程范围。 project_id String 流程所属项目ID。 domain_id String 流程所属租户ID。 domain String 流程所属租户名称。 create_at String 流程创建时间。 update_at String 流程更新时间。 workflow_url String 流程模板文件在OBS桶中的url存储地址,用于下载对应的流程文件。 logo String 流程logo。 image String 流程拓扑图。 enterprise_project JSONObjec 企业项目,详见表表2 表2 enterprise_project 参数 参数类型 描述 id String 企业项目id name String 企业项目的名称
  • 返回值 参数 参数类型 参数描述 inputs JSONObject,表1 流程输入信息。 表1 input 定义 参数 参数类型 参数描述 default number、array、String、bool 输入参数默认值。 value number、array、String、bool 输入参数实际值,后面查询execution会显示,此处默认不显示。 description String 参数描述。 type String 参数类型,包括number、array、String、bool。 label String 参数标签。
  • 输入参数 参数 是否必选 参数类型 参数描述 name 否 String 所要查找的execution名字。 status 否 String 所要查找的execution状态。支持的状态包括: Running:执行中 Aborting:停止中 Deleting: 删除中 Submitted:已提交 Succeeded:执行成功 Failed:执行失败 Aborted:已停止 workflow_name 否 String 所要查找的execution以指定workflow_name为运行模板。
  • 示例 // 使用本地文件提交任务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)
  • 返回值 参数 参数类型 参数描述 tools JSONObjec,见表1 流程工具信息列表。 表1 工具描述 参数 参数类型 参数描述 type String 类型,分为container(容器)、spark。 name String 工具名称。 version String 工具版本号。 image String 镜像地址。 cpu String CPU推荐值。 memory String 内存推荐值。 command String 推荐执行命令。 description String 工具描述。 scope String 使用范围,分为public(公开的)、private(私有的)。
  • 输入参数 表1 输入参数 参数 是否必选 参数类型 参数描述 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 提交需要用到的其他参数,当前支持以下参数: env_name:必选参数,任务提交到的Cromwell环境名称 workflow_id:可选参数,当workflow_source_file已赋值或parameters中存在workflow_source字段时,可不指定该字段 workflow_source:可选参数,当workflow_source_file已赋值或parameters中存在workflow_id字段时,可不指定该字段 workflow_inputs:可选参数,当workflow_inputs_file已赋值时,可不指定该字段 workflow_options:可选参数,当workflow_options_file已赋值时,可不指定该字段 workflow_depends:可选参数,当workflow_dependencies_path已赋值时,可不指定该字段 enterprise_project_id:可选参数,不使用企业项目时无需指定,execution的企业项目id,默认为“0”,表示default的企业项目
  • 返回值 表1 response body字典树第1层key值 参数 参数类型 描述 job-name Array 流程中各Job的名称,具体内容见表2 表2 response body字典树各Job元素key值 参数 参数类型 描述 metric Dictionary 监控元信息,具体内容见表3 max_value_metric Dictionary 各监控数据点最大值 min_value_metric Dictionary 各监控数据点最小值 average_value_metric Float 各监控数据点平均值 dataPoints Array 当show_datapoints置为True时,该字段展示所有监控数据点详情 表3 监控元信息 参数 参数类型 描述 namespace String 默认值“PAAS.CONTAINER” metricName String 监控指标,当前支持: memUsed:已使用内存量,单位为M cpuCoreLimit:CPU核数申请量,单位为Core cpuUsage:CPU使用量所占百分比 memUsage:内存使用量所占百分比 memCapacity:内存容量,单位为M cpuCoreUsed:已使用CPU核数,单位为Core dimensions Array 监控维度说明,具体内容见表4 表4 监控维度说明 参数 参数类型 描述 name String 监控维度项,默认为以下2项: clusterId,集群ID,默认为“CCI-ClusterID” podID,CCI中Pod ID value String 监控维度值 表5 监控数据结构体 参数 参数类型 描述 timestamps Long 监控数据获取时刻时间戳 unit String 监控数据单位 statistics Array 监控数据详情,具体内容见表6 表6 监控数据详情 参数 参数类型 描述 statistic String 统计学方法,支持 maximum,average,minimum value Float 监控数据值
  • 返回值 响应中含有多个环境结构,每个结构如表1所示。 表1 返回值参数 参数 参数类型 描述 guid String 环境ID。 project_id String 环境所属项目ID。 domain_id String 环境所属租户ID。 name String 环境名称。 description String 环境描述。 status String 环境运行状态,分别为: Running:运行中 Abnormal:异常 Creating:创建中 Deleting:删除中 CreatedFailed:创建失败 DeletedFailed:删除失败 create_at String 环境创建时间。 update_at String 环境更新时间。 cluster_id String 环境所属集群ID。 cluster_name String 环境所属集群名称。 cpu int 环境CPU核数。 memory int 环境内存量。 source String 部署环境的方式,支持如下四种环境。 cce:云容器引擎 cci:云容器实例 stack_id String 堆栈ID。 is_gene_cluster bool 是否为部署环境时新创建的集群。 default_env bool 是否为默认环境。 order_id String 若集群为包周期方式购买,order_id展示购买订单号。 cluster_info String 若部署环境的方式为"cce",cluster_info展示集群信息;若部署环境的方式为"cci",返回体不存在cluster_info字段。 enterprise_project JSONObjec 企业项目,详见表表2 表2 enterprise_project 参数 参数类型 描述 id String 企业项目id name String 企业项目的名称
共99354条