|
84 | 84 | " print(response['serviceAccount'])\")\n", |
85 | 85 | "\n", |
86 | 86 | "echo \"Authorizing the Cloud ML Service account $SVC_ACCOUNT to access files in $BUCKET\"\n", |
87 | | - "gsutil -m defacl ch -u $SVC_ACCOUNT:R gs://$BUCKET\n", |
88 | | - "gsutil -m acl ch -u $SVC_ACCOUNT:R -r gs://$BUCKET # error message (if bucket is empty) can be ignored\n", |
89 | | - "gsutil -m acl ch -u $SVC_ACCOUNT:W gs://$BUCKET" |
| 87 | + "gcloud storage buckets update --add-default-object-acl-grant entity=user-$SVC_ACCOUNT,role=READER gs://$BUCKET\n", |
| 88 | + "gcloud storage objects update --add-acl-grant entity=user-$SVC_ACCOUNT,role=READER --recursive gs://$BUCKET # error message (if bucket is empty) can be ignored\n", |
| 89 | + "gcloud storage buckets update --add-acl-grant entity=user-$SVC_ACCOUNT,role=WRITER gs://$BUCKET", |
90 | 90 | ] |
91 | 91 | }, |
92 | 92 | { |
|
271 | 271 | "source": [ |
272 | 272 | "%%bash\n", |
273 | 273 | "echo $BUCKET\n", |
274 | | - "gsutil -m rm -rf gs://${BUCKET}/taxifare/smallinput/\n", |
275 | | - "gsutil -m cp ${PWD}/*.csv gs://${BUCKET}/taxifare/smallinput/" |
| 274 | + "gcloud storage rm --recursive --continue-on-error gs://${BUCKET}/taxifare/smallinput/\n", |
| 275 | + "gcloud storage cp ${PWD}/*.csv gs://${BUCKET}/taxifare/smallinput/" |
276 | 276 | ] |
277 | 277 | }, |
278 | 278 | { |
|
285 | 285 | "OUTDIR=gs://${BUCKET}/taxifare/smallinput/taxi_trained\n", |
286 | 286 | "JOBNAME=lab3a_$(date -u +%y%m%d_%H%M%S)\n", |
287 | 287 | "echo $OUTDIR $REGION $JOBNAME\n", |
288 | | - "gsutil -m rm -rf $OUTDIR\n", |
| 288 | + "gcloud storage rm --recursive --continue-on-error $OUTDIR\n", |
289 | 289 | "gcloud ai-platform jobs submit training $JOBNAME \\\n", |
290 | 290 | " --region=$REGION \\\n", |
291 | 291 | " --module-name=trainer.task \\\n", |
|
327 | 327 | "outputs": [], |
328 | 328 | "source": [ |
329 | 329 | "%%bash\n", |
330 | | - "gsutil cp -r ${PWD}/taxi_trained gs://${BUCKET}/taxifare/smallinput/ \n", |
331 | | - "gsutil ls gs://${BUCKET}/taxifare/smallinput/taxi_trained/export/exporter" |
| 330 | + "gcloud storage cp --recursive ${PWD}/taxi_trained gs://${BUCKET}/taxifare/smallinput/ \n", |
| 331 | + "gcloud storage ls gs://${BUCKET}/taxifare/smallinput/taxi_trained/export/exporter" |
332 | 332 | ] |
333 | 333 | }, |
334 | 334 | { |
|
340 | 340 | "%%bash\n", |
341 | 341 | "MODEL_NAME=\"taxifare\"\n", |
342 | 342 | "MODEL_VERSION=\"v1\"\n", |
343 | | - "MODEL_LOCATION=$(gsutil ls gs://${BUCKET}/taxifare/smallinput/taxi_trained/export/exporter | tail -1)\n", |
| 343 | + "MODEL_LOCATION=$(gcloud storage ls gs://${BUCKET}/taxifare/smallinput/taxi_trained/export/exporter | tail -1)\n", |
344 | 344 | "echo \"Run these commands one-by-one (the very first time, you'll create a model and then create a version)\"\n", |
345 | 345 | "#gcloud ai-platform versions delete ${MODEL_VERSION} --model ${MODEL_NAME}\n", |
346 | 346 | "#gcloud ai-platform models delete ${MODEL_NAME}\n", |
|
463 | 463 | "JOBNAME=lab3a_$(date -u +%y%m%d_%H%M%S)\n", |
464 | 464 | "CRS_BUCKET=cloud-training-demos # use the already exported data\n", |
465 | 465 | "echo $OUTDIR $REGION $JOBNAME\n", |
466 | | - "gsutil -m rm -rf $OUTDIR\n", |
| 466 | + "gcloud storage rm --recursive --continue-on-error $OUTDIR\n", |
467 | 467 | "gcloud ai-platform jobs submit training $JOBNAME \\\n", |
468 | 468 | " --region=$REGION \\\n", |
469 | 469 | " --module-name=trainer.task \\\n", |
|
0 commit comments