-
Notifications
You must be signed in to change notification settings - Fork 135
chore: Migrate gsutil usage to gcloud storage #1902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||
| #!/bin/bash | ||||||
| mkdir -p scratch | ||||||
| gsutil -m cp -R gs://datcom-csv/census/decennial/* scratch/ | ||||||
| gcloud storage cp --recursive gs://datcom-csv/census/decennial/* scratch/ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For clarity and consistency, it's better to specify the GCS source directory path without a trailing
Suggested change
|
||||||
|
|
||||||
| mkdir -p output | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,2 +1,2 @@ | ||||||
| mkdir -p gcs_folder/input_files | ||||||
| gsutil -m cp -r gs://unresolved_mcf/us_nces/demographics/private_school/semi_automation_input_files/* gcs_folder/input_files/ | ||||||
| gcloud storage cp --recursive gs://unresolved_mcf/us_nces/demographics/private_school/semi_automation_input_files/* gcs_folder/input_files/ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For clarity and consistency, it's better to specify the GCS source directory path without a trailing
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,2 +1,2 @@ | ||||||
| mkdir -p gcs_folder/input_files | ||||||
| gsutil -m cp -r gs://unresolved_mcf/us_nces/demographics/public_school/semi_automation_input_files/* gcs_folder/input_files/ | ||||||
| gcloud storage cp --recursive gs://unresolved_mcf/us_nces/demographics/public_school/semi_automation_input_files/* gcs_folder/input_files/ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For clarity and consistency, it's better to specify the GCS source directory path without a trailing
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,2 +1,2 @@ | ||||||
| mkdir -p gcs_folder/input_files | ||||||
| gsutil -m cp -r gs://unresolved_mcf/us_nces/demographics/school_district/semi_automation_input_files/* gcs_folder/input_files/ | ||||||
| gcloud storage cp --recursive gs://unresolved_mcf/us_nces/demographics/school_district/semi_automation_input_files/* gcs_folder/input_files/ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For clarity and consistency, it's better to specify the GCS source directory path without a trailing
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,7 +35,7 @@ Copies all latest input .csv files from GCS using: | |||||
|
|
||||||
| bash | ||||||
|
|
||||||
| gsutil cp gs://unresolved_mcf/cdc/social_vulnerability_index/latest/input_files/* source_files/ | ||||||
| gcloud storage cp gs://unresolved_mcf/cdc/social_vulnerability_index/latest/input_files/* source_files/ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve clarity in the documentation, you can remove the trailing
Suggested change
|
||||||
|
|
||||||
| Adds a year column using add_years.py: | ||||||
|
|
||||||
|
|
@@ -59,7 +59,7 @@ Download the latest .csv/xlsx file manually from the CDC SVI source page. | |||||
|
|
||||||
| bash | ||||||
|
|
||||||
| gsutil cp <local_csv_file> gs://unresolved_mcf/cdc/social_vulnerability_index/latest/input_files/ | ||||||
| gcloud storage cp <local_csv_file> gs://unresolved_mcf/cdc/social_vulnerability_index/latest/input_files/ | ||||||
|
|
||||||
| ## Ensure the file is named using the format: | ||||||
| SVI_<year>_US_county.csv (e.g., SVI_2024_US_county.csv) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For copying the contents of a local directory, it's more robust to specify the source directory with a trailing slash instead of using a wildcard (
*). This avoids reliance on shell globbing, which can behave unexpectedly if the directory is empty. Using a trailing slash is the idiomatic way to copy directory contents withgcloud storage cp.