Skip to content
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

warmup mode #2724

Open
akosyakov opened this issue Oct 7, 2022 · 5 comments
Open

warmup mode #2724

akosyakov opened this issue Oct 7, 2022 · 5 comments

Comments

@akosyakov
Copy link
Contributor

It is originally raise in Gitpod: gitpod-io/gitpod#12448
For very big projects it takes a while to import and reindex the project on the startup of container. Gitpod has a concept of prebuild, i.e. CI for dev containers. We would like to warm up Java LS or VS Code extension that on real container start it is loaded immediately.

@OLibutzki
Copy link

Seems to be related to #2723 - created 18 hours ago, right?

@akosyakov
Copy link
Contributor Author

IntelliJ has both shared indexes and warm up [1], i.e. warm up itself can be speeded up with shared indexes.

@snjeza
Copy link
Contributor

snjeza commented Oct 24, 2022

I have tested the https://github.com/snjeza/spring-boot/tree/gitpod-vscode project.
Java LS downloads the project dependencies and builds the project when starting it for the first time. It takes 5+ minutes on my computer.
Java LS has its workspace at /workspace/.vscode-remote/data/User/workspaceStorage/<workspace_hash>/redhat.java/jdt_ws.
You can look at the Java LS server log with

tail -f /workspace/.vscode-remote/data/User/workspaceStorage/<workspace_hash>/redhat.java/jdt_ws/.metadata/.log

or
View>Command Palette>Java: Open Java Language Server log

If gitpod stops Java LS properly it will start quickly.

Case 1:

  • close gitpod tab
  • open it
    or
  • close gitpod tab and stop the gitpod workspace
  • open it
    or
  • run Developer: Reload Window
    gitpod stops Java LS properly and Java LS saves its workspace.
    Java LS log:
!MESSAGE >> shutdown

!ENTRY org.eclipse.jdt.ls.core 1 0 2022-10-24 14:20:51.199
!MESSAGE >> exit

!ENTRY org.eclipse.jdt.ls.core 1 0 2022-10-24 14:20:51.802
!MESSAGE Shutdown received... waking up main thread

!ENTRY org.eclipse.jdt.ls.core 1 0 2022-10-24 14:20:51.809
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is stopping:

Java LS doesn't rebuild the project and starts in several seconds.
gitpod2

Case 2:

  • open the gitpod workspace in two tabs
    gitpod starts Java LS with a new Java LS workspace - /workspace/.vscode-remote/data/User/workspaceStorage/<workspace_hash>-1/redhat.java/jdt_ws
    Java LS rebuilds the project. It takes several minutes.

Case 3:

  • stop the gitpod workspace using gitpod UI with opened project tab
  • open it again
    gitpod doesn't stop Java LS gracefully.
    Java LS rebuilds the project.
    A solution: gitpod should stop VS Code as it does when closing the project tab.

@akosyakov
Copy link
Contributor Author

akosyakov commented Oct 25, 2022

@snjeza it is a bit another use case, Gitpod allow to configure prebuild of projects ahead of time: https://www.gitpod.io/docs/configure/projects/prebuilds It runs a headless workspace without VS Code to download dependencies, index and so on. We would like to run Java LS as part of it that when a user starts a new real workspace it looks like a restarted workspace in your example.

@snjeza
Copy link
Contributor

snjeza commented Oct 25, 2022

@akosyakov could you provide an example?
I have tried to add (https://github.com/snjeza/spring-boot/blob/gitpod-vscode/.gitpod.yml)

tasks:
  - init: ./gradlew publishToMavenLocal

but VS Code starts before ./gradlew build -x test is finished.

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

No branches or pull requests

4 participants