Skip to content
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

Google Cloud Storage Support #113

Merged
merged 15 commits into from
Jan 22, 2021
Merged

Google Cloud Storage Support #113

merged 15 commits into from
Jan 22, 2021

Conversation

scruffaluff
Copy link
Contributor

Google Cloud Storage support with GSClient and GSPath subclasses.

Features:

  • Implements GSClient and GSPath as subclasses of Client and CloudPath respectively.
  • Adds gs as an extra for pip installation with separate requirements.txt.
  • Creates gs_rig test configuration and adds to rig for test suite.
  • Creates mock clients for testing GSClient and GSPath without internet.
  • Creates tests for GSClient and GSPath specific features.
  • Updates documentation to show that gs is a pip extra for Google Cloud Storage support.
  • Updates REAMDE table indicating availability of GCS.

The GitHub Actions tests workflow has been updated to include GOOGLE_APPLICATION_CREDENTIALS and LIVE_GS_BUCKET environment variables for GitHub Secrets usage. However, it seems, from the Google Service Account Authentication documentation, that authentication cannot happen with credentials in environment variables directly. Rather the environment variable GOOGLE_APPLICATION_CREDENTIALS must point to a JSON file with the authentication credentials. I don't know of a secure way to resolve this issue with GitHub Secrets.

Resolves #25.

@pjbull
Copy link
Member

pjbull commented Jan 21, 2021

This is awesome, thanks @wolfgangwazzlestrauss!

We'll take a more detailed look, but I think I've added all the creds we need as secrets in GitHub actions.

Can you add the action to authenticate to google cloud to the tests workflow:
https://github.com/google-github-actions/setup-gcloud#usage

I've set the two secrets mentioned there, so I think you should also remove GOOGLE_APPLICATION_CREDENTIALS since that is exported by the action.

(I've also created a test bucket and set it as the LIVE_GS_BUCKET secret so that should work).

@pjbull pjbull changed the base branch from master to 25-gs January 21, 2021 23:16
@pjbull pjbull merged commit 93913a6 into drivendataorg:25-gs Jan 22, 2021
jayqi pushed a commit that referenced this pull request Jan 24, 2021
* Google Cloud Storage Support (#113)

* Update README and imports for Google Cloud Storage

* Write Google Storage download and upload methods

* Change key to blob for GSClient

* Implement pass methods for GSClient

* Write live tests for GSClient and GSPath

* Unify GSClient methods

* Add Mock Google Storage fixtures for testing

* Fix Google Storage mock bucket copy_blob method

* Change get_bucket method to bucket for GSClient

* Update test mocks for Google Storage

* Add documentation for Google Storage

* Expand authentication options

* Update metadata fetcher for GSPath

* Add Google Cloud setup action to CI workflow

* Tweaks for tests to work on Windows

Co-authored-by: Macklan Weinstein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Google cloud storage backend
2 participants