[ADR] Community Implementation for Python Services
Title
Community Implementation for Python Services
Context
The Python services are limited with main cloud providers (GC, AWS, Azure, IBM). And, if we want to add a new implementation (e.g., BareMetal), we will have to create a new folder under the providers
directory.
Decision
We decided to use RAFS for an example.
As a solution, we can introduce a new concept called Community Implementation
, when developers can write their own implementations without changing the main repository, and connect their implementations with environment variables.
The only requirement of the implementations is following the abstract classes from the repository.
For demonstration purposes, we did the following:
- Added a new provider with the name "cimpl" (community implementation). MR.
- Created abstract classes for BlobLoader
- Now, users can write their own BlobLoader implementations, create a package from it, and specify the full path to the implementation with
CIMPL_BLOB_LOADER_CLASS_PATH
environment variable. - TBD: Create BareMetal implementation.
Running the Community Implementation will look like the following:
# some initial actions of cloning the project, and installing the basic dependencies
...
# linking the concrete GC implementation
# Install the package with abstract classes
pip install os-obm-python --index-url https://community.opengroup.org/api/v4/projects/1505/packages/pypi/simple
# Install the concrete implementation
pip install your-implementation
# Choose community implementation
export CLOUD_PROVIDER="cimpl"
# Full class path in your own implementation
export CIMPL_BLOB_LOADER_CLASS_PATH="your_implementation.BlobLoader"
uvicorn app.main:app