0

I'm using the Cromwell engine on Google Cloud, which submits pipeline run requests: https://cloud.google.com/genomics/reference/rest/v1alpha2/pipelines/run.

Once the pipelines have finished, I am then able to find the Google Cloud operations associated with each pipeline via the labels. However, I can't determine their cost. The Google Cloud billing logs only list the compute engine bills, but they don't show a connection between the compute engine instances and the genomics operations, so I can't work out how to calculate the cost.

How can I calculate the cost of a Google Cloud Genomics Pipeline

4

1 回答 1

1

事实证明,如果您使用正确labels指定的方式运行管道(在 API 文档中进行了解释),您可以使用这些标签过滤计费日志。就我而言,克伦威尔引擎会自动为我完成这项工作,所以我不需要做任何额外的事情。

当您要分析账单时,您必须数据导出到 BigQuery,您不能将数据导出到文件,因为这不会为您提供必填字段。

将账单加载到 BigQuery 后(对我来说大约需要 4-5 小时),您可以运行以下查询:

SELECT SUM(cost)
FROM `PipelineBilling.gcp_billing_export_v1_BILLING_ACCOUNT_ID`, UNNEST(labels) as l
WHERE l.key = 'cromwell-workflow-id' AND l.value = 'cromwell-MY-WORKFLOW-ID'

这将返回一个数字,它是带有名为 的标签的管道的总成本,cromwell-workflow-id其值为cromwell-MY-WORKFLOW-ID(但是,如果您不使用 Cromwell,此标签会有所不同)。

于 2018-11-22T00:55:02.683 回答