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] Make sky check more fine-grained for GCP #2196

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Jul 7, 2023

Fixes #2184

This PR makes the sky check provides information based on the status of the user's current setup.

Missing dependency:

$ sky check
Checking credentials to enable clouds for SkyPilot.
  AWS: enabled          
  Azure: enabled          
  GCP: disabled          
    Reason: GCP tools are not installed. Run the following commands:
      $ pip install google-api-python-client
      $ conda install -c conda-forge google-cloud-sdk -y
    Credentials may also need to be set. Run the following commands:
      $ gcloud init
      $ gcloud auth application-default login
    For more info: https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#google-cloud-platform-gcp
    Details: [builtins.ModuleNotFoundError] No module named 'googleapiclient'
  Lambda: enabled          
  IBM: enabled          
  SCP: enabled          
  OCI: enabled          
  Cloudflare (for R2 object store): enabled          

SkyPilot will use only the enabled clouds to run tasks. To change this, configure cloud credentials, and run sky check.

Without gcloud init:

$ sky check                   
Checking credentials to enable clouds for SkyPilot.
  AWS: enabled          
  Azure: enabled          
  GCP: disabled          
    Reason: Credentails are not set. Run the following commands:
      $ gcloud init
      $ gcloud auth application-default login
    For more info: https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#google-cloud-platform-gcp
    Details: [builtins.FileNotFoundError] ~/.config/gcloud/access_tokens.db
  Lambda: enabled          
  IBM: enabled          
  SCP: enabled          
  OCI: enabled          
  Cloudflare (for R2 object store): enabled          

SkyPilot will use only the enabled clouds to run tasks. To change this, configure cloud credentials, and run sky check.
If any problems remain, please file an issue at https://github.com/skypilot-org/skypilot/issues/new

Without gcloud auth application-default login:

$ sky check
Checking credentials to enable clouds for SkyPilot.
  AWS: enabled          
  Azure: enabled          
  GCP: disabled          
    Reason: Application credentials are not set. Run the following commands:
      $ gcloud auth application-default login
    Or set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of your service account key file.
    For more info: https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#google-cloud-platform-gcp
    Details: [builtins.FileNotFoundError] ~/.config/gcloud/application_default_credentials.json
  Lambda: enabled          
  IBM: enabled          
  SCP: enabled          
  OCI: enabled          
  Cloudflare (for R2 object store): enabled          

SkyPilot will use only the enabled clouds to run tasks. To change this, configure cloud credentials, and run sky check.
If any problems remain, please file an issue at https://github.com/skypilot-org/skypilot/issues/new

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

Copy link
Member

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

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

Thanks a bunch @Michaelvll! One minor nit.

'https://skypilot.readthedocs.io/en/latest/getting-started/installation.html' # pylint: disable=line-too-long
f'\nDetails: {common_utils.format_exception(e, use_bracket=True)}'
)
'Credentials are not correctly set. '
Copy link
Member

Choose a reason for hiding this comment

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

Can we also hint the CLI commands that are equivalent to L571 & 574? Something like "Getting project ID / current user failed. You can debug with "cmd1" and "cmd2". {_CREDENTIAL_HINT}"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! Added. There is no exactly equivalent command for auth.default(), but this exception is a very rare case, if the previous checks pass. We only add the gcloud auth list command here, and can wait for more feedbacks if user encounter this issue. : )

@Michaelvll Michaelvll merged commit 8b139bc into master Jul 10, 2023
@Michaelvll Michaelvll deleted the detailed-info-for-gcp-check branch July 10, 2023 16:42
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] sky check should include fine grained error messages
2 participants