Skip to content

Commit

Permalink
account for gpu capacity blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
EverettBerry committed Mar 7, 2024
1 parent 4a34389 commit 07a565e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ def add_pricing(imap):
if region.startswith("cn-"):
continue

# Skip capacity block pricing which affects certain p series instances
if product_attributes["marketoption"] == "CapacityBlock":
continue

terms = offer.get("terms")

operating_system = product_attributes.get("operatingSystem")
Expand Down
8 changes: 8 additions & 0 deletions in/instance-type.html.mako
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
</div>
</div>

% if i["Amazon"][1]["value"] == 'p5.48xlarge' or i["Amazon"][1]["value"] == 'p4d.24xlarge':
<div class="mt-4 d-flex justify-content-center">
<div>
<p>This instance is available in <a href="https://www.vantage.sh/blog/aws-ec2-capacity-blocks-gpu-shortage-cost">Capacity Blocks</a>.</p>
</div>
</div>
% endif

<!-- price Selects -->
<div class="d-flex flex-wrap mt-2">
<div class="col-6 pe-2 mb-2">
Expand Down

0 comments on commit 07a565e

Please sign in to comment.