https://blueprints.launchpad.net/fuel/+spec/data-pipeline
Together with implementation of Nailgun Extensions [1] we want to remove all direct calls from Nailgun core to any kind of extension i.e.: to volume_manager [2] or any other extension using node_extension_call function [3].
But extensions must have the ability to change the deployment and provisioning data. It is required for example by new bareon-fuel-extension [4] which will be used to integrate Fuel with Bareon-API [5].
Once the deployment or provisioning data serialization happens the data will be passed to all available extensions. Then every extension will be able to make some data manipulation.
The proposal is to create new Extension attribute which is called data_pipelines.
data_pipelines is a list of Pipeline classes. Every Pipeline class should implement at least one of the following methods:
- process_deployment(deployment_data, **kwargs) - is executed once the serialization of deployment data occurs. It receives reference to a dict which can be changed.
- process_provisioning(provisioning_data, **kwargs) - is executed once the serialization of provisioning data occurs. It receives reference to a dict which can be changed.
Both methods don’t return anything and both are executed after Nailgun data serialization. Then the data can be changed by User using Fuel CLI as it was possible so far.
Example implementation:
class ExamplePipeline(BasePipeline):
@classmethod
def process_deployment(cls, deployment_data, **kwargs):
deployment_data['new_field'] = external_source.get_new_data()
@classmethod
def process_provisioning(cls, provisioning_data, **kwargs):
provisioning_data['new_field'] = external_source.get_new_data()
class ExampleExtension(BaseExtension):
...
data_pipelines = (ExamplePipeline,)
...
None
None
None
None
Instead of introducing new Extension attribute with classes list:
None
None
None
None
None
None
Developer is able to change the deployment/provisioning data directly from extensions.
None
Pipelines should be described in Extensions docs. Description should include:
Primary assignee: Sylwester Brzeczkowski <sbrzeczkowski@mirantis.com>
Mandatory design review:
- Evgeny Li <eli@mirantis.com>
- Igor Kalnitsky <igor@kalnitsky.org>
Cases:
[1] | (1, 2) https://blueprints.launchpad.net/fuel/+spec/stevedore-extensions-discovery |
[2] | https://github.com/openstack/fuel-web/blob/stable/8.0/nailgun/nailgun/db/sqlalchemy/models/node.py#L38 |
[3] | https://github.com/openstack/fuel-web/blob/stable/8.0/nailgun/nailgun/orchestrator/provisioning_serializers.py#L131 |
[4] | https://github.com/gitfred/bareon-fuel-extension |
[5] | https://blueprints.launchpad.net/fuel/+spec/fuel-bareon-api-integration |
[6] | https://en.wikipedia.org/wiki/GRASP_%28object-oriented_design%29#Information_Expert |