Out-of-process plugin
Goal: declare a plugin written in another language and run it over stdio or HTTP.
Prerequisites
- The plugin's command or service, built and runnable from the worker.
Steps
-
Choose how the plugin runs: as a child process (stdio) or as a service (HTTP). Both speak JSON-RPC 2.0.
-
Declare it with the
Pluginkind, with the command that starts it and the environment variables it needs:apiVersion: afe.dev/v1alpha1kind: Pluginmetadata:name: my-pluginspec:transport: stdiocommand:- my-plugin- serveenv:MY_PLUGIN_TOKEN: "${MY_PLUGIN_TOKEN}" -
Run a flow. The engine calls
describeto learn the ports, then oneinvokeper port call. It is the same contract as an in-process plugin.
Notes
A stdio plugin receives only PATH, HOME and the variables declared in its manifest. No
engine secret ever enters it.
Troubleshooting
plugin 'my-plugin' did not start: [Errno 2] No such file or directory: 'my-plugin'
The command names a binary the worker cannot find on PATH. Install the plugin on the worker,
or use an absolute path in command.
plugin 'my-plugin' did not answer 'describe'
The child process started, but did not reply within the transport's timeout. Check the plugin's
own logs on stderr, and that it speaks line-delimited JSON-RPC 2.0 on stdout.
plugin 'my-plugin': <message>
The plugin replied with a JSON-RPC error. The message is the plugin's own. Read it against the
plugin's documentation or source.