-
Notifications
You must be signed in to change notification settings - Fork 2
Br 4321 removed changes for model garden #103
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -326,8 +326,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION gs://$BUCKET_NAME" | ||
| ] | ||
| "! gcloud storage buckets create --location=$REGION gs://$BUCKET_NAME" ] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -346,8 +345,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil ls -al gs://$BUCKET_NAME" | ||
| ] | ||
| "! gcloud storage ls --all-versions --long gs://$BUCKET_NAME" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -380,14 +378,11 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "import json\n", | ||
| "import os\n", | ||
| "import sys\n", | ||
| "import time\n", | ||
| "\n", | ||
| "from google.cloud import automl\n", | ||
| "from google.protobuf.json_format import MessageToJson\n", | ||
| "from google.protobuf.struct_pb2 import Value" | ||
| "from google.protobuf.json_format import MessageToJson\n" | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -476,8 +471,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil cat $IMPORT_FILE | head -n 10" | ||
| ] | ||
| "! gcloud storage cat $IMPORT_FILE | head -n 10" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1132,8 +1126,7 @@ | |
| " data = {\"id\": 0, \"text_snippet\": {\"content\": test_item}}\n", | ||
| " f.write(json.dumps(data) + \"\\n\")\n", | ||
| "\n", | ||
| "! gsutil cat $gcs_input_uri" | ||
| ] | ||
| "! gcloud storage cat $gcs_input_uri" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1280,9 +1273,7 @@ | |
| "source": [ | ||
| "destination_uri = output_config[\"gcs_destination\"][\"output_uri_prefix\"][:-1]\n", | ||
| "\n", | ||
| "! gsutil ls $destination_uri/*\n", | ||
| "! gsutil cat $destination_uri/prediction*/*.jsonl" | ||
| ] | ||
| "! gcloud storage ls $destination_uri/*\n", "! gcloud storage cat $destination_uri/prediction*/*.jsonl" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1614,8 +1605,7 @@ | |
| "\n", | ||
| "\n", | ||
| "if delete_bucket and \"BUCKET_NAME\" in globals():\n", | ||
| " ! gsutil rm -r gs://$BUCKET_NAME" | ||
| ] | ||
| " ! gcloud storage rm --recursive gs://$BUCKET_NAME" ] | ||
| } | ||
| ], | ||
| "metadata": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -511,8 +511,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage buckets create --location $REGION $BUCKET_URI" ] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -531,8 +530,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil ls -al $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage ls --all-versions --long $BUCKET_URI" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1147,8 +1145,7 @@ | |
| "! rm -f custom.tar custom.tar.gz\n", | ||
| "! tar cvf custom.tar custom\n", | ||
| "! gzip custom.tar\n", | ||
| "! gsutil cp custom.tar.gz $BUCKET_URI/trainer_example.tar.gz" | ||
| ] | ||
| "! gcloud storage cp custom.tar.gz $BUCKET_URI/trainer_example.tar.gz" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1357,8 +1354,7 @@ | |
| "delete_bucket = False\n", | ||
| "\n", | ||
| "if delete_bucket or os.getenv(\"IS_TESTING\"):\n", | ||
| " ! gsutil rm -r $BUCKET_URI" | ||
| ] | ||
| " ! gcloud storage rm --recursive $BUCKET_URI" ] | ||
| } | ||
| ], | ||
| "metadata": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -448,8 +448,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage buckets create --location=$REGION $BUCKET_URI" ] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -468,8 +467,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil ls -al $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage ls --all-versions --long $BUCKET_URI" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1132,8 +1130,7 @@ | |
| "! rm -f custom.tar custom.tar.gz\n", | ||
| "! tar cvf custom.tar custom\n", | ||
| "! gzip custom.tar\n", | ||
| "! gsutil cp custom.tar.gz $BUCKET_URI/trainer_cifar10.tar.gz" | ||
| ] | ||
| "! gcloud storage cp custom.tar.gz $BUCKET_URI/trainer_cifar10.tar.gz" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1381,8 +1378,7 @@ | |
| "delete_bucket = False\n", | ||
| "\n", | ||
| "if delete_bucket and \"BUCKET_URI\" in globals():\n", | ||
| " ! gsutil rm -r $BUCKET_URI" | ||
| ] | ||
| " ! gcloud storage rm --recursive $BUCKET_URI" ] | ||
| } | ||
| ], | ||
| "metadata": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -437,8 +437,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage buckets create --location $REGION $BUCKET_URI" ] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -457,8 +456,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil ls -al $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage ls --all-versions --long $BUCKET_URI" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1357,8 +1355,7 @@ | |
| "delete_bucket = True\n", | ||
| "\n", | ||
| "if delete_bucket or os.getenv(\"IS_TESTING\"):\n", | ||
| " ! gsutil rm -r $BUCKET_URI" | ||
| ] | ||
| " ! gcloud storage rm --recursive $BUCKET_URI" ] | ||
| } | ||
| ], | ||
| "metadata": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -484,8 +484,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $REGION $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage buckets create --location=$REGION $BUCKET_URI" ] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -504,8 +503,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil ls -al $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage ls --all-versions --long $BUCKET_URI" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -717,8 +715,7 @@ | |
| "with open(\"instance.yaml\", \"w\") as f:\n", | ||
| " f.write(yaml)\n", | ||
| "\n", | ||
| "! gsutil cp instance.yaml {BUCKET_URI}/instance.yaml" | ||
| ] | ||
| "! gcloud storage cp instance.yaml {BUCKET_URI}/instance.yaml" ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1274,30 +1271,25 @@ | |
| " + \"/evaluation_metrics\"\n", | ||
| " )\n", | ||
| " if tf.io.gfile.exists(EXECUTE_OUTPUT):\n", | ||
| " ! gsutil cat $EXECUTE_OUTPUT\n", | ||
| " return EXECUTE_OUTPUT\n", | ||
| " ! gcloud storage cat $EXECUTE_OUTPUT\n", " return EXECUTE_OUTPUT\n", | ||
| " elif tf.io.gfile.exists(GCP_RESOURCES):\n", | ||
| " ! gsutil cat $GCP_RESOURCES\n", | ||
| " return GCP_RESOURCES\n", | ||
| " ! gcloud storage cat $GCP_RESOURCES\n", " return GCP_RESOURCES\n", | ||
| " elif tf.io.gfile.exists(EVAL_METRICS):\n", | ||
| " ! gsutil cat $EVAL_METRICS\n", | ||
| " return EVAL_METRICS\n", | ||
| " ! gcloud storage cat $EVAL_METRICS\n", " return EVAL_METRICS\n", | ||
| "\n", | ||
| " return None\n", | ||
| "\n", | ||
| "\n", | ||
| "print(\"get-vertex-model\")\n", | ||
| "artifacts = print_pipeline_output(pipeline, \"get-vertex-model\")\n", | ||
| "print(\"\\n\\n\")\n", | ||
| "output = !gsutil cat $artifacts\n", | ||
| "output = json.loads(output[0])\n", | ||
| "output = !gcloud storage cat $artifacts\n", "output = json.loads(output[0])\n", | ||
| "model_id = output[\"artifacts\"][\"model\"][\"artifacts\"][0][\"metadata\"][\"resourceName\"]\n", | ||
| "print(\"\\n\\n\")\n", | ||
| "print(\"endpoint-create\")\n", | ||
| "artifacts = print_pipeline_output(pipeline, \"endpoint-create\")\n", | ||
| "print(\"\\n\\n\")\n", | ||
| "output = !gsutil cat $artifacts\n", | ||
| "output = json.loads(output[0])\n", | ||
| "output = !gcloud storage cat $artifacts\n", "output = json.loads(output[0])\n", | ||
| "endpoint_id = output[\"artifacts\"][\"endpoint\"][\"artifacts\"][0][\"metadata\"][\n", | ||
| " \"resourceName\"\n", | ||
| "]\n", | ||
|
|
@@ -1404,8 +1396,7 @@ | |
| "delete_bucket = True\n", | ||
| "\n", | ||
| "if delete_bucket or os.getenv(\"IS_TESTING\"):\n", | ||
| " ! gsutil rm -rf {BUCKET_URI}" | ||
| ] | ||
| " ! gcloud storage rm --recursive --continue-on-error {BUCKET_URI}" ] | ||
| } | ||
| ], | ||
| "metadata": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,8 +295,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil mb -l $LOCATION $BUCKET_URI" | ||
| ] | ||
| "! gcloud storage buckets create --location $LOCATION $BUCKET_URI" ] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
|
|
@@ -1203,7 +1202,7 @@ | |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "! gsutil cp gs://cloud-ml-data/img/flower_photos/daisy/100080576_f52e8ee070_n.jpg test.jpg\n", | ||
| "! gcloud storage cp gs://cloud-ml-data/img/flower_photos/daisy/100080576_f52e8ee070_n.jpg test.jpg\n", | ||
| "\n", | ||
| "import base64\n", | ||
| "\n", | ||
|
|
@@ -1311,8 +1310,7 @@ | |
| "delete_bucket = False\n", | ||
| "\n", | ||
| "if delete_bucket:\n", | ||
| " ! gsutil rm -r $BUCKET_URI\n", | ||
| "\n", | ||
| " ! gcloud storage rm --recursive $BUCKET_URI\n", "\n", | ||
| "# Undeploy the models\n", | ||
| "# When you're done doing predictions, you undeploy the model from the `Endpoint` resouce. \n", | ||
| "# This deprovisions all compute resources and ends billing for the deployed model.\n", | ||
|
|
||
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.
The
gcloud storage buckets createcommand has incorrect syntax. The bucket name should precede the flags.