-
Notifications
You must be signed in to change notification settings - Fork 6
Adding Billing Rates to the config.py and rewriting references #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
39e759b to
b1b589e
Compare
openshift_metrics/config.py
Outdated
| RATE_GPU_H100_SU = os.getenv("RATE_GPU_H100_SU", "6.04") | ||
|
|
||
| # Legacy rate (for backward compatibility) | ||
| GPU_A100_RATE = os.getenv("GPU_A100_RATE", "1.803") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this constant used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find it. A text search across your PR doesn't show any reference to GPU_A100_RATE
| SU_NAMES = ["GPUV100", "GPUA100", "GPUA100SXM4", "GPUH100", "CPU"] | ||
| RESOURCE_NAMES = ["vCPUs", "RAM", "GPUs"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. Let's not touch these now for now. The whole SU types and their names will require some more thought.
openshift_metrics/merge.py
Outdated
| parser.add_argument("--rate-cpu-su", type=Decimal, default=Decimal(RATE_CPU_SU)) | ||
| parser.add_argument( | ||
| "--rate-gpu-v100-su", type=Decimal, default=Decimal(RATE_GPU_V100_SU) | ||
| ) | ||
| parser.add_argument( | ||
| "--rate-gpu-a100sxm4-su", type=Decimal, default=Decimal(RATE_GPU_A100SXM4_SU) | ||
| ) | ||
| parser.add_argument( | ||
| "--rate-gpu-a100-su", type=Decimal, default=Decimal(RATE_GPU_A100_SU) | ||
| ) | ||
| parser.add_argument( | ||
| "--rate-gpu-h100-su", type=Decimal, default=Decimal(RATE_GPU_H100_SU) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the point of this PR is to have configuration done through env vars, I would suggest removing these parser arguments since they are now redundant.
openshift_metrics/config.py
Outdated
| RATE_CPU_SU = os.getenv("RATE_CPU_SU", "0.013") | ||
| RATE_GPU_V100_SU = os.getenv("RATE_GPU_V100_SU", "1.214") | ||
| RATE_GPU_A100SXM4_SU = os.getenv("RATE_GPU_A100SXM4_SU", "2.078") | ||
| RATE_GPU_A100_SU = os.getenv("RATE_GPU_A100_SU", "1.803") | ||
| RATE_GPU_H100_SU = os.getenv("RATE_GPU_H100_SU", "6.04") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naved001 Do we still want keep the old behavior of having the rates None if not provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good point. If someone were to forget setting I'd rather the code fail than use some default values for rates.
|
@jimmysway have you had a chance to address the comments in this PR? |
…and rewriting code references. Removed CLI arguments for setting rates
b1b589e to
2967310
Compare
|
Sorry I had them sitting in my local branch. I just merged with upstream |
|
@jimmysway There are merge conflicts in the PR |
Part 2 of #144