Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: custom plugins without forking #454

Open
tom-sherman opened this issue Feb 18, 2024 · 5 comments
Open

Question: custom plugins without forking #454

tom-sherman opened this issue Feb 18, 2024 · 5 comments

Comments

@tom-sherman
Copy link

The docs mention forking as the way to add custom plugins. Has you considered publishing conductor as a crate so that custom plugins can be configured that way? It seems like this would allow for clearer API boundaries within the plugin API and require less setup for folks wanting to write their own plugins.

@YassinEldeeb
Copy link
Contributor

Hey @tom-sherman!

Has you considered publishing conductor as a crate so that custom plugins can be configured that way?
It seems like this would allow for clearer API boundaries within the plugin API and require less setup for folks wanting to write their own plugins.

We have many internal crates for Conductor's dependencies, one of which is the engine crate which takes care of the initialization of all the used/requested plugins in the configuration file, and imports all of the individually managed crates for the plugins. Also the engine depends on the PluginDefinition struct within the config crate, which defines all of the possible values for the configuration file when extending a plugin for schema validation.

I don't think there's a feasible way to publish a certain crate where it's easily configurable, there are many parts of adding a new custom plugin, but I may be misunderstanding.

Can you please elaborate on which crates exactly can be published that can ease adding custom plugins? and how would someone add a custom plugin with the suggested workflow?

@YassinEldeeb
Copy link
Contributor

YassinEldeeb commented Feb 18, 2024

Also is it possibly related to #433? 👀

@dotansimha
Copy link
Member

dotansimha commented Feb 18, 2024

@tom-sherman thank you for reporting this issue. We are still in an early phase but we do want to make sure to address this use case.

In addition to what @YassinEldeeb wrote, you can use VRL language to create custom plugins (https://the-guild.dev/graphql/gateway/docs/plugins/vrl) via config, without the need to fork or compile anything.

@tom-sherman we can publish the common create if you need type definitions for creating custom plugins (you basically need trait Plugin and trait CreatablePlugin). Still, I'm not sure I understand how that will help with creating custom plugins? At the moment we don't have a way to load an external artifact, so eventually, you'll still need to fork and compile Conductor from scratch to load your plugin and make sure it compiles with the binary.

Also, can you maybe share what kind of plugin you are planning to implement? It can help us to understand the use case and look for possible solutions.

@tom-sherman
Copy link
Author

I'll come back around when I'm at my desk tomorrow to explain this a bit more. But I was thinking the ability to wrap the gateway in my own web server code, and load my own plugins from there. Essentially implement my own run_services.

@dotansimha
Copy link
Member

Hi @tom-sherman , just wanted to check if there's an update on this matter? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants