-
-
Save amygdala/0a36e1abe22b77a9ad4b18e25252a550 to your computer and use it in GitHub Desktop.
Connecting to AI Platform Pipelines when 'gcloud' is not installed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.oauth2 import service_account | |
from google.auth.transport import requests | |
import kfp | |
# change this to point to your service account credentials file | |
credentials = service_account.Credentials.from_service_account_file(“/path/to/credentials/service_acct_creds.json", scopes=["https://www.googleapis.com/auth/cloud-platform"]) | |
credentials.refresh(requests.Request()) | |
token = credentials.token | |
# change this to point to the endpoint of your AI Platform Pipelines installation | |
client=kfp.Client(host=‘<your_pipelines_endpoint>.pipelines.googleusercontent.com', existing_token=token) | |
client.list_pipelines() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment