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

[UX] Optimizing error message when disabled cloud storage attempted #1858

Merged

Conversation

landscapepainter
Copy link
Collaborator

@landscapepainter landscapepainter commented Apr 14, 2023

This PR resolves #1831
When a Cloud Storage was set in the entrypoint yaml without enabling the cloud, Skypilot printed out long stack trace of error message. These messages are condensed into a simple message while removing the stack trace.

Before:

  ...
  File "/opt/conda/lib/python3.9/site-packages/sky/data/storage.py", line 1097, in __init__
    super().__init__(name, source, region, is_sky_managed)
  File "/opt/conda/lib/python3.9/site-packages/sky/data/storage.py", line 175, in __init__
    self.initialize()
  File "/opt/conda/lib/python3.9/site-packages/sky/data/storage.py", line 1129, in initialize
    self.client = gcp.storage_client()
  File "/opt/conda/lib/python3.9/site-packages/sky/adaptors/gcp.py", line 24, in wrapper
    return func(*args, **kwargs)
  File "/opt/conda/lib/python3.9/site-packages/sky/adaptors/gcp.py", line 47, in storage_client
    return storage.Client()
  File "/opt/conda/lib/python3.9/site-packages/google/cloud/storage/client.py", line 172, in __init__
    super(Client, self).__init__(
  File "/opt/conda/lib/python3.9/site-packages/google/cloud/client/__init__.py", line 320, in __init__
    _ClientProjectMixin.__init__(self, project=project, credentials=credentials)
  File "/opt/conda/lib/python3.9/site-packages/google/cloud/client/__init__.py", line 268, in __init__
    project = self._determine_default(project)
  File "/opt/conda/lib/python3.9/site-packages/google/cloud/client/__init__.py", line 287, in _determine_default
    return _determine_default_project(project)
  File "/opt/conda/lib/python3.9/site-packages/google/cloud/_helpers/__init__.py", line 152, in _determine_default_project
    _, project = google.auth.default()
  File "/opt/conda/lib/python3.9/site-packages/google/auth/_default.py", line 648, in default
    raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.

After:

Task from YAML spec: t.yaml
sky.exceptions.CloudDisabledError: Storage 'store:gcs' specified, but 'GCP' access is disabled. Enable 'GCP' to fix.

Before:

  ...
  File "/Users/zongheng/Dropbox/workspace/riselab/sky-computing/sky/data/storage.py", line 1479, in initialize
    self.client = data_utils.create_r2_client(self.region)
  ...
  File "/Users/zongheng/anaconda/envs/py37/lib/python3.7/site-packages/botocore/session.py", line 416, in get_scoped_config
    raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile (r2) could not be found

After:

Task from YAML spec: test.yaml
sky.exceptions.CloudDisabledError: Storage 'store:r2' specified, but 'Cloudflare' access is disabled. Enable 'Cloudflare' to fix.

Tested (run the relevant ones):

  • Tested with yaml that has gcs, r2, s3 store set up

@landscapepainter landscapepainter force-pushed the disabled_cloud_ux_optimize branch from 0d5c288 to 6ee3952 Compare April 15, 2023 23:23
Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @landscapepainter! Left some comments.

sky/global_user_state.py Outdated Show resolved Hide resolved
sky/task.py Outdated Show resolved Hide resolved
sky/data/storage.py Outdated Show resolved Hide resolved
@romilbhardwaj romilbhardwaj added this to the v0.3 milestone May 16, 2023
sky/task.py Outdated Show resolved Hide resolved
sky/task.py Outdated Show resolved Hide resolved
sky/data/storage.py Outdated Show resolved Hide resolved
@landscapepainter
Copy link
Collaborator Author

@romilbhardwaj Ready for another look :))

Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @landscapepainter! Left some comments.

Comment on lines 675 to 676
if not isinstance(cloud, clouds.Lambda) and
not isinstance(cloud, clouds.IBM)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we:

  1. Update STORE_ENABLED_CLOUDS in storage.py to a) be a List[str] and b) Add cloudflare.NAME to this list?
  2. Change this list comprehension to select only the clouds in STORE_ENABLED_CLOUDS?

Trying to minimize the number of places the list of storage enabled clouds needs to be maintained :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.
Note the change I made in task.py/get_preferred_store_type() as STORE_ENABLED_CLOUDS is List[str] now.

sky/data/storage.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@landscapepainter landscapepainter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romilbhardwaj Ready for another look!

sky/data/storage.py Outdated Show resolved Hide resolved
sky/data/storage.py Outdated Show resolved Hide resolved
sky/data/storage.py Outdated Show resolved Hide resolved
sky/task.py Outdated Show resolved Hide resolved
@landscapepainter
Copy link
Collaborator Author

@romilbhardwaj Updated :)

Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @landscapepainter! Should be good to go if test_smoke.py::TestStorageWithCredentials also passes.

sky/data/storage.py Show resolved Hide resolved
@landscapepainter
Copy link
Collaborator Author

landscapepainter commented May 25, 2023

Thanks @landscapepainter! Should be good to go if test_smoke.py::TestStorageWithCredentials also passes.

Passing test_smoke.py::TestStorageWithCredentials :)

Screenshot 2023-05-25 at 3 45 34 PM

@landscapepainter landscapepainter merged commit 4849c86 into skypilot-org:master May 25, 2023
landscapepainter added a commit that referenced this pull request May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UX: no GCP/R2 credentials but trying to create a GCS/R2 bucket
2 participants