Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions notebooks/community/vision/video_warehouse_sdk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@
},
"outputs": [],
"source": [
"!gsutil cp gs://visionai-artifacts/visionai-0.0.6-py3-none-any.whl .\n",
"!pip install visionai-0.0.6-py3-none-any.whl --force-reinstall"
"! gcloud storage cp gs://visionai-artifacts/visionai-0.0.6-py3-none-any.whl .\n",
"! pip install visionai-0.0.6-py3-none-any.whl --force-reinstall"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l $LOCATION -p $PROJECT_ID $BUCKET_URI"
"! gcloud storage buckets create --location $LOCATION --project $PROJECT_ID $BUCKET_URI"
]
},
{
Expand Down Expand Up @@ -770,7 +770,7 @@
"delete_bucket = False # Set True for deletion\n",
"\n",
"if delete_bucket:\n",
" ! gsutil rm -rf {BUCKET_URI}"
" ! gcloud storage rm --recursive --continue-on-error {BUCKET_URI}"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l $LOCATION -p $PROJECT_ID $BUCKET_URI"
"! gcloud storage buckets create --location $LOCATION --project $PROJECT_ID $BUCKET_URI"
]
},
{
Expand Down Expand Up @@ -430,9 +430,9 @@
},
"outputs": [],
"source": [
"! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.objectCreator $BUCKET_URI\n",
"! gcloud storage buckets add-iam-policy-binding $BUCKET_URI --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.objectCreator\n",
"\n",
"! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.objectViewer $BUCKET_URI"
"! gcloud storage buckets add-iam-policy-binding $BUCKET_URI --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.objectViewer"
]
},
{
Expand Down Expand Up @@ -482,7 +482,7 @@
"SOURCE_DATA_URL = \"gs://cloud-samples-data/vertex-ai/dataset-management/datasets/uci_glass_preprocessed/glass.csv\"\n",
"DESTINATION_DATA_URL = f\"{BUCKET_URI}/data/glass.csv\"\n",
"\n",
"! gsutil cp $SOURCE_DATA_URL $DESTINATION_DATA_URL"
"! gcloud storage cp $SOURCE_DATA_URL $DESTINATION_DATA_URL"
]
},
{
Expand Down Expand Up @@ -807,7 +807,7 @@
"\n",
"# Delete Cloud Storage objects that were created\n",
"if delete_bucket or os.getenv(\"IS_TESTING\"):\n",
" ! gsutil -m rm -r $BUCKET_URI"
" ! gcloud storage rm --recursive $BUCKET_URI"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l $LOCATION -p $PROJECT_ID $BUCKET_URI"
"! gcloud storage buckets create --location=$LOCATION --project=$PROJECT_ID $BUCKET_URI"
]
},
{
Expand Down Expand Up @@ -371,13 +371,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",
Expand Down Expand Up @@ -580,14 +580,14 @@
},
"outputs": [],
"source": [
"! gsutil cat $IMPORT_FILE | head -n 1 > tmp.csv\n",
"! gsutil cat $IMPORT_FILE | tail -n 10 >> tmp.csv\n",
"! gcloud storage cat $IMPORT_FILE | head -n 1 > tmp.csv\n",
"! gcloud storage cat $IMPORT_FILE | tail -n 10 >> tmp.csv\n",
"\n",
"! cut -d, -f1-16 tmp.csv > batch.csv\n",
"\n",
"gcs_input_uri = BUCKET_URI + \"/test.csv\"\n",
"\n",
"! gsutil cp batch.csv $gcs_input_uri"
"! gcloud storage cp batch.csv $gcs_input_uri"
]
},
{
Expand Down Expand Up @@ -729,7 +729,7 @@
"delete_bucket = False\n",
"\n",
"if delete_bucket:\n",
" ! gsutil rm -r $BUCKET_URI\n",
" ! gcloud storage rm --recursive $BUCKET_URI\n",
"\n",
"# Delete the locally generated files\n",
"! rm batch.csv tmp.csv"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l $LOCATION -p $PROJECT_ID $BUCKET_URI"
"! gcloud storage buckets create --location=$LOCATION --project=$PROJECT_ID $BUCKET_URI"
]
},
{
Expand Down Expand Up @@ -405,9 +405,9 @@
},
"outputs": [],
"source": [
"! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.objectCreator $BUCKET_URI\n",
"! gcloud storage buckets add-iam-policy-binding $BUCKET_URI --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.objectCreator\n",
"\n",
"! gsutil iam ch serviceAccount:{SERVICE_ACCOUNT}:roles/storage.objectViewer $BUCKET_URI"
"! gcloud storage buckets add-iam-policy-binding $BUCKET_URI --member=serviceAccount:{SERVICE_ACCOUNT} --role=roles/storage.objectViewer"
]
},
{
Expand Down Expand Up @@ -506,7 +506,9 @@
},
"outputs": [],
"source": [
"hp_dict: str = '{\"num_hidden_layers\": 3, \"hidden_size\": 32, \"learning_rate\": 0.01, \"epochs\": 1, \"steps_per_epoch\": -1}'\n",
"hp_dict: str = (\n",
" '{\"num_hidden_layers\": 3, \"hidden_size\": 32, \"learning_rate\": 0.01, \"epochs\": 1, \"steps_per_epoch\": -1}'\n",
")\n",
"data_dir: str = (\n",
" \"gs://cloud-samples-data/vertex-ai/pipeline-deployment/datasets/bikes_weather/\"\n",
")\n",
Expand Down Expand Up @@ -732,7 +734,7 @@
"source": [
"delete_bucket = False\n",
"if delete_bucket:\n",
" ! gsutil rm -r $BUCKET_URI"
" ! gcloud storage rm --recursive $BUCKET_URI"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l {LOCATION} -p {PROJECT_ID} {BUCKET_URI}"
"! gcloud storage buckets create --location={LOCATION} --project={PROJECT_ID} {BUCKET_URI}"
]
},
{
Expand Down Expand Up @@ -545,9 +545,9 @@
"source": [
"MODEL_URI = f\"{BUCKET_URI}/{model_name}\"\n",
"\n",
"!gsutil rm -r $MODEL_URI\n",
"!gsutil cp -r $model_path $MODEL_URI\n",
"!gsutil ls -al $MODEL_URI"
"!gcloud storage rm --recursive $MODEL_URI\n",
"!gcloud storage cp --recursive $model_path $MODEL_URI\n",
"!gcloud storage ls --all-versions --long $MODEL_URI"
]
},
{
Expand Down Expand Up @@ -823,7 +823,7 @@
"\n",
"delete_bucket = False\n",
"if delete_bucket:\n",
" ! gsutil -m rm -r $BUCKET_URI"
" ! gcloud storage rm --recursive $BUCKET_URI"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l {LOCATION} {BUCKET_URI}"
"! gcloud storage buckets create --location={LOCATION} {BUCKET_URI}"
]
},
{
Expand Down Expand Up @@ -692,15 +692,15 @@
},
"outputs": [],
"source": [
"# Set this to true only if you'd like to delete your bucket\n",
"# Set this to true only if you'd like to delete your bucket.\n",
"delete_bucket = False\n",
"\n",
"hp_job.delete()\n",
"\n",
"!gcloud container images delete $IMAGE_URI --force-delete-tags --quiet\n",
"\n",
"if delete_bucket:\n",
" ! gsutil rm -r $BUCKET_URI"
" ! gcloud storage rm --recursive $BUCKET_URI"
]
}
],
Expand Down