mirror of
https://github.com/GoogleCloudPlatform/vertex-ai-samples.git
synced 2026-09-26 14:42:04 +00:00
Migrate gsutil usage to gcloud storage (#4324)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user