Coder Social home page Coder Social logo

humancellatlas / cloud-blobstore Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 8.43 MB

Simple API that abstracts out differences between the blobstores across different cloud providers.

License: MIT License

Makefile 0.40% Python 93.93% Shell 5.67%

cloud-blobstore's People

Contributors

amork avatar bento007 avatar briandoconnor avatar chmreid avatar dailydreaming avatar freeman-lab avatar hannes-ucsc avatar kislyuk avatar kozbo avatar mackey22 avatar sampierson avatar ttung avatar xbrianh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloud-blobstore's Issues

BlobStoreTimeoutError should be supported for GCP

Unfortunately GCP does not provide straightforward timeout/retry configurations analogous to boto.

However, google.cloud.storage requests are forwarded all the way to the stdlib method requests.Session().request, which accepts a timeout keyword argument. Usage would look like:

import google.auth
import google.auth.transport.requests

connect_timeout = 1.0
read_timeout = 1.0
class Session(google.auth.transport.requests.AuthorizedSession):
    def request(self, *args, **kwargs):
        kwargs['timeout'] = (connect_timeout, read_timeout)
        return super().request(*args, **kwargs)

credentials, _ = google.auth.default()
gcp_client = Client(
    _http=Session(credentials)
)

The problem with this approach is Google may pull the rug out from under us by changing the _http argument:

:param _http: (Optional) HTTP object to make requests. Can be any object
that defines request() with the same interface as
:meth:requests.Session.request. If not passed, an
_http object is created that is bound to the
credentials for the current object.
This parameter should be considered private, and could
change in the future.

Things are a bit more promising for retry behavior, which appears configurable through a global:

import google.resumable_media.common
google.resumable_media.common.MAX_CUMULATIVE_RETRY = 2

@ttung thoughts?

Allow the Uploading of meta-data using blobstore

I would like to able to add meta-data associated with the file handle when upload to a blobstore. For example the ExtraArgs keyword in s3_client.upload_fileobj can take dictionary and will add to the files metadata.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.