Extending the Python Cartridge Agent
When developing customized cartridges to run on top of PPaaS the default behaviour of the Python Cartridge Agent (PCA) will not be sufficient. In such cases you can extend the PCA. The extension points provided by the PCA trigger at specific times and allows users to capture events.
Example:Â PPaaS is currently configured to work with the GIT repository but if you are working with SVN then the PCA must be extended to work with SVN.
Â
PCA extensions
The PCA can be extended by implementing the following interfaces:
IArtifactCheckoutPlugin
This interface is implemented and registered as a
yapsi
plugin to override the default artifact checkout behaviour. It is responsible for cloning the remote repository on receiving the updated artifact event. The extension point is triggered every 10 seconds by default if theauto_checkout
setting is set totrue
.The time interval to trigger the extension point is defined in the
agent.conf
file.
IArtifactCommitPlugin
This interface is implemented and registered as a
yapsi
plugin to override the default artifact commit behaviour. It is responsible for committing modified files and pushing any changes to the remote repository. This extension point is triggered every 10 seconds by default, if theauto_commit
setting is set totrue
.The time interval to trigger the extension point is defined in the
agent.conf
file.
ICartridgeAgentPlugin
This interface is implemented and registered as a
yapsi
plugin. It will be executed on receiving certain Message Broker (MB) events. When registering theyapsi
plugin the MB event to be executed must be specified by setting a property namedDescription
to a comma separated list of MB events inyapsy-plugin
config file.For more information on the yapsy plugin framework.
IHealthStatReaderPlugin
This interface is implemented and registered as a
yapsi
plugin to override the default read behaviour of the health statistsics. The PCA periodically calculates the memory consumption and load average, and publish them to the CEP every 15 seconds. This plugin is responsible for reading the aforesaid values.
Â