Skip to content
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

Add tool to fetch latest EC2 pricing from AWS API #102

Merged
merged 4 commits into from
Feb 1, 2025
Merged

Conversation

jasonk000
Copy link
Contributor

Introduces a tool to automatically fetch EC2 pricing and inject into the hardware pricing information for AWS. Also, update the hardware profile loading to allow multiple files, read by lexicographical sort.

Introduces a tool to automatically fetch EC2 pricing and inject into the
hardware pricing information for AWS. Also, update the hardware profile
loading to allow multiple files, read by lexicographical sort.
@jasonk000 jasonk000 requested review from jolynch and shy-1234 January 31, 2025 02:35
@jasonk000 jasonk000 force-pushed the jkoch/fetch-pricing branch from 1443aec to b80bc86 Compare January 31, 2025 04:13
@jolynch
Copy link
Contributor

jolynch commented Jan 31, 2025

Also, update the hardware profile loading to allow multiple files, read by lexicographical sort.

This is awesome! let's chat about extending multi-file to shapes as well.

Copy link
Contributor

@jolynch jolynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg2m, minor suggestions and I can fast follow if needed.

"g5.4xlarge": {
"annual_cost": 5349.0
},
"c4.xlarge": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this file be sorted lexiographically? I think there is an option in json dump to write in source order and then we can just insert in lexiographic order.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do a sort... more of a meta discussion though:

My thinking was that different files can do different chunks of data, so we can add a _rds.json to store the rds pricing data. It's just the load stage that has to be able to blend the files programmatically.

If you wanted to insert shape data, with manual input, in different files, we could apply a similar treatment to the loading of shapes/aws.json data, and combine instance data. For ex, shapes/aws_sizes, shapes/aws_fio, shapes/aws_iperf, shapes/.... could all be manually maintained distinctly, and blended at load time.

An ideal end-state would be absolutely as much as possible should be generated by tooling, and a minimum amount of cognitive effort to apply manual inputs. The code should take care of loading and combining files correctly, rather than pushing the thinking to people manually typing it in.

All that is to say, I don't think this file should ever be modified by a human, so I'm not sure the value of sorting it. Maybe I've misunderstood! Let me know what you're thinking.

tools/fetch_pricing.py Outdated Show resolved Hide resolved
@jolynch
Copy link
Contributor

jolynch commented Feb 1, 2025

Will follow up on the test change. Thank you I am stoked to get this automated.

@jolynch jolynch merged commit e0a093f into main Feb 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants