From 4314f5192a887f390cc6666ffc10400071fc9126 Mon Sep 17 00:00:00 2001 From: bhandarivijay Date: Fri, 9 Jan 2026 09:15:54 +0000 Subject: [PATCH] Migrate gsutil usage to gcloud storage --- ...ing and prediction with scikit-learn.ipynb | 6 +++--- .../storage/Storage command-line tool.ipynb | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/notebooks/tutorials/cloud-ml-engine/Training and prediction with scikit-learn.ipynb b/notebooks/tutorials/cloud-ml-engine/Training and prediction with scikit-learn.ipynb index 4db540c6ae1..d805d0cb1fe 100644 --- a/notebooks/tutorials/cloud-ml-engine/Training and prediction with scikit-learn.ipynb +++ b/notebooks/tutorials/cloud-ml-engine/Training and prediction with scikit-learn.ipynb @@ -76,7 +76,7 @@ "metadata": {}, "outputs": [], "source": [ - "!gsutil mb gs://$BUCKET_NAME/" + "!gcloud storage buckets create gs://$BUCKET_NAME" ] }, { @@ -377,7 +377,7 @@ "metadata": {}, "outputs": [], "source": [ - "!gsutil ls gs://$BUCKET_NAME/" + "!gcloud storage ls gs://$BUCKET_NAME/" ] }, { @@ -539,7 +539,7 @@ "!gcloud ai-platform models delete $MODEL_NAME --quiet\n", "\n", "# Delete the bucket and contents\n", - "!gsutil rm -r gs://$BUCKET_NAME\n", + "!gcloud storage rm --recursive gs://$BUCKET_NAME\n", "\n", "# Delete the local files created by the tutorial\n", "!rm -rf census_training" diff --git a/notebooks/tutorials/storage/Storage command-line tool.ipynb b/notebooks/tutorials/storage/Storage command-line tool.ipynb index 21e62ae8236..eef0054c790 100644 --- a/notebooks/tutorials/storage/Storage command-line tool.ipynb +++ b/notebooks/tutorials/storage/Storage command-line tool.ipynb @@ -26,6 +26,7 @@ }, "outputs": [], "source": [ + "# ERROR: A migration for this command is not implemented. Please refer to the migration guide.\n", "!gsutil help" ] }, @@ -67,7 +68,7 @@ "metadata": {}, "outputs": [], "source": [ - "!gsutil mb gs://{bucket_name}/" + "!gcloud storage buckets create gs://{bucket_name}/" ] }, { @@ -95,7 +96,7 @@ "metadata": {}, "outputs": [], "source": [ - "!gsutil ls -p $project_id" + "!gcloud storage ls --project $project_id" ] }, { @@ -128,7 +129,7 @@ }, "outputs": [], "source": [ - "!gsutil ls -L -b gs://{bucket_name}/" + "!gcloud storage ls --full --buckets gs://{bucket_name}/" ] }, { @@ -163,7 +164,7 @@ "metadata": {}, "outputs": [], "source": [ - "!gsutil cp resources/us-states.txt gs://{bucket_name}/" + "!gcloud storage cp resources/us-states.txt gs://{bucket_name}/" ] }, { @@ -181,7 +182,7 @@ }, "outputs": [], "source": [ - "!gsutil ls -r gs://{bucket_name}/**" + "!gcloud storage ls --recursive gs://{bucket_name}/**" ] }, { @@ -209,7 +210,7 @@ "metadata": {}, "outputs": [], "source": [ - "!gsutil ls -L gs://{bucket_name}/us-states.txt" + "!gcloud storage ls --full gs://{bucket_name}/us-states.txt" ] }, { @@ -245,7 +246,7 @@ }, "outputs": [], "source": [ - "!gsutil cp gs://{bucket_name}/us-states.txt resources/downloaded-us-states.txt" + "!gcloud storage cp gs://{bucket_name}/us-states.txt resources/downloaded-us-states.txt" ] }, { @@ -270,7 +271,7 @@ }, "outputs": [], "source": [ - "!gsutil rm gs://{bucket_name}/us-states.txt" + "!gcloud storage rm gs://{bucket_name}/us-states.txt" ] }, { @@ -288,7 +289,7 @@ "metadata": {}, "outputs": [], "source": [ - "!gsutil rm -r gs://{bucket_name}/" + "!gcloud storage rm --recursive gs://{bucket_name}/" ] }, {