vantage-sh / ec2instances.info

Amazon EC2 instance comparison site
https://ec2instances.info
MIT License
5.11k stars 578 forks source link

Add new OS available from EC2 + make translate_platform_name a little more robust #651

Closed meowtochondria closed 1 year ago

meowtochondria commented 2 years ago

Addresses the following exception when running python3 ./scrape.py:

Traceback (most recent call last):
  File "./scrape.py", line 1054, in <module>
    scrape("www/instances.json")
  File "./scrape.py", line 1018, in scrape
    add_pricing_info(all_instances)
  File "./scrape.py", line 234, in add_pricing_info
    ec2.add_pricing(by_type)
  File "/home/dghai/ec2instances.info/ec2.py", line 198, in add_pricing
    add_spot_pricing(imap)
  File "/home/dghai/ec2instances.info/ec2.py", line 269, in add_spot_pricing
    price["ProductDescription"], "NA"
  File "/home/dghai/ec2instances.info/ec2.py", line 38, in translate_platform_name
    return os[operating_system] + software[preinstalled_software]
KeyError: 'Red Hat Enterprise Linux (Amazon VPC)'
EverettBerry commented 2 years ago

I think I can actually merge this without testing - did you happen to build the docker container all the way through?

meowtochondria commented 2 years ago

Nope... just reran scrape.py as it seemed to be pretty straightforward. If you would like me to build the container, please let me know!

EverettBerry commented 2 years ago

I think we need to add Red Hat Enterprise Linux (Amazon VPC) here for this change to make it's way to the frontend https://github.com/vantage-sh/ec2instances.info/blob/31e2fb41a280eb86da9d135b4b852f8d6325c33f/in/index.html.mako#L421. Also in the JS file here https://github.com/vantage-sh/ec2instances.info/blob/31e2fb41a280eb86da9d135b4b852f8d6325c33f/www/default.js#L87

I can take care of that if you're unfamiliar, or you can use render.py to test that change. With that, I believe the new OS should show up in the columns dropdown.

image
EverettBerry commented 1 year ago

@meowtochondria was the frontend something you were interested in taking a crack at? Happy to make those changes myself too and merge this.

meowtochondria commented 1 year ago

I did try, but couldn't really make any real progress. Go for it if you understand what needs to be done!

-------- Original Message -------- On Sep 1, 2022, 9:21 AM, retttx wrote:

@.***(https://github.com/meowtochondria) was the frontend something you were interested in taking a crack at? Happy to make those changes myself too and merge this.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>