-
Notifications
You must be signed in to change notification settings - Fork 531
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
Exclude Colab Enterprise from Google Colab token retrieval #2529
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
def is_colab_enterprise() -> bool: | ||
"""Return `True` if code is executed in a Google Colab Enterprise environment.""" | ||
return os.environ.get("VERTEX_PRODUCT") == "COLAB_ENTERPRISE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you could put this directly in is_google_colab
? i.e. is_google_colab if on Colab but not on Colab Enterprise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep it separated like this so that we have the correct information in the env dump (in case of a user reporting an issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
def is_colab_enterprise() -> bool: | ||
"""Return `True` if code is executed in a Google Colab Enterprise environment.""" | ||
return os.environ.get("VERTEX_PRODUCT") == "COLAB_ENTERPRISE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep it separated like this so that we have the correct information in the env dump (in case of a user reporting an issue)
…x-colab-enterprise-token-detection
Related to a request made by the Google Colab team in a private discussion on slack.
This PR changes the way token retrieval works in Google Colab environments by excluding Google Colab Enterprise. Colab Enterprise uses a different secrets manager, so we're excluding this environment from the Google Colab token retrieval method.
changes made:
_get_token_from_google_colab()
to detect and exclude Colab Enterprise