diff --git a/notebooks/community/ml_ops/stage1/get_started_with_data_labeling.ipynb b/notebooks/community/ml_ops/stage1/get_started_with_data_labeling.ipynb index 06c681bc3..82cb0aaff 100644 --- a/notebooks/community/ml_ops/stage1/get_started_with_data_labeling.ipynb +++ b/notebooks/community/ml_ops/stage1/get_started_with_data_labeling.ipynb @@ -491,7 +491,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -l $REGION $BUCKET_URI" + "! gcloud storage buckets create --location=$REGION $BUCKET_URI" ] }, { @@ -511,7 +511,7 @@ }, "outputs": [], "source": [ - "! gsutil ls -al $BUCKET_URI" + "! gcloud storage ls --all-versions --long $BUCKET_URI" ] }, { @@ -715,7 +715,7 @@ "print(IMPORT_FILE)\n", "\n", "# printing content of uploaded file\n", - "! gsutil cat $IMPORT_FILE" + "! gcloud storage cat $IMPORT_FILE" ] }, { @@ -838,7 +838,7 @@ "outputs": [], "source": [ "# create placeholder file for instructions for data labeling\n", - "! echo \"this is instruction\" >> instruction.txt | gsutil cp instruction.txt $BUCKET_URI" + "! echo \"this is instruction\" >> instruction.txt | gcloud storage cp instruction.txt $BUCKET_URI" ] }, { @@ -995,7 +995,7 @@ "\n", "# Delete the bucket created\n", "if delete_bucket or os.getenv(\"IS_TESTING\"):\n", - " ! gsutil rm -r $BUCKET_URI" + " ! gcloud storage rm --recursive $BUCKET_URI" ] } ], diff --git a/notebooks/community/ml_ops/stage2/get_started_with_cmek_training.ipynb b/notebooks/community/ml_ops/stage2/get_started_with_cmek_training.ipynb index fe85b853e..46e730f63 100644 --- a/notebooks/community/ml_ops/stage2/get_started_with_cmek_training.ipynb +++ b/notebooks/community/ml_ops/stage2/get_started_with_cmek_training.ipynb @@ -449,7 +449,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -l $REGION $BUCKET_URI" + "! gcloud storage buckets create --location=$REGION $BUCKET_URI" ] }, { @@ -469,7 +469,7 @@ }, "outputs": [], "source": [ - "! gsutil ls -al $BUCKET_URI" + "! gcloud storage ls --all-versions --long $BUCKET_URI" ] }, { @@ -926,7 +926,7 @@ }, "outputs": [], "source": [ - "test_item = !gsutil cat $IMPORT_FILE | head -n1\n", + "test_item = !gcloud storage cat $IMPORT_FILE | head -n1\n", "test_item, test_label = str(test_item[0]).split(\",\")\n", "\n", "print(test_item, test_label)" @@ -1015,7 +1015,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" ] }, { diff --git a/notebooks/community/sdk/sdk_automl_image_classification_online.ipynb b/notebooks/community/sdk/sdk_automl_image_classification_online.ipynb index 5cf707a0f..b2f956db9 100644 --- a/notebooks/community/sdk/sdk_automl_image_classification_online.ipynb +++ b/notebooks/community/sdk/sdk_automl_image_classification_online.ipynb @@ -473,7 +473,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -l $REGION $BUCKET_NAME" + "! gcloud storage buckets create --location=$REGION $BUCKET_NAME" ] }, { @@ -493,7 +493,7 @@ }, "outputs": [], "source": [ - "! gsutil ls -al $BUCKET_NAME" + "! gcloud storage ls --all-versions --long $BUCKET_NAME" ] }, { @@ -602,11 +602,11 @@ "else:\n", " FILE = IMPORT_FILE\n", "\n", - "count = ! gsutil cat $FILE | wc -l\n", + "count = ! gcloud storage cat $FILE | wc -l\n", "print(\"Number of Examples\", int(count[0]))\n", "\n", "print(\"First 10 rows\")\n", - "! gsutil cat $FILE | head" + "! gcloud storage cat $FILE | head" ] }, { @@ -821,7 +821,7 @@ }, "outputs": [], "source": [ - "test_item = !gsutil cat $IMPORT_FILE | head -n1\n", + "test_item = !gcloud storage cat $IMPORT_FILE | head -n1\n", "if len(str(test_item[0]).split(\",\")) == 3:\n", " _, test_item, test_label = str(test_item[0]).split(\",\")\n", "else:\n", @@ -990,7 +990,7 @@ " print(e)\n", "\n", " if \"BUCKET_NAME\" in globals():\n", - " ! gsutil rm -r $BUCKET_NAME" + " ! gcloud storage rm --recursive $BUCKET_NAME" ] } ], diff --git a/notebooks/community/sdk/sdk_automl_tabular_binary_classification_online.ipynb b/notebooks/community/sdk/sdk_automl_tabular_binary_classification_online.ipynb index 158509aae..e1b0dc37f 100644 --- a/notebooks/community/sdk/sdk_automl_tabular_binary_classification_online.ipynb +++ b/notebooks/community/sdk/sdk_automl_tabular_binary_classification_online.ipynb @@ -473,7 +473,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -l $REGION $BUCKET_NAME" + "! gcloud storage buckets create --location=$REGION $BUCKET_NAME" ] }, { @@ -493,7 +493,7 @@ }, "outputs": [], "source": [ - "! gsutil ls -al $BUCKET_NAME" + "! gcloud storage ls --all-versions --long $BUCKET_NAME" ] }, { @@ -597,13 +597,13 @@ }, "outputs": [], "source": [ - "count = ! gsutil cat $IMPORT_FILE | wc -l\n", + "count = ! gcloud storage cat $IMPORT_FILE | wc -l\n", "print(\"Number of Examples\", int(count[0]))\n", "\n", "print(\"First 10 rows\")\n", - "! gsutil cat $IMPORT_FILE | head\n", + "! gcloud storage cat $IMPORT_FILE | head\n", "\n", - "heading = ! gsutil cat $IMPORT_FILE | head -n1\n", + "heading = ! gcloud storage cat $IMPORT_FILE | head -n1\n", "label_column = str(heading).split(\",\")[-1].split(\"'\")[0]\n", "print(\"Label Column Name\", label_column)\n", "if label_column is None:\n", @@ -996,7 +996,7 @@ " print(e)\n", "\n", " if \"BUCKET_NAME\" in globals():\n", - " ! gsutil rm -r $BUCKET_NAME" + " ! gcloud storage rm --recursive $BUCKET_NAME" ] } ], diff --git a/notebooks/community/vertex_endpoints/find_ideal_machine_type/find_ideal_machine_type.ipynb b/notebooks/community/vertex_endpoints/find_ideal_machine_type/find_ideal_machine_type.ipynb index 30e080f64..ca95aa23f 100644 --- a/notebooks/community/vertex_endpoints/find_ideal_machine_type/find_ideal_machine_type.ipynb +++ b/notebooks/community/vertex_endpoints/find_ideal_machine_type/find_ideal_machine_type.ipynb @@ -355,7 +355,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -p $PROJECT_ID -l $REGION $BUCKET_NAME" + "! gcloud storage buckets create --project=$PROJECT_ID --location=$REGION $BUCKET_NAME" ] }, { @@ -375,7 +375,7 @@ }, "outputs": [], "source": [ - "! gsutil ls -al $BUCKET_NAME" + "! gcloud storage ls --all-versions --long $BUCKET_NAME" ] }, { @@ -596,7 +596,7 @@ }, "outputs": [], "source": [ - "!sudo gsutil cp -r ./bert_sentence_embedding/00001/* $GCS_URI/1/" + "!sudo gcloud storage cp --recursive ./bert_sentence_embedding/00001/* $GCS_URI/1/" ] }, { @@ -1045,7 +1045,7 @@ }, "outputs": [], "source": [ - "!gsutil rm -r $GCS_URI/*" + "!gcloud storage rm --recursive $GCS_URI/*" ] }, { diff --git a/notebooks/official/custom/custom-tabular-bq-managed-dataset.ipynb b/notebooks/official/custom/custom-tabular-bq-managed-dataset.ipynb index 1122bdfcd..83ff7253f 100644 --- a/notebooks/official/custom/custom-tabular-bq-managed-dataset.ipynb +++ b/notebooks/official/custom/custom-tabular-bq-managed-dataset.ipynb @@ -291,7 +291,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -l $LOCATION -p $PROJECT_ID $BUCKET_URI" + "! gcloud storage buckets create --location=$LOCATION --project=$PROJECT_ID $BUCKET_URI" ] }, { @@ -911,7 +911,7 @@ "delete_bucket = True\n", "\n", "if delete_bucket:\n", - " ! gsutil rm -r $BUCKET_URI" + " ! gcloud storage rm --recursive $BUCKET_URI" ] } ], diff --git a/notebooks/official/custom/custom_training_container_and_model_registry.ipynb b/notebooks/official/custom/custom_training_container_and_model_registry.ipynb index 6f9c44176..633938829 100644 --- a/notebooks/official/custom/custom_training_container_and_model_registry.ipynb +++ b/notebooks/official/custom/custom_training_container_and_model_registry.ipynb @@ -283,7 +283,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -l $LOCATION -p $PROJECT_ID $BUCKET_URI" + "! gcloud storage buckets create --location=$LOCATION --project=$PROJECT_ID $BUCKET_URI" ] }, { @@ -932,7 +932,7 @@ "# Delete the Cloud Storage bucket\n", "delete_bucket = True\n", "if delete_bucket:\n", - " ! gsutil -m rm -r $BUCKET_URI\n", + " ! gcloud storage rm --recursive $BUCKET_URI\n", "\n", "# Delete application directory\n", "!rm -rf $APPLICATION_DIR" diff --git a/notebooks/official/model_registry/get_started_with_model_registry.ipynb b/notebooks/official/model_registry/get_started_with_model_registry.ipynb index 06e3ad3d8..8aefc922f 100644 --- a/notebooks/official/model_registry/get_started_with_model_registry.ipynb +++ b/notebooks/official/model_registry/get_started_with_model_registry.ipynb @@ -303,7 +303,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -l $LOCATION $BUCKET_URI" + "! gcloud storage buckets create --location=$LOCATION $BUCKET_URI" ] }, { @@ -996,7 +996,7 @@ "delete_bucket = False\n", "\n", "if delete_bucket:\n", - " ! gsutil rm -rf {BUCKET_URI}\n", + " ! gcloud storage rm --recursive --continue-on-error {BUCKET_URI}\n", "\n", "# Undeploy the models and delete the endpoint resources\n", "try:\n", diff --git a/notebooks/official/reduction_server/pytorch_distributed_training_reduction_server.ipynb b/notebooks/official/reduction_server/pytorch_distributed_training_reduction_server.ipynb index 7fe5ee5d0..836fab426 100644 --- a/notebooks/official/reduction_server/pytorch_distributed_training_reduction_server.ipynb +++ b/notebooks/official/reduction_server/pytorch_distributed_training_reduction_server.ipynb @@ -291,7 +291,7 @@ }, "outputs": [], "source": [ - "! gsutil mb -l {LOCATION} -p {PROJECT_ID} {BUCKET_URI}" + "! gcloud storage buckets create --location={LOCATION} --project={PROJECT_ID} {BUCKET_URI}" ] }, { @@ -720,9 +720,9 @@ "source": [ "! cd {PYTHON_PACKAGE_APPLICATION_DIR} && python3 setup.py sdist --formats=gztar\n", "\n", - "! gsutil cp {source_package_file_name} {python_package_gcs_uri}\n", + "! gcloud storage cp {source_package_file_name} {python_package_gcs_uri}\n", "\n", - "! gsutil ls -l {python_package_gcs_uri}" + "! gcloud storage ls --long {python_package_gcs_uri}" ] }, { @@ -933,7 +933,7 @@ " print(e)\n", "\n", "if delete_bucket or os.getenv(\"IS_TESTING\"):\n", - " ! gsutil rm -r $BUCKET_URI" + " ! gcloud storage rm --recursive $BUCKET_URI" ] } ],