-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Feature Description
Provide a clear and concise description of the feature you'd like to see
Clustrix's built-in cost-monitoring features should programmatically retrieve cost information from cloud providers to ensure accuracy.
Use Case
Describe the problem this feature would solve or the use case it enables
Currently, it looks like price lists for cloud service providers are hard-coded. E.g., for AWS:
clustrix/clustrix/cost_providers/aws.py
Lines 21 to 57 in 22c195e
# AWS EC2 On-Demand pricing (us-east-1, as of 2025, approximate rates in USD/hour) | |
self.ec2_pricing = { | |
# General Purpose | |
"t3.micro": 0.0104, | |
"t3.small": 0.0208, | |
"t3.medium": 0.0416, | |
"t3.large": 0.0832, | |
"t3.xlarge": 0.1664, | |
"t3.2xlarge": 0.3328, | |
# Compute Optimized | |
"c5.large": 0.085, | |
"c5.xlarge": 0.17, | |
"c5.2xlarge": 0.34, | |
"c5.4xlarge": 0.68, | |
"c5.9xlarge": 1.53, | |
"c5.18xlarge": 3.06, | |
# Memory Optimized | |
"r5.large": 0.126, | |
"r5.xlarge": 0.252, | |
"r5.2xlarge": 0.504, | |
"r5.4xlarge": 1.008, | |
"r5.8xlarge": 2.016, | |
"r5.16xlarge": 4.032, | |
# GPU Instances | |
"p3.2xlarge": 3.06, # 1 V100 | |
"p3.8xlarge": 12.24, # 4 V100 | |
"p3.16xlarge": 24.48, # 8 V100 | |
"p4d.24xlarge": 32.77, # 8 A100 | |
"g4dn.xlarge": 0.526, # 1 T4 | |
"g4dn.2xlarge": 0.752, # 1 T4 | |
"g4dn.4xlarge": 1.204, # 1 T4 | |
"g4dn.8xlarge": 2.176, # 1 T4 | |
"g4dn.12xlarge": 3.912, # 4 T4 | |
"g4dn.16xlarge": 4.352, # 1 T4 | |
# Default fallback | |
"default": 0.10, | |
} |
I'm not super familiar with these services so I don't know how often their pricing tends to change. But when it does change, if (A) Clustrix hasn't been updated recently and/or (B) a user isn't running the most recent version, Clustrix will underestimate their usage cost, which wouldn't be good.
Proposed Solution
Describe how you envision this feature working
AWS provides an API for retrieving pricing info: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html
I don't know if other providers have something similar, but for any that do, Clustrix should use that info instead of hard-coded prices. For those that don't, Clustrix should at minimum emit a warning that cost estimates may be inaccurate, and display the date that its hard-coded prices were current as of.
Checklist
- I have searched existing issues to ensure this feature hasn't been requested
- This feature aligns with Clustrix's goal of simplifying distributed computing
- I have provided a clear use case for this feature