cloud-pipeline
cloud-pipeline copied to clipboard
Include run costs into export runs report
Background
At the moment, POST /run/filter/export method does not include run costs into report and it would be nice to support it.
Approach
- Currently, run object provides the following information about prices:
computePricePerHour- virtual machine price per hourdiskPricePerHour- instance disk gigabyte price per hourfsPricePerHour- filesystem price per hour taking into account its current capacity. This value shall be updated as per as the file system capacity is updated.pricePerHour- overall run price per hour:
pricePerHour = computePricePerHour + <disk size GB> * diskPricePerHour + fsPricePerHour
pricePerHour value shall be updated after disk autoscaling process.
Note: run object does not provide full disk price per hour directly. But this value can be estimated as:
<full disk price> = pricePerHour - computePricePerHour - fsPricePerHour
- In case of cluster run, master run objects contains
workersPrice- the estimated total price for all workers - As far as run can be paused, compute costs shall be respected only for active periods.
Thereby, estimated run costs can be calculated the following way:
<run active hours> * computePricePerHour + <total run hours> * (pricePerHour - computePricePerHour) + workersPrice