Skip to content

Commit

Permalink
Allow different prices in a same region
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Aug 16, 2024
1 parent 1c32aa4 commit 42c090d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sky/clouds/service_catalog/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,17 @@ def get_hourly_cost_impl(
price_str = 'Price'
# For AWS/Azure/GCP on-demand instances, the price is the same across
# all the zones in the same region.
assert region is None or len(set(df[price_str])) == 1, df
# We do not assert this as for Azure, it seems we can have different
# prices for specific instance types in the same region. This is to
# unblock our users from using those specific instance types:
# Standard_D2as_v5, Standard_D2ads_v5
# TODO(Tian): investigate this.
if region is not None and len(set(df[price_str])) > 1:
logger.debug(f'Found multiple prices for instance type '
f'{instance_type!r} in region {region!r}. '
'This is unexpected. Please report this to the '
'SkyPilot team.')
# assert region is None or len(set(df[price_str])) == 1, df

if pd.isna(df[price_str]).all():
with ux_utils.print_exception_no_traceback():
Expand Down

0 comments on commit 42c090d

Please sign in to comment.