You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by chamilad <gi...@git.apache.org> on 2015/02/19 06:04:52 UTC

[GitHub] stratos pull request: [STRATOS-1180] - Yapsy based plugin architec...

GitHub user chamilad opened a pull request:

    https://github.com/apache/stratos/pull/234

    [STRATOS-1180] - Yapsy based plugin architecture for PCA

    A basic plugin system where <PCA_HOME>/plugins folder can be used to drop plugins to be picked up by the PCA. For this I've used Yapsy[1] plugin framework.Yapsy is both simple and effective in enabling a plugin structure in Python. It is BSD licensed so there is no conflict in licensing for incorporating it, if the need arises. 
    
    Implementing a plugin for the PCA is simple. The plugin contract is defined in <PCA_HOME>/plugins/contracts.py module. To write a plugin contracts.ICartridgeAgentPlugin has to be extended. Additionally a plugin descriptor (with yapsy-plugin extension) has to be included which will describe and point to the plugin module file, when queried by the Yapsy framework. To map a plugin for a certain event, the event name has to be specified in the Description field. By this approach, it is possible to map more than one plugin to a single event and one plugin to several events. Each plugin is run in a separate thread, therefore, it will not be blocking the main execution.
    
    A plugin gets a dictionary with the payload parameters and any additional values included for specific events. This is more effective than the environment variables approach we had for bash scripts. 
    
    A test plugin can be found in the <PCA_HOME>/plugins which demonstrates the plugin architecture. This plugin is mapped to the MemberInitializedEvent and the ArtifactUpdatedEvent.
    
    PCA was tested in an OpenStack deployment for regression and functionality. 
    
    [1] - http://yapsy.sourceforge.net/

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chamilad/stratos stratos-1180-01

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/stratos/pull/234.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #234
    
----
commit f4be9ce8b37f4121b461d55fd9aa0b3daf773516
Author: Chamila de Alwis <ch...@wso2.com>
Date:   2015-02-14T11:21:03Z

    PCA plugin architecture with Yapsy
    Dockerfile updated to install Yapsy
    Refactored Exceptions
    Refactored event handling
    PEP style related changes

commit 6b938f65a09c082dd6ba95830e120a2832fdc020
Author: Chamila de Alwis <ch...@wso2.com>
Date:   2015-02-14T15:19:36Z

    PCA -
    Fixed issues in plugin execution
    Added test plugin
    PEP style related changes
    Fixed import errors

commit 4c253ea2251d012f04e49e870087d08c17fe1803
Author: Chamila de Alwis <ch...@wso2.com>
Date:   2015-02-14T15:21:39Z

    PCA - fixed PEP style hints in constants module

commit 2cb93ca72e1606859fadb40d7daa968a1afeed35
Author: Chamila de Alwis <ch...@wso2.com>
Date:   2015-02-14T19:08:20Z

    PCA - A single plugin can be mapped to multiple events

commit 3528415ebc118b777837ee03e7e13647f869dd05
Author: Chamila de Alwis <ch...@wso2.com>
Date:   2015-02-19T04:58:44Z

    PCA - Yapsy based plugins - Added yapsy pip install to PCA puppet module

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] stratos pull request: [STRATOS-1180] - Yapsy based plugin architec...

Posted by imesh <gi...@git.apache.org>.
Github user imesh commented on the pull request:

    https://github.com/apache/stratos/pull/234#issuecomment-75016467
  
    Thanks for the pull request @chamilad! It looks good! IMO it would be better to introduce a packaging model for plugins using zip to make it easier to distribute and deploy.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] stratos pull request: [STRATOS-1180] - Yapsy based plugin architec...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/stratos/pull/234


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---