Migrate gsutil usage to gcloud storage (#4324)

This commit is contained in:
Margubur Rahman
2025-12-19 15:11:28 +00:00
committed by GitHub
parent e604a4d43e
commit 5efa51206f
2 changed files with 7 additions and 14 deletions
@@ -554,8 +554,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l $REGION $BUCKET_URI"
]
"! gcloud storage buckets create --location=$REGION $BUCKET_URI" ]
},
{
"cell_type": "markdown",
@@ -574,8 +573,7 @@
},
"outputs": [],
"source": [
"! gsutil ls -al $BUCKET_URI"
]
"! gcloud storage ls --all-versions --long $BUCKET_URI" ]
},
{
"cell_type": "markdown",
@@ -1046,8 +1044,7 @@
"with open(\"schema.yaml\", \"w\") as f:\n",
" f.write(yaml)\n",
"\n",
"! gsutil cp schema.yaml {BUCKET_URI}/schema.yaml"
]
"! gcloud storage cp schema.yaml {BUCKET_URI}/schema.yaml" ]
},
{
"cell_type": "markdown",
@@ -1460,8 +1457,7 @@
"delete_bucket = False\n",
"\n",
"if delete_bucket or os.getenv(\"IS_TESTING\"):\n",
" ! gsutil rm -rf {BUCKET_URI}\n",
"\n",
" ! gcloud storage rm --recursive --continue-on-error {BUCKET_URI}\n", "\n",
"! rm -f schema.yaml\n",
"\n",
"! bq rm -f {PROJECT_ID}.model_deployment_monitoring_{ENDPOINT_ID}"
@@ -329,8 +329,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l {LOCATION} -p {PROJECT_ID} {BUCKET_URI}"
]
"! gcloud storage buckets create --location={LOCATION} --project={PROJECT_ID} {BUCKET_URI}" ]
},
{
"cell_type": "markdown",
@@ -1341,8 +1340,7 @@
"with open(\"schema.yaml\", \"w\") as f:\n",
" f.write(yaml)\n",
"\n",
"! gsutil cp schema.yaml {BUCKET_URI}/schema.yaml"
]
"! gcloud storage cp schema.yaml {BUCKET_URI}/schema.yaml" ]
},
{
"cell_type": "markdown",
@@ -1440,8 +1438,7 @@
"# Delete the Cloud Storage bucket\n",
"delete_bucket = True\n",
"if delete_bucket:\n",
" ! gsutil rm -rf {BUCKET_URI}\n",
"\n",
" ! gcloud storage rm --recursive --continue-on-error {BUCKET_URI}\n", "\n",
"# Delete the schema file\n",
"! rm -f schema.yaml\n",
"\n",