forked from CU-DBMI/gc-cloud-storage-bucket
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gsutil script and Assay.Works specifics (CU-DBMI#1)
* changes for assayworks project specifics * update shell script with bucket name * detemplatize; gsutil instructions * assay works docs context; simplify source dir
- Loading branch information
Showing
14 changed files
with
138 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,3 +202,6 @@ cython_debug/ | |
# dagger ignores | ||
cue.mod/pkg | ||
cue.mod/dagger.* | ||
|
||
# data ignores | ||
*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
[tool.poetry] | ||
name = "gc-cloud-storage-bucket" | ||
name = "gc-assayworks-bucket" | ||
version = "0.0.1" | ||
description = "Template for creating Cloud Storage bucket on Google Cloud." | ||
description = "Cloud Storage bucket on Google Cloud for Assay.Works data transfer." | ||
authors = ["d33bs <[email protected]>"] | ||
license = "BSD-3-Clause license" | ||
readme = "README.md" | ||
packages = [{include = "gc_cloud_storage_bucket"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# tf local output | ||
resource "local_file" "service_account_key" { | ||
filename = "../utilities/service-account.json" | ||
content = base64decode(google_service_account_key.key.private_key) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Assay.Works Data Sync Instructions | ||
|
||
Thank you for your help in uploading data as part of this project! Please see the following instructions on uploading data to the Google Cloud bucket. | ||
|
||
1. Ensure `service-account.json` key is found within the same directory where script is run. | ||
1. Prepare data to be uploaded under `./data` directory relative to `gsutil_sync.sh` location. | ||
1. Run the `gsutil_sync.sh` script (for example: `sh ./gsutil_sync.sh`). | ||
|
||
Please reference the following directory tree structure for an example of what the path should contain: | ||
|
||
```shell | ||
. | ||
├── README.md | ||
├── data | ||
│ └── <data to be synchronized> | ||
├── gsutil_sync.sh | ||
└── service-account.json | ||
``` | ||
|
||
## Additional Notes | ||
|
||
- __Alternative data upload path__: if an alternative data upload path is preferred, please reference and update `gsutil_sync.sh` as follows: | ||
- Original: `gsutil rsync ./data gs://waylab-assayworks-bucket` | ||
- Updated: `gsutil rsync <new data location> gs://waylab-assayworks-bucket` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
# | ||
# This file automates how data are sync'd to a | ||
# Google Cloud Cloud Storage bucket using a | ||
# pre-existing service account key. | ||
# | ||
# Notes: | ||
# ---------------------------------------------------- | ||
# presumes gsutil has already been installed and is | ||
# available in the path. | ||
# see gsutil docs for more information: | ||
# https://cloud.google.com/storage/docs/gsutil_install | ||
|
||
# authenticate gcloud for the service account | ||
# note: this is the preferred method for authenticating gsutil | ||
# see the following for more details: | ||
# https://cloud.google.com/storage/docs/gsutil/commands/config#configuring-service-account-credentials | ||
gcloud auth activate-service-account --key-file=./service-account.json | ||
|
||
# synchronize data from local directory `./data` | ||
# to bucket lab-initiative-bucket | ||
# see the following for more details: | ||
# https://cloud.google.com/storage/docs/gsutil/commands/rsync | ||
gsutil rsync ./data gs://waylab-assayworks-bucket |