Motivation
The RunAI Model Streamer currently supports a shared library model for loading libstreamers3. This interface is defined here. The current implementation of libstreamers3.so uses the aws-sdk-cpp library, and S3 compliant APIs (eg: S3, GCS, Minio) are supported.
In order to support more features of other object storage providers (eg: client configuration, performance, authentication), it would be ideal for compatible libstreamers3 shared libraries to be dynamically invoked based on the user specified endpoint. For example, if the user specifies a GCS URL prefixed with gs://, the Run AI Model Streamer could prefer to use a GCS specific libstreamers3 library. If not available, Run AI Model Streamer could fallback to the current libstreamers3 implementation (leveraging the S3 compliant authentication and API offered by Google Cloud Storage).
Design Requirements
- Allow endpoint prefixes to automatically select the preferred shared library to call. This can be done dynamically when identifying an appropriate libstreamers3 interface (eg: case switch in
s3_wrapper.cc.
- The user should also be able to override the underlying library implementation, through an environment variable.
- The libstreamers3 interface should be packaged in an optional PIP package. Today, this is done with the optional package
runai-model-streamer-s3. Additional implementations can be made available in separate packages (eg: runai-model-streamer-gcs).
Additional Considerations
- With the exception of the
S3Credentials resource, there aren't any S3 specific details in the cpp/common or cpp/streamer. In order to disambiguate naming, S3 specific references (eg: interface definitions, c++ namespaces) could be renamed to ObjectStorage in these source directories, to reduce code ambiguity.
- With the shared library fallback logic, user authentication may not work as expected, depending on the underlying PIP dependencies that are installed. For example, if the user was expecting to use a GCS specific package (
runai-model-streamer-gcs) that included support for Workload Identity Federation on GCP, but only had the runai-model-streamer-s3 package installed, model streaming would fail. The S3 library requires the user to input GCS HMAC credentials. So merely transferring configuration across installation environments with different optional dependencies could lead to unexpected incompatibility. The user troubleshooting experience should at least be considered if supporting this type of behavior.
- With more libstreamers3 implementations, and potential interface changes, ABI versioning becomes a consideration. The libstreamers3 interface must be compatible with the upstream
libstreamer.so library that is calling into it. Additionally, if either libstreamers3 or libstreamer introduce forwards/backwards incompatible changes, minimum supported versions should be included and managed as part of the PyPI distribution. In order to get ahead of this problem, ABI versions and PIP dependencies should be introduced as part of this feature.
Motivation
The RunAI Model Streamer currently supports a shared library model for loading libstreamers3. This interface is defined here. The current implementation of
libstreamers3.souses the aws-sdk-cpp library, and S3 compliant APIs (eg: S3, GCS, Minio) are supported.In order to support more features of other object storage providers (eg: client configuration, performance, authentication), it would be ideal for compatible libstreamers3 shared libraries to be dynamically invoked based on the user specified endpoint. For example, if the user specifies a GCS URL prefixed with
gs://, the Run AI Model Streamer could prefer to use a GCS specific libstreamers3 library. If not available, Run AI Model Streamer could fallback to the current libstreamers3 implementation (leveraging the S3 compliant authentication and API offered by Google Cloud Storage).Design Requirements
s3_wrapper.cc.runai-model-streamer-s3. Additional implementations can be made available in separate packages (eg:runai-model-streamer-gcs).Additional Considerations
S3Credentialsresource, there aren't any S3 specific details in thecpp/commonorcpp/streamer. In order to disambiguate naming, S3 specific references (eg: interface definitions, c++ namespaces) could be renamed to ObjectStorage in these source directories, to reduce code ambiguity.runai-model-streamer-gcs) that included support for Workload Identity Federation on GCP, but only had therunai-model-streamer-s3package installed, model streaming would fail. The S3 library requires the user to input GCS HMAC credentials. So merely transferring configuration across installation environments with different optional dependencies could lead to unexpected incompatibility. The user troubleshooting experience should at least be considered if supporting this type of behavior.libstreamer.solibrary that is calling into it. Additionally, if either libstreamers3 or libstreamer introduce forwards/backwards incompatible changes, minimum supported versions should be included and managed as part of the PyPI distribution. In order to get ahead of this problem, ABI versions and PIP dependencies should be introduced as part of this feature.