-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Theia Plugin Broker #11146
Comments
@l0rd @sleshchenko @skabashnyuk We probably need to think through the way how (and where) we would define the plugin broker that needs to be used for a plugin delivery. |
@skabashnyuk but an editor can run different types of plugins (e.g. theia can run che plugin and theia plugin for instance) @garagatyi I was thinking that's defined in the Plugin Type: https://github.com/eclipse/che-plugin-registry/blob/master/plugins/che-service-plugin/0.0.1/meta.yaml#L |
@l0rd yeah, we can use plugin type to find a broker implementation that needs to be used.
|
@garagatyi good questions: For the first question I think we should do what you mentioned in point 1.1. |
FYI I've updated issue description |
@benoitf what about using labels on containers instead of environment variables to let Theia discover its plugin? |
@l0rd discussion is open. I thought it is easier to grab env variables than having access to labels when you're inside the container. |
@l0rd @benoitf To be on the same page I would want to sync on the expectations for the current stage.
If I'm missing something or you believe that we agreed on something else, please, comment. |
I thought that we decided that broker was working directly with .theia file (no .tgz archive) and info coming from package.json inside the .theia file. (.theia file is a zip file) about 4. when we discussed we agreed on
about 5. it will receive only one ENV VAR |
@garagatyi with @benoitf corrections looks good to me. Just one thing: why do we need to mount the |
@benoitf another concern I have is how the broker is supposed to know what is the sidecar docker image (step 3.)? In the |
@l0rd
We said that we supported usecase of plug-ins outside of the image first, so it needs to be accessible in some ways
@l0rd , the approach used by @garagatyi was to add in che-plugin.yaml id: che-fortune-plugin
name: fortune
containers:
- name: theia-fort-pl
image: wsskeleton/fortune
memory-limit: "700Mi"
volumes:
- mountPath: "/plugins"
name: plugins
- mountPath: "/projects"
name: projects but in .theia file, in package.json there is usage of the container https://github.com/ws-skeleton/che-fortune-plugin/blob/master/package.json#L27 so it can be read from there as well |
@benoitf How do you think do we need this issue or it is kinda outdated? |
@garagatyi well, now endpoint is handling all usecases so broker still need to be updated to handle these AFAIK (like supporting plug-ins directly inside the image, etc) |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Description
We need a plugin broker that would be simpler than current Che plugin broker and deliver only Theia specific plugins into a workspace. This task would include the way to configure a custom plugin broker (in a sidecar definition?) and implementing the broker.
It would simplify the packaging of a Che plugin that contains only a Theia plugin.
Broker
For each type of plug-in hosted on plug-in registry, a broker is called.
Broker is a docker container accepting a specific type of plug-ins (like Che plug-in, etc) and returning a set of
For example, it can extract metadata from a plug-in, grab the link of a plug-in, download the file and copy it over a mounted folder.
A broker is pluggable.
Theia can come with its own broker: it would avoid to package .theia plug-ins inside che plug-ins. This broker would wrap automatically .theia files with the associated theia editor
JDT.LS could also provide its own broker for copying for example all jdt.ls addons to a directory like /jdt.ls.addons
Theia plug-ins inside of Che.
background
Theia is running by default all extensions and plug-ins on the same host.
It means that if a plug-in foo requires the foo tool, this tool needs to be installed on the host.
For example if a plug-in might want to compile a .java file, then javac should be there.
A plug-in can be run on the browser side or on the backend side (as a new process)
Che and workspace.next
In Eclipse Che, it is now possible to use sidecars for the workspace.
Let see how to apply this pattern to theia plug-ins.
Usecase 1: hello world theia plug-in.

In this case, the plug-in has no external dependency, it’s pure nodejs so there is no need to use a dedicated container
Usecase 2: openshift theia plug-in.

In this case, the plug-in has external dependency to oc tool, so there is the need to use a dedicated container. Plug-in is loaded from a shared filesystem like /theia-plugins
Usecase 3 : same than before but plug-in is embedded inside the image

Theia plugin-ext runtime will find this plug-in as it is for example in /embedded-theia-plugins folder
Usecase 4 : I have 5 plug-ins using the same version of oc tool. So it could spawn each plugin in its own container (like usecase 2) but instead, these 5 plug-ins could share the same container

Usecase 5: I have 5 plug-ins using oc tool. 3 of them rely on oc v3.5, 2 of them on oc v3.6
In that case, they will be grouped by runtime docker image:
Theia broker
The broker will be responsible of picking up required containers for the given set of theia plug-ins and providing endpoints to remote “plugin runtime” (provide a list of all endpoints and probably assign some ports for each theia remote endpoint.
Example for the latest use case:
Broker will return oc 3.5 container (C1), oc 3.6 container (C2) to the workspace.next engine
It will also assign the port 10000 for theia endpoint C1 with name : theia-endpoint-oc35, 10001 for theia endpoint in C2 with name theia-endpoint-oc36
It will provide that data to the theia container:
Can be through env var like
1/ env variables
THEIA_ENDPOINT_OC35_IMAGE=eclipse/che-oc3.5
THEIA_ENDPOINT_OC35_PORT=10000
THEIA_ENDPOINT_OC35_NAME=theia-endpoint-oc35
THEIA_ENDPOINT_OC36_IMAGE=eclipse/che-oc3.6
THEIA_ENDPOINT_OC36_PORT=10001
THEIA_ENDPOINT_OC36_NAME=theia-endpoint-oc36
2/ file
Or through a file that theia can get
All plug-ins are copied into /che-theia-plugins
Main Theia process, on start, will read all these plug-ins metadata, decide which plug-ins will run on which “theia runtime” and will distribute plugins loading order to all “remotes”.
It will distribute to C1 endpoint the order : load plugin1, plugin2 and plugin3
It will distribute to C2 endpoint the order : load plugin4 and plugin5
The text was updated successfully, but these errors were encountered: