Renku has several plugin hooks that can be used to add additional metadata and commands to the Renku CLI.
The following hooks are currently available:
Runtime plugins are supported using the pluggy library.
Runtime plugins can be created as Python packages that contain the respective entry point definition in their setup.py file, like so:
from setuptools import setup
setup(
...
entry_points={"renku": ["name_of_plugin = myproject.pluginmodule"]},
...
)
where myproject.pluginmodule points to a Renku hookimpl e.g.:
from renku.core.plugin import hookimpl
@hookimpl
def plugin_hook_implementation(param1, param2):
...
.. automodule:: renku.core.plugin.run :members:
This repository contains an implementation of an activity annotation plugin.
Command-line interface plugins are supported using the click-plugins <https://github.com/click-contrib/click-plugins> library.
As in case the runtime plugins, command-line plugins can be created as Python packages that contain the respective entry point definition in their setup.py file, like so:
from setuptools import setup
setup(
...
entry_points={"renku.cli_plugins": ["mycmd = myproject.pluginmodule:mycmd"]},
...
)
where myproject.pluginmodule:mycmd points to a click command e.g.:
import click
@click.command()
def mycmd():
...
An example implementation of such plugin is available here.
Additional workflow converters can be implemented by extending :class:`renku.domain_model.workflow.converters.IWorkflowConverter`. By default renku provides a CWL converter plugins that is used when exporting a workflow:
$ renku workflow export --format cwl <my_workflow>
.. autoclass:: renku.domain_model.workflow.converters.IWorkflowConverter :members:
We created a dummy implementation of such a converter plugin.
Additional workflow providers can be implemented by extending :class:`renku.domain_model.workflow.provider.IWorkflowProvider`. See :ref:`implementing_a_provider` for more information.
.. autoclass:: renku.domain_model.workflow.provider.IWorkflowProvider :members: