|
174 | 174 | "if BUCKET_URI is None or BUCKET_URI.strip() == \"\" or BUCKET_URI == \"gs://\":\n", |
175 | 175 | " BUCKET_URI = f\"gs://{PROJECT_ID}-tmp-{now}-{str(uuid.uuid4())[:4]}\"\n", |
176 | 176 | " BUCKET_NAME = \"/\".join(BUCKET_URI.split(\"/\")[:3])\n", |
177 | | - " ! gcloud storage buckets create --location {REGION} {BUCKET_URI}\n", |
| 177 | + " ! gsutil mb -l {REGION} {BUCKET_URI}\n", |
178 | 178 | "else:\n", |
179 | 179 | " assert BUCKET_URI.startswith(\"gs://\"), \"BUCKET_URI must start with `gs://`.\"\n", |
180 | | - " shell_output = ! gcloud storage ls --full --buckets {BUCKET_NAME} | grep \"Location Constraint:\" | sed \"s/Location Constraint://\"\n", |
| 180 | + " shell_output = ! gsutil ls -Lb {BUCKET_NAME} | grep \"Location constraint:\" | sed \"s/Location constraint://\"\n", |
181 | 181 | " bucket_region = shell_output[0].strip().lower()\n", |
182 | 182 | " if bucket_region != REGION:\n", |
183 | 183 | " raise ValueError(\n", |
|
202 | 202 | "\n", |
203 | 203 | "\n", |
204 | 204 | "# Provision permissions to the SERVICE_ACCOUNT with the GCS bucket\n", |
205 | | - "! gcloud storage buckets add-iam-policy-binding $BUCKET_NAME --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.admin\n", |
| 205 | + "! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.admin $BUCKET_NAME\n", |
206 | 206 | "\n", |
207 | 207 | "! gcloud config set project $PROJECT_ID\n", |
208 | 208 | "! gcloud projects add-iam-policy-binding --no-user-output-enabled {PROJECT_ID} --member=serviceAccount:{SERVICE_ACCOUNT} --role=\"roles/storage.admin\"\n", |
|
236 | 236 | "# https://cloud.google.com/vertex-ai/docs/predictions/configure-compute.\n", |
237 | 237 | "\n", |
238 | 238 | "# @markdown L4 GPUs are good serving solutions and are more cost effective than V100s for 8x7B models. The 8x22B models only works with A100/H100 GPUs now.\n", |
239 | | - "accelerator_type = (\n", |
240 | | - " \"NVIDIA_L4\" # @param [\"NVIDIA_L4\", \"NVIDIA_TESLA_V100\", \"NVIDIA_H100_80GB\"]\n", |
241 | | - ")\n", |
| 239 | + "accelerator_type = \"NVIDIA_L4\" # @param [\"NVIDIA_L4\", \"NVIDIA_TESLA_V100\", \"NVIDIA_H100_80GB\"]\n", |
242 | 240 | "\n", |
243 | 241 | "if accelerator_type == \"NVIDIA_L4\":\n", |
244 | 242 | " machine_type = \"g2-standard-96\"\n", |
|
828 | 826 | "\n", |
829 | 827 | "delete_bucket = False # @param {type:\"boolean\"}\n", |
830 | 828 | "if delete_bucket:\n", |
831 | | - " ! gcloud storage rm --recursive $BUCKET_NAME" |
| 829 | + " ! gsutil -m rm -r $BUCKET_NAME" |
832 | 830 | ] |
833 | 831 | } |
834 | 832 | ], |
|
0 commit comments