RETIRED, Fuel plugins
Go to file
Ilya Kutukov 56b0d8ffa4 Fuel plugin builder v5
- Now it is possible to deliver Fuel release configuration using the Fuel plugin
  [bp/release-as-a-plugin](https://blueprints.launchpad.net/fuel/+spec/release-as-a-plugin)
  Using flag ``is_release: true`` in ``metadata.yaml: releases:`` section you coud
  define new fuel release.
  Also you could define ``base_release: release_template.yaml`` inside release
  description to share single template between multiple releases.
- ``*_path`` directive in is now supported in ``metadata.yaml``.
  Now you could require folder, external file or merged glob output using keys
  like ``deployment_tasks_path: 'dt.yaml'``
- It is possible to define graphs linked with plugin or releases
  directive inside ``metadata.yaml``, see the examples.
- All yaml root files is not not required except ``metadata.yaml``.
- Templates and examples for the Fuel plugins package ``v5.0.0`` are added.
- Fuel plugin builder is refactored to make all configurations traceable and
  decouple logic working with file system with validation logic and building
  logic.
  [LP1539598](https://bugs.launchpad.net/fuel/+bug/1539598)
- Docker environment for building and creating plugins example.
- Experimental ``JSON`` manifests support added.
- Schemas are aligned with Fuel versions.
- Advanced build process reporting.
  Now FPB trying to detect all possible problems in plugin configuration
  and report them instead of failing of first of them and also could warn user
  without stopping execution.
- Now it is possible to build plugin package v4.0.0 without ``tasks.yaml``

Change-Id: I55d0313db7cd64ab16802a75ff0d9edd16782d01
Implements-blueprint: release-as-a-plugin
Closes-Bug: #1539598
Closes-Bug: #1552248
2016-10-13 16:19:23 +03:00
examples Added new plugin version with node & nic attributes support 2016-09-27 14:55:43 +03:00
fuel_plugin_builder Fuel plugin builder v5 2016-10-13 16:19:23 +03:00
.gitignore Fuel plugin builder v5 2016-10-13 16:19:23 +03:00
.gitreview Update .gitreview for new namespace 2015-10-17 22:25:44 +00:00
CHANGELOG.md Fuel plugin builder v5 2016-10-13 16:19:23 +03:00
CONTRIBUTING.rst Move to pbr and align repo with OpenStack practice 2016-03-10 16:03:01 +02:00
Dockerfile Fuel plugin builder v5 2016-10-13 16:19:23 +03:00
HACKING.rst Move to pbr and align repo with OpenStack practice 2016-03-10 16:03:01 +02:00
LICENSE Initial commit 2014-10-10 19:17:09 +04:00
MAINTAINERS Update MAINTAINERS 2016-03-07 18:06:50 +02:00
README.rst Fuel plugin builder v5 2016-10-13 16:19:23 +03:00
build_releases_plugin.sh Fuel plugin builder v5 2016-10-13 16:19:23 +03:00
requirements.txt Fuel plugin builder v5 2016-10-13 16:19:23 +03:00
run_tests.sh Move to pbr and align repo with OpenStack practice 2016-03-10 16:03:01 +02:00
setup.cfg Change Author credentials in setup.cfg 2016-03-24 13:44:49 +02:00
setup.py Move to pbr and align repo with OpenStack practice 2016-03-10 16:03:01 +02:00
test-requirements.txt Fuel plugin builder v5 2016-10-13 16:19:23 +03:00
tox.ini Fuel plugin builder v5 2016-10-13 16:19:23 +03:00

README.rst

Fuel Plugins

Starting with version 6.0, Fuel supports a Pluggable architecture.

Fuel plugins allow you to install and configure additional capabilities for your cloud, such as additional storage types and networking functionality. For example, a Load Balancing as a Service (LBaaS) plugin allows you to add network load balancing functionality to your cloud so that incoming traffic can be spread across multiple nodes. Or you might want to use a GlusterFS plugin so that you can use a Gluster file system as backend for Cinder volumes.

Finding Plugins

For production versions of plugins, including certified plugins, see Released Plugins Catalog.

For instructions on installing Fuel plugins, see Installing Plugins.

Finding documentation

You can find Fuel Plugins documentation in the following sources:

OpenStack Fuel-plugins Repository

This repository contains plugin example, and the Fuel plugin builder tool (fpb). The plugin code here might not be suitable for production use please see Released Plugins Catalog to download release versions of these and other Fuel plugins.

Creating your own plugins

Detailed instructions can be found in the Plugins Wiki page.

Plugins should be built using the fuel-plugin-builder (fpb) utility found in this repoistory or via pip. fpb will ensure that build steps as well as validation is performed prior to assembling a package.

Abbreviated instructions:

pip install fuel-plugin-builder
fpb --create fuel_plugin_name
fpb --build <path to plugin>

This will:

  • install fuel-plugin-builder
  • clone the fuel_plugin_example plugin with the name fuel_plugin_name
  • build the plugin .rpm package.

This is not working on my OS

You could find an example of docker setup creating and building plugin in shared library running:

tox -edocker

How Fuel plugin builder works

Fuel plugin builder entry point is ./cli.py file that provides cli command bindings to the ./actions.

Two actions are available:

  • create Creating bootstrap plugin file structure using files combining templates/* folders defined in ./versions_mapping.py
  • build Build plugin package using working directory.

Build involving 5 steps with according modules responsive for this step for given plugin package version.

  • Preloading (single for all)
  • Loading
  • Validation
    • Data schema checking
  • Package Build

Preloading is about opening metadata.yaml, looking for package version and choosing appropriate classes using ./version_mapping.py

Loading is performed by Loader class of given version that are know where to look for files how understand their formats, how resolve external references inside data. Loader output is a list/dict tree with metadata.yaml content as root. Loading report tree is attached to this list/dict structure and based on report status FPB deciding to continue build process or reject it providing failure report to developer.

Validation is performed by one of Validator classes located at ./validators folder, and taking list/dict data tree as input. Validator business logic taking data tree at parts and applying @check functions to this branches making report tree (consist of ReportNode) as output.

JSON Schema checks is the part of validation when we are getting sure that form of data tree branches or whole tree is valid. We are making plugins for Fuel so the data structure schemas is relying on fuel versioning (starting from v6.0) so you could easily express with which Fuel version your package validation should be compatible with. You could see this schemas located at ./schemas folder.

Building itself is a copying of files preserving their permissions and making rpm package based on metadata.yaml of your plugin, command line arguments and plugin_rpm.spec.mako with path defined in rpm_spec_src_path builder attribute resolved with this context to plugin_rpm.spec file.

All validation and loading processes are producing reports. Reports are the tree of ReportNode() instances. You could write messages with report_node.error('ERROR!'), report_node.warning('Warning!'), report_node.info('Info') attach one nodes to another with report_node.add_nodes(ReportNode('Im a child!'), ReportNode('Im too!')) And, what is the best option, you could render every tree branch as text log yaml and json documents just calling print report_branch_node.render('yaml').

How FPB and Fuel versions are aligned?

Fuel Plugin Builder <-> Fuel versions mapping:

Fuel FPB Tasks

6.0 - 1.0.0 - 0.0.0 6.0 - 1.0.1 - 0.0.0 6.0 - 1.0.2 - 0.0.1 6.1 - 2.0.0 - 1.0.0 6.1 - 2.0.1 - 1.0.0 6.1 - 2.0.2 - 1.0.0 6.1 - 2.0.3 - 1.0.0 6.1 - 2.0.4 - 1.0.0 6.1 - 2.0.4 - 1.0.0 7.0 - 3.0.0 - 1.0.1 8.0 - 4.0.0 - 2.0.0 8.0 - 4.1.0 - 2.1.0 9.1 - 5.0.0 - 2.2.0

Examples

Simple Fuel plugin examples you can find here:

https://github.com/openstack/fuel-plugins/tree/master/examples

Other Plugin repositories

Other locations known to have Fuel plugins. Note, these may not be supported by the Fuel team