Compare commits

...
1 Commits
Author SHA1 Message Date
Andrew Ferlitsch 6434c1a8ca fix: official standard 2023-08-04 19:06:28 +00:00
@@ -321,10 +321,8 @@
},
"outputs": [],
"source": [
"IS_COLAB = False\n",
"# from google.colab import auth\n",
"# auth.authenticate_user()\n",
"# IS_COLAB=True"
"# auth.authenticate_user()"
]
},
{
@@ -409,6 +407,9 @@
},
"outputs": [],
"source": [
"import sys\n",
"\n",
"IS_COLAB = \"google.colab\" in sys.modules\n",
"if (\n",
" SERVICE_ACCOUNT == \"\"\n",
" or SERVICE_ACCOUNT is None\n",
@@ -471,6 +472,7 @@
"outputs": [],
"source": [
"import json\n",
"import os\n",
"\n",
"import google.cloud.aiplatform as aiplatform\n",
"from kfp.registry import RegistryClient"
@@ -498,6 +500,33 @@
"aiplatform.init(project=PROJECT_ID, location=REGION, staging_bucket=BUCKET_URI)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "2d242773d707"
},
"source": [
"### Enable Artifact Registry API\n",
"You must enable the Artifact Registry API service for your project.\n",
"\n",
"<a href=\"https://cloud.google.com/artifact-registry/docs/enable-service\">Learn more about Enabling service</a>."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "162b5e8883c2"
},
"outputs": [],
"source": [
"! gcloud services enable artifactregistry.googleapis.com\n",
"\n",
"if os.getenv(\"IS_TESTING\"):\n",
" ! sudo apt-get update --yes && sudo apt-get --only-upgrade --yes install google-cloud-sdk-cloud-run-proxy google-cloud-sdk-harbourbridge google-cloud-sdk-cbt google-cloud-sdk-gke-gcloud-auth-plugin google-cloud-sdk-kpt google-cloud-sdk-local-extract google-cloud-sdk-minikube google-cloud-sdk-app-engine-java google-cloud-sdk-app-engine-go google-cloud-sdk-app-engine-python google-cloud-sdk-spanner-emulator google-cloud-sdk-bigtable-emulator google-cloud-sdk-nomos google-cloud-sdk-package-go-module google-cloud-sdk-firestore-emulator kubectl google-cloud-sdk-datastore-emulator google-cloud-sdk-app-engine-python-extras google-cloud-sdk-cloud-build-local google-cloud-sdk-kubectl-oidc google-cloud-sdk-anthos-auth google-cloud-sdk-app-engine-grpc google-cloud-sdk-pubsub-emulator google-cloud-sdk-datalab google-cloud-sdk-skaffold google-cloud-sdk google-cloud-sdk-terraform-tools google-cloud-sdk-config-connector\n",
" ! gcloud components update --quiet"
]
},
{
"cell_type": "markdown",
"metadata": {
@@ -506,9 +535,7 @@
"source": [
"## Create repo in Artifact Registry\n",
"\n",
"First, you create your own (user-defined) repository in the `Artifact Registry`. You use this repository to upload and retrieve your pipeline templates.\n",
"\n",
"The name of your repo is `quickstart-kfp-repo`"
"First, you create your own (user-defined) repository in the `Artifact Registry`. You use this repository to upload and retrieve your pipeline templates."
]
},
{
@@ -519,7 +546,7 @@
},
"outputs": [],
"source": [
"REPO_NAME = \"quickstart-kfp-repo\"\n",
"REPO_NAME = \"my-docker-repo-unique\"\n",
"\n",
"! gcloud artifacts repositories create {REPO_NAME} --location={REGION} --repository-format=KFP"
]
@@ -833,7 +860,9 @@
"if delete_bucket or os.getenv(\"IS_TESTING\"):\n",
" ! gsutil rm -r $BUCKET_URI\n",
"\n",
"! rm -rf custom custom.tar.gz"
"! rm -rf custom custom.tar.gz\n",
"\n",
"! gcloud artifacts repositories delete $REPO_NAME --project {PROJECT_ID} --location {REGION} --quiet"
]
}
],