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

feat(model): Require size when writing to ProvenanceFileStorage #7292

Merged
merged 1 commit into from
Jul 17, 2023

Commits on Jul 17, 2023

  1. feat(model): Require size when writing to ProvenanceFileStorage

    Add a `size` argument to the `putData` function of the
    `ProvenanceFileStorage` which represents the size of the input stream
    to be written.
    
    This is currently a requirement to implement the `ProvenanceFileStorage`
    for the ORT Server using a generic storic interface it provides. This
    interface requires the size because some potentail storage backends
    require this, for example the putBlob [1] method from the Azure blob
    storage requires a Content-Length header to be set. The size is also
    required by the PostgreSQL implementation of this storage interface
    which uses it to decide if the data is directly streamed to the client
    or if it needs to be buffered in a file. This is necessary because
    PostgreSQL requires that blobs are read in a transaction, but the time
    the transaction stays open should not depend on the time it takes to
    transfer the data to the client.
    
    The current implementations of `ProvenanceFileStorage` do not require
    the size of the input stream, but the size is easily available for all
    callers of the `putData` function. However, if for example Azure should
    be implemented as a storage backend in future, the size argument would
    be required as explained above.
    
    [1]: https://learn.microsoft.com/en-us/rest/api/storageservices/put-blob
    
    Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.io>
    mnonnenmacher committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    5c879da View commit details
    Browse the repository at this point in the history