Compare commits

...
Author SHA1 Message Date
Andrew FerlitschandGitHub c942fe3777 fix: import os 2023-06-26 11:52:48 -07:00
Andrew Ferlitsch 8273ab7b51 fix: AR 2023-06-26 18:38:05 +00:00
Andrew Ferlitsch ca4f5564c4 fix: install dbdtypes 2023-06-26 18:10:37 +00:00
@@ -159,7 +159,8 @@
"! pip3 install scikit-learn==1.0 \\\n",
" pandas \\\n",
" joblib==1.2.0 \\\n",
" numpy==1.23.3 -q"
" numpy==1.23.3 \\\n",
" db-dtypes -q"
]
},
{
@@ -348,7 +349,7 @@
},
"outputs": [],
"source": [
"BUCKET_URI = \"gs://your-bucket-name-unique\" # @param {type:\"string\"}"
"BUCKET_URI = f\"gs://your-bucket-name-{PROJECT_ID}-unique\" # @param {type:\"string\"}"
]
},
{
@@ -368,7 +369,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l $REGION -p $PROJECT_ID $BUCKET_URI"
"! gsutil mb -l {REGION} -p {PROJECT_ID} {BUCKET_URI}"
]
},
{
@@ -452,6 +453,7 @@
},
"outputs": [],
"source": [
"import os\n",
"import joblib\n",
"import kfp\n",
"import matplotlib.pyplot as plt\n",
@@ -572,7 +574,7 @@
"BATCH_SAMPLE_SIZE = 3000\n",
"\n",
"# Set the name for your repository in artifact registry\n",
"REPOSITORY = \"sklearn-income-prediction-repo-unique\" # @param {type:\"string\"}\n",
"REPOSITORY = \"my-docker-repo-unique\" # @param {type:\"string\"}\n",
"\n",
"# Set the name for your prediction image in artifact registry\n",
"IMAGE = \"sklearn-fastapi-server\"\n",
@@ -1035,13 +1037,41 @@
"RUN pip install -r requirements.txt"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "gar_enable_api"
},
"source": [
"### Enable Artifact Registry API\n",
"\n",
"You must enable the Artifact Registry API service for your project.\n",
"\n",
"Learn more about [Enabling service](https://cloud.google.com/artifact-registry/docs/enable-service)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "gar_enable_api"
},
"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": {
"id": "62a376d0edee"
},
"source": [
"#### Create a repository\n",
"### Create a repository\n",
"\n",
"To store your container image, create a repository in the Artifact Registry."
]