Skip to content

Commit

Permalink
rename & fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cblmemo committed Mar 23, 2024
1 parent c63dc7f commit abc4045
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sky/benchmark/benchmark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _create_benchmark_bucket() -> Tuple[str, str]:
bucket_name = f'sky-bench-{uuid.uuid4().hex[:4]}-{getpass.getuser()}'

# Select the bucket type.
enabled_clouds = storage_lib.get_enabled_storage_clouds(
enabled_clouds = storage_lib.get_cached_enabled_storage_clouds_or_refresh(
raise_if_no_cloud_access=True)
# Already checked by raise_if_no_cloud_access=True.
assert enabled_clouds
Expand Down
7 changes: 3 additions & 4 deletions sky/data/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@
'It may have been deleted externally.')


def get_enabled_storage_clouds(
def get_cached_enabled_storage_clouds_or_refresh(
raise_if_no_cloud_access: bool = False) -> List[str]:
# This is a temporary solution until https://github.com/skypilot-org/skypilot/issues/1943 # pylint: disable=line-too-long
# is resolved by implementing separate 'enabled_storage_clouds'
enabled_clouds = sky_check.get_cached_enabled_clouds_or_refresh(
raise_if_no_cloud_access=raise_if_no_cloud_access)
enabled_clouds = sky_check.get_cached_enabled_clouds_or_refresh()
enabled_clouds = [str(cloud) for cloud in enabled_clouds]

enabled_storage_clouds = [
Expand All @@ -91,7 +90,7 @@ def get_enabled_storage_clouds(

def _is_storage_cloud_enabled(cloud_name: str,
try_fix_with_sky_check: bool = True) -> bool:
enabled_storage_clouds = get_enabled_storage_clouds()
enabled_storage_clouds = get_cached_enabled_storage_clouds_or_refresh()
if cloud_name in enabled_storage_clouds:
return True
if try_fix_with_sky_check:
Expand Down
5 changes: 3 additions & 2 deletions sky/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,9 @@ def get_preferred_store_type(self) -> storage_lib.StoreType:
# assert len(self.resources) == 1, self.resources
storage_cloud = None

enabled_storage_clouds = storage_lib.get_enabled_storage_clouds(
raise_if_no_cloud_access=True)
enabled_storage_clouds = (
storage_lib.get_cached_enabled_storage_clouds_or_refresh(
raise_if_no_cloud_access=True))

if self.best_resources is not None:
storage_cloud = self.best_resources.cloud
Expand Down

0 comments on commit abc4045

Please sign in to comment.