-
Notifications
You must be signed in to change notification settings - Fork 122
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
Storage layer plugin based on go plugin
#443
Comments
We need to add an init-plugin script to initialize the plugin directory, with a directory like https://github.com/clusterpedia-io/sample-storage-layer $ init-plugin.sh github.com/iceber/new-storage
$ ls -al new-storage
-rw-r--r-- 1 icebergu staff 28 11 4 14:37 .dockerignore
drwxr-xr-x 13 icebergu staff 416 11 4 14:59 .git
-rw-r--r-- 1 icebergu staff 101 11 1 15:03 .gitignore
-rw-r--r-- 1 icebergu staff 107 11 3 14:35 .gitmodules
-rw-r--r-- 1 icebergu staff 260 11 4 14:56 Dockerfile
-rw-r--r-- 1 icebergu staff 1183 11 4 14:57 Makefile
drwxr-xr-x 33 icebergu staff 1056 11 4 14:54 clusterpedia
-rw-r--r-- 1 icebergu staff 2376 11 3 14:37 go.mod
-rw-r--r-- 1 icebergu staff 46109 11 3 14:37 go.sum
-rw-r--r-- 1 icebergu staff 139 11 4 10:42 main.go
drwxr-xr-x 3 icebergu staff 96 11 4 13:30 plugins
drwxr-xr-x 16 icebergu staff 512 11 4 13:21 storage
drwxr-xr-x 9 icebergu staff 288 11 4 14:40 vendor |
|
And both the storage layer plugin repository and the storage layer plugin name are recommended to be suffixed with storage, e.g. *-storage |
/assign |
/assign calvin0327 |
I suggest we use *-storage for module name, repository name and image name, use * as the plugin registration name without "-storage". |
I'm a newbie, can I get involved too? |
What would you like to be added?
Clusterpedia works with different storage components such as MYSQL/Postgres, memory or ES through a storage layer.
Currently these storage layers need to be compiled into Clusterpedia components, and users who want to implement their own storage layers need to recompile Clusterpedia to build new images.
We want an open mechanism that allows users to freely interface to any storage layer without the performance loss associated with external storage layers.
Usually the RPC is a less invasive and more decoupled plug-in option, but the performance loss due to resource serialization and deserialization can have a significant impact on Clusterpedia components.
So we decided to use the Go Plugin and provide a series of scripts and images to simplify user implementation of the storage layer plug-in.
With the storage layer plugin based on Go Plugins, Users can
How do users use the storage layer plugin?
Local developing and running
Clusterpedia provides the hack/builder.sh script, so you can use hack/builder.sh to compile Clusterpedia components and storage layer plugins separately,
and then specify the plugins directory through the environment variable
STORAGE_PLUGINS
when running Clusterpedia components.Example:
Deploying with helm
Clusterpedia provides use cases for building plug-in images in https://github.com/clusterpedia-io/sample-storage-layer, and users can refer to the use case scripts to build plug-in images
Helm will support setting up the storage layer plugin image, Clusterpedia Pod will copy the plugins from the storage layer plugin image to the container's plugin directory, and then set the name of the storage layer plugin
Example:
Tasks that support storage layer plugins
go plugin
to register storage layer plugins #436TODO:
The text was updated successfully, but these errors were encountered: