-
Story
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
8
-
False
-
-
False
-
-
-
PIDONE 18.0.4, PIDONE 18.0.5
-
2
This task introduces the foundational system for supporting multiple backends in oslo.service. The backend system enables dynamic loading of service backends (e.g., Eventlet, Asyncio) while maintaining compatibility with the current implementation.
The backend system is implemented as follows:
1. Dynamic Backend Loading:
- A get_backend() method dynamically loads a backend module based on a configuration option (CONF.backend).
- Backends are expected to implement a BaseBackend class, ensuring a consistent interface.
2. Base Backend Class:
- A BaseBackend abstract class is introduced to define the contract that all backends must follow.
- The get_service_components() method must be implemented by each backend, returning a dictionary of components required by oslo.service (e.g., ServiceLauncher, ProcessLauncher, etc...)
3. No Changes to Existing Functionality:
- In this task, service.py will not be modified to use the backend system.
- This ensures that the introduction of the backend system is completely isolated, with no impact on the current functionality.
Proposed Changes
Add a backend module with:
- backend/{}init{}.py: Implements the get_backend() function.
- backend/base.py: Introduces the abstract BaseBackend class.
- Include unit tests for both modules.
Acceptance Criteria
- The backend system is implemented and functional.
- The system is backward-compatible and does not alter existing functionality.
- Includes unit tests for:
- get_backend() with mocked backends.
- BaseBackend to ensure all backends follow the required interface.
References
- oslo-specs: Remove Eventlet from oslo.service
Tasks
1. Implement backend/{}init{}.py with the get_backend() method.
2. Add backend/base.py with the abstract BaseBackend class.
3. Write unit tests for the backend system.
Benefits
- Provides a foundation for implementing and integrating alternative backends (e.g., Asyncio) as per the spec.
- Improves modularity and flexibility in oslo.service.