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: no GCP/R2 credentials but trying to create a GCS/R2 bucket #1831

Closed
concretevitamin opened this issue Apr 2, 2023 · 2 comments · Fixed by #1858
Closed

UX: no GCP/R2 credentials but trying to create a GCS/R2 bucket #1831

concretevitamin opened this issue Apr 2, 2023 · 2 comments · Fixed by #1858
Assignees

Comments

@concretevitamin
Copy link
Member

Repro: on a docker container without GCP credentials, launch this YAML

file_mounts:
  /artifacts:
    name: skypilot-chatbot # Change to your own bucket
    store: gcs
    mode: MOUNT

This first run will print

ImportError: Fail to import dependencies for GCP.Try pip install "skypilot[gcp]"

The second a long stacktrace

  File "/opt/conda/lib/python3.9/site-packages/sky/cli.py", line 1268, in launch
    task = _make_task_from_entrypoint_with_overrides(
  File "/opt/conda/lib/python3.9/site-packages/sky/cli.py", line 997, in _make_task_from_entrypoint_with_overrides
    task = sky.Task.from_yaml(entrypoint)
  File "/opt/conda/lib/python3.9/site-packages/sky/task.py", line 299, in from_yaml
    storage_obj = storage_lib.Storage.from_yaml_config(storage[1])
  File "/opt/conda/lib/python3.9/site-packages/sky/data/storage.py", line 778, in from_yaml_config
    storage_obj.add_store(StoreType(store.upper()))
  File "/opt/conda/lib/python3.9/site-packages/sky/data/storage.py", line 636, in add_store
    store = store_cls(name=self.name, source=self.source)
  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.

Is there some UX optimization we can do here? E.g., calling global_user_state.get_enabled_clouds() to see GCP is not enabled? cc @romilbhardwaj

@concretevitamin concretevitamin changed the title UX: no GCP credentials but trying to create a GCS bucket UX: no GCP/R2 credentials but trying to create a GCS/R2 bucket Apr 3, 2023
@concretevitamin
Copy link
Member Author

Similar issue I ran into (cc @landscapepainter)

file_mounts:
  /tmp:
    name: tmp-workdir
    source: ~/tmp-workdir
    store: r2

prints a long stacktrace

...
  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

@landscapepainter
Copy link
Collaborator

I'll take a look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants