Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

[java-docker] use builtin and external ext #287

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

vince-fugnitto
Copy link
Member

What it does

Update the theia-java-docker:next image to include builtins and external VS Code extensions

How to test

Build and verify the changes (that plugins are downloaded and picked up when started)

Review checklist

Reminder for reviewers

Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com

@akosyakov
Copy link
Member

@marcdumais-work @vince-fugnitto Would be fine If i do theia-ide/theia?

One important thing is Electron. It is not clear how to bundle extensions yet. An end user cannot use env variables or cli options to pick up extensions, they should be inside the bundled app and picked up automatically.

@vince-fugnitto
Copy link
Member Author

@marcdumais-work @vince-fugnitto Would be fine If i do theia-ide/theia?

Please go ahead :) I wanted to try it out for an example image (java) so I could iron out any details and see what needs to be done for other images.

One important thing is Electron. It is not clear how to bundle extensions yet. An end user cannot use env variables or cli options to pick up extensions, they should be inside the bundled app and picked up automatically.

I believe @lmcbout had some experience picking up plugins for Electron applications if we get blocked.

@akosyakov
Copy link
Member

akosyakov commented Jan 22, 2020

I believe @lmcbout had some experience picking up plugins for Electron applications if we get blocked.

I've seen the issue on Theia repo where it was recommended to configure an env variable, but for builtins it is not how it should work. A user should download distributable, run it and VS Code extensions should be there already, without changing any env variables. I have not seen anyone to figure it out and it will be important for all Electron based products if we remove textmate grammars Theia extension.

@marcdumais-work
Copy link
Member

I believe @lmcbout had some experience picking up plugins for Electron applications if we get blocked.

I've seen the issue on Theia repo where it was recommended to configure an env variable, but for builtins it is not how it should work. A user should download distributable, run it and VS Code extensions should be there already, without changing any env variables. I have not seen anyone to figure it out and it will be important for all Electron based products if we remove textmate grammars Theia extension.

In our current internal application we do have the built-ins and some extra VS Code extensions part of the bundle (MSI installer for Window, AppImage for Linux). We have our own version of electron-main.js that's used as entry-point, and where we inject env var THEIA_DEFAULT_PLUGINS pointing it to the bundled plugins folder.

So it does rely on the env var mechanism but the user needs not set it or care about it. This leaves env var THEIA_PLUGINS to point to a folder on the host, where the user or eventually our extensions manager could install their own extensions.

@akosyakov
Copy link
Member

We have our own version of electron-main.js that's used as entry-point, and where we inject env var THEIA_DEFAULT_PLUGINS pointing it to the bundled plugins folder.

Does not sound super clean :) Can we generalize it in Theia to a solution without using custom electron-main.js?

@marcdumais-work
Copy link
Member

Does not sound super clean :) Can we generalize it in Theia to a solution without using custom electron-main.js?

Sure. Maybe the plugins system could look-for a plugins folder at a given path relative to the app, that would be used if present, without depending on any env var? Or maybe you have other ideas.

For reference, he're how we do it ATM in our custom electron-main.js:

process.env.THEIA_DEFAULT_PLUGINS = `local-dir:${resolve(__dirname, '..', '..', '..', '..', 'plugins')}`;

@akosyakov
Copy link
Member

Maybe the plugins system could look-for a plugins folder at a given path relative to the app, that would be used if present, without depending on any env var?

No ideas, i don't have much experience with Electron. We can try whatever you propose. Maybe someone come up with a better idea on the PR.

@akosyakov
Copy link
Member

Let's move a discussion here: eclipse-theia/theia#6946

@vince-fugnitto
Copy link
Member Author

Unfortunately, we cannot successfully update the applications until @theia/cli is released.
We cannot include @theia/cli:next in the latest.package.json since it pulls @theia/application-package (used by many extensions) and will cause a multi injector error on startup.

We either need to:

  • release a hotfix with the update @theia/cli so we can update the images ahead of the release (gives us time to update the images, gives others extra time to adopt their applications to the builtins)
  • wait a week for the release and proceed with the general updates (with many other things to update before we can deprecate extensions anyway, maybe this approach is fine)

@akosyakov
Copy link
Member

akosyakov commented Jan 24, 2020

@vince-fugnitto yes, it won't work, but we can upgrade next images for now?

Unfortunately it won’t work either since I reference the download:plugins script in the Dockerfile. In the case of the latest Images this command will fail since it does not exist :(

@@ -15,20 +15,89 @@
"@theia/file-search": "next",
"@theia/getting-started": "next",
"@theia/git": "next",
"@theia/java": "next",
"@theia/json": "next",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe we're keeping this one because the json built-in is not working yet?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, the vscode-builtin-json-language-features is not yet working so I could not add it at this time (eclipse-theia/theia#6623).

vscode-builtin-json is included to add JSON syntax highlighting and snippet support since @theia/textmate grammars is removed.

"@theia/search-in-workspace": "next",
"@theia/terminal": "next",
"@theia/textmate-grammars": "next",
"@theia/tslint": "next",
"@theia/typescript": "next",
"typescript": "latest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed?

I wasn't sure, it looks like all images include typescript as a dependency.

@marcdumais-work
Copy link
Member

marcdumais-work commented Jan 28, 2020

Got these errors:

image

Maybe setting JAVA_HOME so it points to the JDK instead of the JRE would help: "/opt/ibm/java/" ? (line 7 in Dockerfile)

update: confirmed by setting java path through a preference, then the LS starts.
update2: maybe it would be best to leave JAVA_HOME as-is and add JDK_HOME? This seems to be what's suggested in the extension's documentation

@marcdumais-work
Copy link
Member

I tested a bit with a few sample Java projects. Once the JDK path issue is fixed, the image seems to work decently well. So looking good so far.

- updated the `theia-java-docker:latest` image to use builtins and external VS Code extensions.
- updated the `theia-java-docker:next` image to use builtins and external VS Code extensions.
- updated the `JAVA_HOME` environment variable

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
@vince-fugnitto
Copy link
Member Author

@marcdumais-work I've updated based on previous feedback, and since @theia/cli has been released last week both the latest and next images can benefit from the download:plugins script (used for example to pull builtin plugins).

Copy link
Member

@marcdumais-work marcdumais-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - quickly tested both next and latest - both compile and start, both successfully spawn the Java LS.

@marcdumais-work
Copy link
Member

Merging

@marcdumais-work marcdumais-work merged commit 622d432 into master Feb 4, 2020
@marcdumais-work marcdumais-work deleted the vf/java-builtins branch February 4, 2020 11:39
@vince-fugnitto
Copy link
Member Author

@marcdumais-work @vince-fugnitto Would be fine If i do theia-ide/theia?

@akosyakov do you still plan on migrating the theia-docker image?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants