forked from qiita-spots/qiita
-
Notifications
You must be signed in to change notification settings - Fork 0
Uncouple plugins #11
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
Closed
Closed
Uncouple plugins #11
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ed manually, but are obtained from an external identity provider
… API endpoints through the config file
…dpoint will be exposed
…meter for ENABLE_HTTPS_PLUGIN_FILETRANSFER is necessary, we simply expose these new endpoints, whatever
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When processing data via plugins, input and output files are located in ONE shared filesystem, i.e.
BASE_DATA_DIR
(andWORKING_DIR
for temporary files). This works well as long as the plugin process and Qiita pet & DB are operating within one machine or machines equipped with network file systems like slurm grids.We intend to host Qiita within a kubernets cloud environment. A plugin will become an independent docker image running as one or multiple pods. It would therefore be advisable to separate the central file system (Qiita pet & DB) from individual plugins, as this would slow boot up of plugin pods AND we might later distribute plugin jobs across multiple clouds. In this use case, transferring the whole
BASE_DATA_DIR
is infeasible.I understand the current flow as follows:
BASE_DATA_DIR
.My suggested flow is designed to require minimal changes for plugin codes, e.g. wrapping the filepath when reading / writing content with additional functions
fetch_file_from_central
andpush_file_to_central
to pull or push file content either directly from/to the filesystem (no change from what is done currently) or receive/push and create files in the plugin local or central filesystem, respectively.This PR adds two endpoints/functions to Qiita pet to send
qiita/qiita_pet/handlers/cloud_handlers/file_transfer_handlers.py
Line 15 in be38c10
qiita/qiita_pet/handlers/cloud_handlers/file_transfer_handlers.py
Line 61 in be38c10
Both endpoints are deactivated by default (to make Qiita behave as is) and can be activated by setting
qiita/qiita_core/support_files/config_test.cfg
Lines 53 to 57 in be38c10
True
).For higher performance, file content will be send through nginx instead of plain python/tornado. I thus had to fix the
/Users/username
prefix in the nginx example configuration file to match the actual filepaths.It's not yet clear to me, IF we need to add a mechanism to check if a plugin has permissions to access the requested file(s) from
BASE_DATA_DIR
. Currently, we "trust" the plugin via oauth credentials.This PR is accompanied by jlab/qiita_client#1 to equip the Qiita Client (part of every plugin) to handle according requests. The client can select between the current central
filesystem
mechanismhttps://github.com/jlab/qiita_client/blob/d9543c9575f0171620c17f4e87897ed5cf52a905/qiita_client/qiita_client.py#L783-L790
OR the novel file transfer through
https
https://github.com/jlab/qiita_client/blob/d9543c9575f0171620c17f4e87897ed5cf52a905/qiita_client/qiita_client.py#L792-L811
Both mechanisms return the actual filepath of the requested (and potentially transferred) files. This allows individual plugins to use different mechanisms, i.e. we don't need to migrate all plugins at once.
As only the plugin functions know which files they request / send as artifact components, we need to "decorate" file access in their individual implementations. Here is an example PR for qp-deblur: jlab/qp-deblur#1