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

[SkyBench] Allow only s3 for sky benchmark #3785

Merged
merged 3 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 10 additions & 22 deletions sky/benchmark/benchmark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import sky
from sky import backends
from sky import clouds
from sky import data
from sky import global_user_state
from sky import sky_logging
Expand Down Expand Up @@ -170,8 +171,13 @@ def _create_benchmark_bucket() -> Tuple[str, str]:
# Select the bucket type.
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
# Sky Benchmark only supports S3 (see _download_remote_dir and
# _delete_remote_dir).
enabled_clouds = [
cloud for cloud in enabled_clouds if cloud in [str(clouds.AWS())]
]
assert enabled_clouds, ('No enabled cloud storage found. Sky Benchmark '
'requires GCP or AWS to store logs.')
bucket_type = data.StoreType.from_cloud(enabled_clouds[0]).value

# Create a benchmark bucket.
Expand Down Expand Up @@ -242,14 +248,8 @@ def _download_remote_dir(remote_dir: str, local_dir: str,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=True)
elif bucket_type == data.StoreType.GCS:
remote_dir = f'gs://{remote_dir}'
subprocess.run(['gsutil', '-m', 'cp', '-r', remote_dir, local_dir],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=True)
else:
raise RuntimeError('Azure Blob Storage is not supported yet.')
raise RuntimeError(f'{bucket_type} is not supported yet.')


def _delete_remote_dir(remote_dir: str, bucket_type: data.StoreType) -> None:
Expand All @@ -260,20 +260,8 @@ def _delete_remote_dir(remote_dir: str, bucket_type: data.StoreType) -> None:
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=True)
elif bucket_type == data.StoreType.GCS:
remote_dir = f'gs://{remote_dir}'
proc = subprocess.run(['gsutil', '-m', 'rm', '-r', remote_dir],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=False)
if proc.returncode != 0:
stderr = proc.stderr.decode('utf-8')
if 'BucketNotFoundException: 404' in stderr:
logger.warning(f'Bucket {remote_dir} does not exist. Skip')
else:
raise RuntimeError(f'Failed to delete {remote_dir}: {stderr}')
else:
raise RuntimeError('Azure Blob Storage is not supported yet.')
raise RuntimeError(f'{bucket_type} is not supported yet.')


def _read_timestamp(path: str) -> float:
Expand Down
1 change: 1 addition & 0 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -5268,6 +5268,7 @@ def test_multiple_resources():
@pytest.mark.no_fluidstack # Requires other clouds to be enabled
@pytest.mark.no_paperspace # Requires other clouds to be enabled
@pytest.mark.no_kubernetes
@pytest.mark.aws # SkyBenchmark requires S3 access
def test_sky_bench(generic_cloud: str):
name = _get_cluster_name()
test = Test(
Expand Down
Loading