-
Notifications
You must be signed in to change notification settings - Fork 50
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
[ENH] - Investigate moving to a plugin based architecture #929
Comments
Thanks! I'm not sure if we need a full plugin system (with discoverable entry points à la pluggy etc) or just an ad-hoc configurable backend where we swap different implementations of the same interface. Would be good to clarify that, but I'm partial to not using
Maybe we need several interfaces for each stage (solve, lockfile, link to disk), or maybe they are different methods of the same interface. To be seen. |
I started working on a prototype here main...soapy1:conda-store:plugin-demo if you want to take a look. This set's up 2 plugins for conda lock (the implementation of the plugins is the same, except for their names and logging - so that I can test swapping between plugins). Some notable things in the prototype (at this point):
Some things on my radar to look into:
|
I setup another little demo using pluggy as the plugin manager main...soapy1:conda-store:plugin-demo-pluggy. I think this approach is also ok. It's nice that pluggy takes care of some things like enforcing a stricter adherence to a hookspec. However, pluggy will execute all registered plugins. Which means we need to sort out the issue of working out something like a "task context" for every task that gets run. The task context would be responsible for doing stuff like registering all the appropriate plugins (and then deregistering them if appropriate). Some pros and cons of pluggy vs a home rolled plugin manager:
|
Providing a little update here. I've pushed some more changes to main...soapy1:conda-store:plugin-demo-pluggy Some notable things that this adds:
There are definitely ways this can be extended. Some other ideas that would be nice to explore
|
This is excellent @soapy1! So much progress! 🚀
Isn't this done by pluggy already via Python entry points? 🤔 |
Kind of. Pluggy provides tools for registering user plugins pretty easy. But we don't want to load all available plugins all the time. For example, if we have 3 storage plugins, we usually only care about having one configured. Right now this is resolved with the addition of the plugin registry main...soapy1:conda-store:plugin-demo-pluggy#diff-7266bb101b347632218746795c39cf8a2917ecf1f87b72bc2a4e7dbd50133db4. We'll still need to do some work on the plugin registry side to discover user plugins. But I think we can borrow some ideas from pluggy to make this work. |
Feature description
There are currently lots of tools in the python packaging/environment space including:
It would be nice to be able to swap out backends for doing actions like solving, locking and package management.
Value and/or benefit
Using a plugin based system conda store developers will be able to quickly experiment with new technologies to integrate into conda-store.
Anything else?
Start with a prototype of conda-store using plugins for locking. So, conda-store should have all the same functionality with a configurable locking mechanism.
The text was updated successfully, but these errors were encountered: