Skip to content

Commit 4b1947b

Browse files
Merge pull request #3012 from googlyrahman/refactor-ai-migration-e8ef66d3acc241e3888d3424275d2c4d
Migrate gsutil usage to gcloud storage
2 parents 426cf32 + 27631e4 commit 4b1947b

File tree

10 files changed

+12
-15
lines changed

10 files changed

+12
-15
lines changed

courses/data_analysis/deepdive/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

2-
32
1. Download data:
4-
gsutil -m cp gs://cloud-training-demos/datasme/pubsub/actions.csv pubsub-exercises/data/actions.csv
3+
gcloud storage cp gs://cloud-training-demos/datasme/pubsub/actions.csv pubsub-exercises/data/actions.csv
54

65
2. PubSub exercises:
76
https://codelabs.developers.google.com/codelabs/datasme-pubsub-01
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
gsutil -m cp gs://cloud-bigtable-training/actions_subset.csv src/main/resources/actions_subset.csv
2+
gcloud storage cp gs://cloud-bigtable-training/actions_subset.csv src/main/resources/actions_subset.csv

courses/data_analysis/deepdive/composer-exercises/hello_world_solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"""
3131

3232
# Solution:
33-
# gsutil cp count.txt gs://{your-composer-bucket}/dags
33+
# gcloud storage cp count.txt gs://{your-composer-bucket}/dags
3434
with open('/home/airflow/gcs/dags/count.txt') as f:
3535
number_of_templated_tasks = int(f.read())
3636
for i in xrange(number_of_templated_tasks):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
gsutil -m cp gs://cloud-training-demos/datasme/pubsub/actions.csv data/actions.csv
2+
gcloud storage cp gs://cloud-training-demos/datasme/pubsub/actions.csv data/actions.csv

quests/sparktobq/04_bigquery.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"# Catch-up cell. Run if you did not do previous notebooks of this sequence\n",
3030
"!wget http://kdd.ics.uci.edu/databases/kddcup99/kddcup.data_10_percent.gz\n",
3131
"BUCKET='cloud-training-demos-ml' # CHANGE\n",
32-
"!gsutil cp kdd* gs://$BUCKET/"
32+
"!gcloud storage cp kdd* gs://$BUCKET/"
3333
]
3434
},
3535
{

quests/sparktobq/05_functions_dw.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"wget http://kdd.ics.uci.edu/databases/kddcup99/kddcup.data_10_percent.gz\n",
3131
"gunzip kddcup.data_10_percent.gz\n",
3232
"BUCKET='cloud-training-demos-ml' # CHANGE\n",
33-
"gsutil cp kdd* gs://$BUCKET/\n",
33+
"gcloud storage cp kdd* gs://$BUCKET/\n",
3434
"bq mk sparktobq"
3535
]
3636
},
@@ -234,7 +234,7 @@
234234
"metadata": {},
235235
"outputs": [],
236236
"source": [
237-
"!gsutil cp kddcup.data_10_percent gs://$BUCKET/"
237+
"!gcloud storage cp kddcup.data_10_percent gs://$BUCKET/"
238238
]
239239
},
240240
{
@@ -252,7 +252,7 @@
252252
"metadata": {},
253253
"outputs": [],
254254
"source": [
255-
"!gsutil ls gs://$BUCKET/sparktobq"
255+
"!gcloud storage ls gs://$BUCKET/sparktobq"
256256
]
257257
},
258258
{

quests/sparktobq/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@
5555
### Part 5
5656
* On the same AI Platform Notebooks instance as Part 4, open and run ```05_functions.ipynb```
5757
* Delete the Notebooks instance
58-

quests/sparktobq/copy_from_gcs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
BUCKET=cloud-training-demos-ml # CHANGE
33

4-
gsutil cp gs://$BUCKET/notebooks/jupyter/* .
4+
gcloud storage cp gs://$BUCKET/notebooks/jupyter/* .

quests/sparktobq/copy_to_gcs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
BUCKET=cloud-training-demos-ml # CHANGE
33

4-
gsutil cp *.ipynb gs://$BUCKET/notebooks/jupyter
4+
gcloud storage cp *.ipynb gs://$BUCKET/notebooks/jupyter

quests/sparktobq/spark_analysis.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import argparse
32
parser = argparse.ArgumentParser()
43
parser.add_argument("--bucket", help="bucket for input and output")
@@ -60,8 +59,8 @@
6059
attack_stats.show()
6160
ax = attack_stats.toPandas().plot.bar(x='protocol_type', subplots=True, figsize=(10,25))
6261
ax[0].get_figure().savefig('report.png');
63-
#!gsutil rm -rf gs://$BUCKET/sparktobq/
64-
#!gsutil cp report.png gs://$BUCKET/sparktobq/
62+
#!gcloud storage rm --recursive --continue-on-error gs://$BUCKET/sparktobq/
63+
#!gcloud storage cp report.png gs://$BUCKET/sparktobq/
6564
import google.cloud.storage as gcs
6665
bucket = gcs.Client().get_bucket(BUCKET)
6766
for blob in bucket.list_blobs(prefix='sparktobq/'):

0 commit comments

Comments
 (0)