-
Notifications
You must be signed in to change notification settings - Fork 520
chore: Migrate gsutil usage to gcloud storage #1378
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: main
Are you sure you want to change the base?
Changes from 1 commit
d5012cb
8c4f71a
9797e76
50cacfc
766d01a
fa154a0
7137187
34213ae
5bf2dce
9571314
1f6f574
506586b
1541c52
86ba4a3
a242ddd
dcad455
e7ada01
d609ab8
4e30d7b
3ae2259
8ef5f16
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,8 +77,8 @@ Where `create-my-cluster.sh` specifies a list of conda and/or pip packages to in | |||||||||||||
| ``` | ||||||||||||||
| #!/usr/bin/env bash | ||||||||||||||
|
|
||||||||||||||
| gsutil -m cp -r gs://goog-dataproc-initialization-actions-${REGION}/conda/bootstrap-conda.sh . | ||||||||||||||
| gsutil -m cp -r gs://goog-dataproc-initialization-actions-${REGION}/conda/install-conda-env.sh . | ||||||||||||||
| gcloud storage cp --recursive gs://goog-dataproc-initialization-actions-${REGION}/conda/bootstrap-conda.sh . | ||||||||||||||
| gcloud storage cp --recursive gs://goog-dataproc-initialization-actions-${REGION}/conda/install-conda-env.sh . | ||||||||||||||
|
|
||||||||||||||
| chmod 755 ./*conda*.sh | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -100,9 +100,9 @@ Similarly, one can also specify a [conda environment yml file](https://github.co | |||||||||||||
| CONDA_ENV_YAML_GSC_LOC="gs://my-bucket/path/to/conda-environment.yml" | ||||||||||||||
| CONDA_ENV_YAML_PATH="/root/conda-environment.yml" | ||||||||||||||
| echo "Downloading conda environment at $CONDA_ENV_YAML_GSC_LOC to $CONDA_ENV_YAML_PATH ... " | ||||||||||||||
| gsutil -m cp -r $CONDA_ENV_YAML_GSC_LOC $CONDA_ENV_YAML_PATH | ||||||||||||||
| gsutil -m cp -r gs://goog-dataproc-initialization-actions-${REGION}/conda/bootstrap-conda.sh . | ||||||||||||||
| gsutil -m cp -r gs://goog-dataproc-initialization-actions-${REGION}/conda/install-conda-env.sh . | ||||||||||||||
| gcloud storage cp --recursive $CONDA_ENV_YAML_GSC_LOC $CONDA_ENV_YAML_PATH | ||||||||||||||
| gcloud storage cp --recursive gs://goog-dataproc-initialization-actions-${REGION}/conda/bootstrap-conda.sh . | ||||||||||||||
| gcloud storage cp --recursive gs://goog-dataproc-initialization-actions-${REGION}/conda/install-conda-env.sh . | ||||||||||||||
|
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. The
Suggested change
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. done |
||||||||||||||
|
|
||||||||||||||
| chmod 755 ./*conda*.sh | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -223,7 +223,7 @@ EOF | |||||
| kadmin.local -q "addprinc -randkey hbase/${m}.${DOMAIN}@${REALM}" | ||||||
| echo "Generating hbase keytab..." | ||||||
| kadmin.local -q "xst -k ${HBASE_HOME}/conf/hbase-${m}.keytab hbase/${m}.${DOMAIN}" | ||||||
| gsutil cp "${HBASE_HOME}/conf/hbase-${m}.keytab" \ | ||||||
| gcloud storage cp "${HBASE_HOME}/conf/hbase-${m}.keytab" \ | ||||||
| "${KEYTAB_BUCKET}/keytabs/${CLUSTER_NAME}/hbase-${m}.keytab" | ||||||
| done | ||||||
|
|
||||||
|
|
@@ -232,17 +232,17 @@ EOF | |||||
| kadmin.local -q "addprinc -randkey hbase/${CLUSTER_NAME}-w-${c}.${DOMAIN}" | ||||||
| echo "Generating hbase keytab..." | ||||||
| kadmin.local -q "xst -k ${HBASE_HOME}/conf/hbase-${CLUSTER_NAME}-w-${c}.keytab hbase/${CLUSTER_NAME}-w-${c}.${DOMAIN}" | ||||||
| gsutil cp "${HBASE_HOME}/conf/hbase-${CLUSTER_NAME}-w-${c}.keytab" \ | ||||||
| gcloud storage cp "${HBASE_HOME}/conf/hbase-${CLUSTER_NAME}-w-${c}.keytab" \ | ||||||
| "${KEYTAB_BUCKET}/keytabs/${CLUSTER_NAME}/hbase-${CLUSTER_NAME}-w-${c}.keytab" | ||||||
| done | ||||||
| touch /tmp/_success | ||||||
| gsutil cp /tmp/_success "${KEYTAB_BUCKET}/keytabs/${CLUSTER_NAME}/_success" | ||||||
| gcloud storage cp /tmp/_success "${KEYTAB_BUCKET}/keytabs/${CLUSTER_NAME}/_success" | ||||||
| fi | ||||||
| success=1 | ||||||
| while [[ $success == "1" ]]; do | ||||||
| sleep 1 | ||||||
| success=$( | ||||||
| gsutil -q stat "${KEYTAB_BUCKET}/keytabs/${CLUSTER_NAME}/_success" | ||||||
| gcloud storage objects list --stat --fetch-encrypted-object-hashes "${KEYTAB_BUCKET}/keytabs/${CLUSTER_NAME}/_success" | ||||||
|
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. The original
Suggested change
|
||||||
| echo $? | ||||||
| ) | ||||||
| done | ||||||
|
|
@@ -255,7 +255,7 @@ EOF | |||||
| fi | ||||||
|
|
||||||
| # Copy keytab to machine | ||||||
| gsutil cp "${KEYTAB_BUCKET}/keytabs/${CLUSTER_NAME}/hbase-$(hostname -s).keytab" $hbase_keytab_path | ||||||
| gcloud storage cp "${KEYTAB_BUCKET}/keytabs/${CLUSTER_NAME}/hbase-$(hostname -s).keytab" $hbase_keytab_path | ||||||
|
|
||||||
| # Change owner of keytab to hbase with read only permissions | ||||||
| if [ -f $hbase_keytab_path ]; then | ||||||
|
|
||||||
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.
The
--recursiveflag is unnecessary when copying single files. Its use here could be confusing for users. For clarity, it's better to remove it.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.
done