-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat: Scanning plugin entrypoints of external packages #2377
feat: Scanning plugin entrypoints of external packages #2377
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @jopemachine and the rest of your teammates on Graphite |
fbca1c9
to
3c77df7
Compare
419a7e6
to
6f0fedf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um.. we need to support the scenario for developing plugins by cloning the repositories into plugins/
directory.
Do you have any better idea to it?
Even if That is, all plugins under the |
d440a95
to
0bd1596
Compare
I'm also considering to fix scie-based executables suffer from missing imports when executed inside the working copy, while they work fine when executed outside. |
…`plugin_checkout`
0bd1596
to
c396754
Compare
Okay, I'm going to preserve the plugin-checkout type for debugging purpose (the CLI), while skipping it in the loader mechanism. |
* It will be "overriden" by the python-package source. * Show more detailed guides about the situation. - Add a message to let users run `pip install -e` when there is only the plugin-checkout source without the python-package source. - Add a message to let users check `agent.toml` when the group name contains "accelerator".
Fix #2359, refs #1683.
Wheel distributions
This PR implements an automated process to extract
.whl
files found under the{base-dir}/wheelhouse
directory and add their source directories toPYTHONPATH
, so that they could be loaded without additional installation steps.Example:
./wheelhouse
directory../wheelhouse
.Tip
To distribute and install plugins that have external dependencies that the core does not use, you may utilize the
pip wheel
command to create a collection of wheel files and put it under thewheelhouse
directory, as the plugin loader will load all of them intoPYTHONPATH
.Note
When a Python wheel file is extracted, it contains:
ai
.){pkg-name}-{version}.dist-info/
entry_points.txt
METADATA
RECORDS
top_level.txt
WHEEL
{pkg-name}.libs/
(empty)We may simply insert the extracted directory into
sys.path
to make it importable, assuming that all dependencies of the wheel is already available in the venv.Plugin source checkouts
It also enhances the
backend.ai plugin scan
command (#2070) to explicitly display the plugin-checkout sources while skipping plugin-checkout sources when actually loading the plugins. Also added more detailed guides such as[agent].allowed-compute-plugins
checks when the group name contains "accelerator".You may enable the debug logging of the scan command itself by adding
--debug
option to theplugin
subcommand, like./backend.ai plugin --debug scan ...
.Example:
cuda
plugin into the./plugins
directory../backend.ai plugin scan backendai_accelerator_v21
:./py -m pip install -e plugins/cuda
../backend.ai plugin scan backendai_accelerator_v21
:Checklist: (if applicable)
📚 Documentation preview 📚: https://sorna--2377.org.readthedocs.build/en/2377/
📚 Documentation preview 📚: https://sorna-ko--2377.org.readthedocs.build/ko/2377/