-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Context / Motivation
ocm package is intended to be used w/ "streaming" support, especially for oci.replicate_artefact (ref). This is done in order to limit consumption of main memory, but also to avoid unnecessary I/O against local filesystem.
For reasons yet to be found out, streaming from an oci.client.blob (which issues an http-get-request against a blob using requests package) into oci.client.pub_blob will lead to SSLErrors (unexpected EOF). As a workaround, we write data from source into temporary (ref) files. While this works, it is not ideal, as it will increase processing times + cause unnecessary I/O. Also, it will consume storage in local filesystem.
Implementation Proposal
Find out why streaming fails, and enable it (again). Switching to another http-client-lib might help.
- re-enable streaming for
oci.client - re-enable streaming for
oci.client_async
Bonus-Task
oci.client.put_blob will currently fail to correctly process empty blobs (requests will block until eventually running into (configured) timeouts). This is probably also a limitation/bug from requests (todo: check whether oci.client_async is also affected).
For OCI-Images, empty blobs will likely never occur (as tar does not allow empty tarfiles). Possibly, OCI-Transport-Spec even forbids empty blobs (could not find an explicit stmt). Therefore, checking for empty blobs and failing with an explicit error-message might already be "good enough".
- correctly upload empty blobs (oci.client) - OR: fail upon empty blobs
- correctly upload empty blobs (oci.client_async) - OR: fail upon empty blobs