-
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
Support running multiple VS Code extensions in the same sidecar #12395
Comments
In my discussion with @benoitf a couple of months ago, the idea was to collect plugins that reference the same docker image and run them on the same container per workspace. As far as the plugins are concerned this should be completely transparent and automatic. |
@tsmaeder +1 |
Yes, as it seems we do not get the extensions from other sidecars through the plugin system. VSCode-Java scans them in order to find stuff from their package.json. My assumption was that we would get those, if they are visible on the file system. |
Ok thanks @tsmaeder @ibuziuk @garagatyi we miss that during prioritization. Can you guys help to add it to next sprint planning? |
@ibuziuk this is the issue, why should we open a new one? @garagatyi we should now have all the missing pieces now and it should be just a matter of deciding how a plugin developer can specify (in meta.yaml or che_plugin.yaml) that its plugins will run in the same container. A simple rule would be that all the plugins that use the same sidecar image should run in the same container. |
@l0rd got it, thanks |
added to the next sprint prio doc |
While I think reusing containers is a good thing, would it be a start to just have multiple theia or vs code plugins in a single Che 7 plugins? |
@tsmaeder do you mean specifying in meta.yaml: attributes:
extensions: "vscode:extension/SonarSource.sonarlint-vscode,vscode:extension/ms-vscode.node-debug" or attributes:
urls: https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/java/0.38.0/vspackage,https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/vscode-xml/0.3.0/vspackage ? |
Format of attribute is ugly, but would be easier to implement without changing structure. id: blah
version: blah
attributes:
blah
urls:
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/java/0.38.0/vspackage
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/vscode-xml/0.3.0/vspackage or even id: blah
version: blah
attributes:
blah
extensions:
- vscode:extension/SonarSource.sonarlint-vscode
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/java/0.38.0/vspackage
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/vscode-xml/0.3.0/vspackage |
@garagatyi that's nice |
I will bring also support of plug-ins/theia endpoint in a Docker Image/container. |
@benoitf at the moment we take remote plugin publisher and name from package.json and use it to set env var to Theia container to discover this remote plugin. What should we do in a case of several plugins? Should we inject an env var for each of them? |
I'm planning to implement next case: id: blah
version: blah
attributes:
blah
extensions:
- vscode:extension/SonarSource.sonarlint-vscode
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/java/0.38.0/vspackage
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/vscode-xml/0.3.0/vspackage If you have any objections or would want to go to another direction, please, comment here |
@garagatyi yes
|
This is not clear for me. If I not expose any ports in the sidecar container how Theia connects to the sidecar? Is there any docs/explanation on how this works(maybe detailed PR description or at lest code)? |
Oh, I see. I thought we were thinking about splitting workspace to several deployments at some point. Is the 3rd way of sidecars discovery is supposed to be the approach we should implement instead of what we have now with endpoints? |
I would say it's kind of cumulative. If you do know that all sidecars are in the same network: no need to provide remote endpoint URL (and expose the port publicly). If there is a remote sidecar (not in a pod) then it needs to be announced with ENV variable to main instance of theia |
all the mechanisms are still there. But for example in development mode, with discovery, it avoids to declare/define some env variables as it can be automatically detected. |
@benoitf I see. In a several extensions per sidecar case we have to declare env vars for each extension. Let's imaging we have 3 extensions in the Java Language support Che plugin - JDT.LS, Java debug, Gradle (let it be a separate extension for the example).
|
you can use also now for main theia instance: (only one property per sidecar endpoint address)
for sidecar (sidecar12345:10234)
|
yes, only one websocket connection. |
Thanks for the details |
Implementation of automatic collapsing extensions to the same sidecar can be complicated by devfile -> workspace conversion algorithm. Implementation details for context to help implementing this later: Here is an example (for demonstration purposes - correct devfile syntax is not preserved): ...
tools:
- type: ChePlugin
id: myplugin:0.0.1
commands:
- name: my command for a specific plugin
command: ["bash", "-c", "do cool stuff"]
tool: myplugin:0.0.1
... Then Che 7 code receives plugin info from brokers: id: myplugin
version: 0.0.1
containers:
- image
... It generates machine representation of the container from a plugin and put machine name into command attributes. // plugin
- id: myplugin1
version:0.0.1
containers:
- image:
envVars:
- name:
value:
workspaceEnv:
- name:
value:
- id: anotherplugin
version: 0.30.0
containers:
- image:
envVars:
- name:
value:
workspaceEnv:
- name:
value: use list of tooling configs that can contain 1..n plugins identifiers and sidecars: // tooling entry
- plugins:
- id: myplugin
version: 0.0.1
- id: anotherplugin
version: 0.30.0
containers:
- image:
envVars:
- name:
value:
workspaceEnv:
- name:
value:
// tooling entry
- plugins:
- id: theia-editor
version: 0.0.1
containers:
- image:
envVars:
- name:
value:
workspaceEnv:
- name:
value:
// tooling entry
- plugins:
- id: exec
version: 0.0.1
containers:
- image:
envVars:
- name:
value:
workspaceEnv:
- name:
value: With such a format on master we can do commands matching in next way:
@sleshchenko since you implemented commands matching, please, read implementation details and let me know if you agree with the issue I described and possible solution. At the moment I'm going to finish implementation of plugins that contains several extensions and postpone implementation automatic sidecars configs collapsing. |
PR #12903 adds an ability to create Che plugin that provisions several VS Code extensions in a single Theia plugin runner sidecar. See description in the PR and here is the demo https://youtu.be/tu8LVNSLLA0 |
Here is an issue that explains the situation I'm referring to #12904 |
@tsmaeder I've just merged PR #12903, so you should be able to try it out on nightly tomorrow or today after manual rebuild of Che master image. |
@benoitf FYI I used the old way of configuring sidecars since reworking it to a new way with extensions files isolated in sidecar container requires refactoring of brokering process and it wasn't the goal of the current scope of the task. |
@garagatyi sure old way is still working, but it was to inform you about future usage. |
@l0rd @tsmaeder are you ok to close this issue. For improvements of the current approach, there is already redhat-developer/rh-che#1354 |
@ibuziuk I don't understand how multicast discovery addresses running multiple plugins in the same container. If you don't think that is a goal to pursue anymore, that's something we can discuss. |
@tsmaeder multicast discovery is not related to this issue per se, but improves internal implementation. In Che 7 GA epic multicast discovery is not treated as a subtask of this issue. |
Closing as done |
Description
This is something needed to properly support JDT LS extensions. We should be able to define a list of VS Code extensions to run in the same container as an original VS Code extension (e.g. JDT ls).
The text was updated successfully, but these errors were encountered: