Skip to content

Commit 9bf9468

Browse files
authored
Merge pull request #7809 from bhandarivijay-png/ai-gsutil-migration-17f9a05e25cb4fb68ea48e583dbf920f
Ai gsutil migration 17f9a05e25cb4fb68ea48e583dbf920f
2 parents e34793a + b56299a commit 9bf9468

13 files changed

Lines changed: 27 additions & 27 deletions

File tree

docs/guide/container_component.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ grep_component = tfx.dsl.components.create_container_component(
7070
parameters={
7171
'pattern': str,
7272
},
73-
# The component code uses gsutil to upload the data to Google Cloud Storage, so the
74-
# container image needs to have gsutil installed and configured.
73+
# The component code uses gcloud storage to upload the data to Google Cloud Storage, so the
74+
# container image needs to have gcloud storage installed and configured.
7575
image='google/cloud-sdk:278.0.0',
7676
command=[
7777
'sh', '-exc',
@@ -83,13 +83,13 @@ grep_component = tfx.dsl.components.create_container_component(
8383
filtered_text_path=$(mktemp)
8484
8585
# Getting data into the container
86-
gsutil cp "$text_uri" "$text_path"
86+
gcloud storage cp "$text_uri" "$text_path"
8787
8888
# Running the main code
8989
grep "$pattern" "$text_path" >"$filtered_text_path"
9090
9191
# Getting data out of the container
92-
gsutil cp "$filtered_text_path" "$filtered_text_uri"
92+
gcloud storage cp "$filtered_text_path" "$filtered_text_uri"
9393
''',
9494
'--pattern', tfx.dsl.placeholders.InputValuePlaceholder('pattern'),
9595
'--text', tfx.dsl.placeholders.InputUriPlaceholder('text'),

docs/tutorials/tfx/cloud-ai-platform-pipelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ The notebook will upload our sample data to GCS bucket so that we can use it in
359359
our pipeline later.
360360

361361
```python
362-
!gsutil cp data/data.csv gs://{GOOGLE_CLOUD_PROJECT}-kubeflowpipelines-default/tfx-template/data/taxi/data.csv
362+
!gcloud storage cp data/data.csv gs://{GOOGLE_CLOUD_PROJECT}-kubeflowpipelines-default/tfx-template/data/taxi/data.csv
363363
```
364364

365365
The notebook then uses the `tfx pipeline create` command to create the pipeline.

docs/tutorials/tfx/gcp/vertex_pipelines_bq.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@
637637
},
638638
"outputs": [],
639639
"source": [
640-
"!gsutil cp {_trainer_module_file} {MODULE_ROOT}/"
640+
"!gcloud storage cp {_trainer_module_file} {MODULE_ROOT}/"
641641
]
642642
},
643643
{

docs/tutorials/tfx/gcp/vertex_pipelines_simple.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@
387387
},
388388
"outputs": [],
389389
"source": [
390-
"!gsutil cp gs://download.tensorflow.org/data/palmer_penguins/penguins_processed.csv {DATA_ROOT}/"
390+
"!gcloud storage cp gs://download.tensorflow.org/data/palmer_penguins/penguins_processed.csv {DATA_ROOT}/"
391391
]
392392
},
393393
{
@@ -407,7 +407,7 @@
407407
},
408408
"outputs": [],
409409
"source": [
410-
"!gsutil cat {DATA_ROOT}/penguins_processed.csv | head"
410+
"!gcloud storage cat {DATA_ROOT}/penguins_processed.csv | head"
411411
]
412412
},
413413
{
@@ -607,7 +607,7 @@
607607
},
608608
"outputs": [],
609609
"source": [
610-
"!gsutil cp {_trainer_module_file} {MODULE_ROOT}/"
610+
"!gcloud storage cp {_trainer_module_file} {MODULE_ROOT}/"
611611
]
612612
},
613613
{

docs/tutorials/tfx/stub_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ tfx run create --pipeline-name $pipeline_name --endpoint=$endpoint \
143143

144144
Use command `fg` to access the port-forwarding in the background then ctrl-C to
145145
terminate. You can delete the directory with recorded pipeline outputs using
146-
`gsutil -m rm -R $output_dir`.
146+
`gcloud storage rm --recursive $output_dir`.
147147

148148
To clean up all Google Cloud resources used in this project, you can
149149
[delete the Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#shutting_down_projects)

docs/tutorials/tfx/template.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@
408408
},
409409
"outputs": [],
410410
"source": [
411-
"!gsutil cp data/data.csv gs://{GOOGLE_CLOUD_PROJECT}-kubeflowpipelines-default/tfx-template/data/taxi/data.csv"
411+
"!gcloud storage cp data/data.csv gs://{GOOGLE_CLOUD_PROJECT}-kubeflowpipelines-default/tfx-template/data/taxi/data.csv"
412412
]
413413
},
414414
{

tfx/examples/chicago_taxi_pipeline/serving/start_model_server_aiplatform.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ echo Running cloud serving...
2020
# Dir for model exported for serving, e.g., gs://<bucket>/serving_model/chicago_taxi_pipeline_kubeflow
2121
CLOUD_MODEL_DIR=$1
2222

23-
gsutil ls $CLOUD_MODEL_DIR
23+
gcloud storage ls $CLOUD_MODEL_DIR
2424

2525
# Pick out the directory containing the last trained model.
26-
MODEL_BINARIES=$(gsutil ls $CLOUD_MODEL_DIR \
26+
MODEL_BINARIES=$(gcloud storage ls $CLOUD_MODEL_DIR \
2727
| sort | grep '\/[0-9]*\/$' | tail -n1)
2828

2929
echo latest model: $MODEL_BINARIES

tfx/examples/custom_components/container_components/download_grep_print_pipeline.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
wget "$0" -O "$output_data_path" || curl "$0" > "$output_data_path"
4242
4343
# Getting data out of the container
44-
gsutil cp "$output_data_path" "$output_data_uri"
44+
gcloud storage cp "$output_data_path" "$output_data_uri"
4545
''',
4646
placeholders.InputValuePlaceholder('url'),
4747
placeholders.OutputUriPlaceholder('data'),
@@ -74,13 +74,13 @@
7474
filtered_text_path=$(mktemp)
7575
7676
# Getting data into the container
77-
gsutil cp "$text_uri" "$text_path"
77+
gcloud storage cp "$text_uri" "$text_path"
7878
7979
# Running the main code
8080
grep "$pattern" "$text_path" >"$filtered_text_path"
8181
8282
# Getting data out of the container
83-
gsutil cp "$filtered_text_path" "$filtered_text_uri"
83+
gcloud storage cp "$filtered_text_path" "$filtered_text_uri"
8484
''',
8585
placeholders.InputValuePlaceholder('pattern'),
8686
placeholders.InputUriPlaceholder('text'),
@@ -105,7 +105,7 @@
105105
text_path=$(mktemp)
106106
107107
# Getting data into the container
108-
gsutil cp "$text_uri" "$text_path"
108+
gcloud storage cp "$text_uri" "$text_path"
109109
110110
# Running the main code
111111
cat "$text_path"

tfx/examples/custom_components/slack/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pipeline in Google Cloud Platform for production.
114114
First prepare a gcs bucket for the pipeline run root:
115115

116116
```bash
117-
gsutil mb -p ${PROJECT_ID} gs://${BUCKET_NAME}
117+
gcloud storage buckets create gs://${BUCKET_NAME} --project=${PROJECT_ID}
118118
```
119119

120120
Let's copy the dataset CSV to the GCS where TFX ExampleGen will ingest it

tfx/examples/penguin/experimental/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ pipeline python file. Output can be found at `[BUCKET]/tfx`.
6767

6868
<pre class="devsite-terminal devsite-click-to-copy">
6969
vi ~/penguin/experimental/penguin_pipeline_sklearn_gcp.py
70-
gsutil -m cp -r ~/penguin/data/* gs://[BUCKET]/penguin/data/
71-
gsutil -m cp ~/penguin/experimental/\*.py gs://[BUCKET]/penguin/experimental/
70+
gcloud storage cp --recursive ~/penguin/data/* gs://[BUCKET]/penguin/data/
71+
gcloud storage cp ~/penguin/experimental/\*.py gs://[BUCKET]/penguin/experimental/
7272

7373
tfx pipeline create \
7474
--engine kubeflow \
@@ -77,7 +77,7 @@ tfx pipeline create \
7777
</pre>
7878

7979
Note that
80-
`gsutil -m cp ~/penguin/experimental/*.py gs://[BUCKET]/penguin/experimental`
80+
`gcloud storage cp ~/penguin/experimental/*.py gs://[BUCKET]/penguin/experimental`
8181
will need to be run every time updates are made to the GCP example.
8282
Additionally, subsequent pipeline deployments should use `tfx pipeline update`
8383
instead of `tfx pipeline create`.

0 commit comments

Comments
 (0)