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

Add GCP permission check #1772

Merged
merged 3 commits into from
Mar 16, 2023
Merged

Add GCP permission check #1772

merged 3 commits into from
Mar 16, 2023

Conversation

infwinston
Copy link
Member

This PR aims to fix #1755 by adding permission checking for GCP.

Tested (run the relevant ones):

  • Tested with my another GCP account with insufficient permissions. The error message correctly shows up during sky check.

Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

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

Thanks for adding the check @infwinston! That can significantly improve the UX for initial GCP users.

Comment on lines 553 to 556
'You do not have below required permissions to access '
'the project.\n '
f'{diffs}\n '
'Visit https://skypilot.readthedocs.io/en/latest/reference/faq.html#what-are-the-required-iam-permissons-on-gcp-for-skypilot for details.') # pylint: disable=line-too-long
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'You do not have below required permissions to access '
'the project.\n '
f'{diffs}\n '
'Visit https://skypilot.readthedocs.io/en/latest/reference/faq.html#what-are-the-required-iam-permissons-on-gcp-for-skypilot for details.') # pylint: disable=line-too-long
'The following permissions are not enabled for the current GCP '
f'identity {identity}.\n'
f'{diffs}\n '
'For more details, visit: https://skypilot.readthedocs.io/en/latest/reference/faq.html#what-are-the-required-iam-permissons-on-gcp-for-skypilot') # pylint: disable=line-too-long

The identity can be got from the return value of L468.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! added

@infwinston infwinston merged commit bffeb7c into master Mar 16, 2023
@infwinston infwinston deleted the gcp-perm-check branch March 16, 2023 00:03
sumanthgenz pushed a commit to sumanthgenz/skypilot that referenced this pull request Mar 16, 2023
* Add GCP permission check

* add one perm

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

GCP permissions: make sky check check permissions and fail early
2 participants