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

[jb] enable vmoptions config in .gitpod.yml #10768

Merged
merged 1 commit into from
Jun 25, 2022

Conversation

yaohui-wyh
Copy link
Contributor

@yaohui-wyh yaohui-wyh commented Jun 20, 2022

Description

Add vmoptions in gitpod schema (.gitpod.yml).

jetbrains:
  intellij:
    vmoptions: "-Xmx4g"
  goland:
    vmoptions: "-Xmx3g"

Related Issue(s)

Remedy for #8704

How to test

Build & test status from a Gitpod workspace

  • Start Gitpod workspace from this PR: https://gitpod.io/#https://github.com/gitpod-io/gitpod/pull/10768
  • Modify project's .gitpod.yml and insert a jetbrains.intellij.vmoptions field with value "-Xmx4g"
  • Launch a new Terminal and build the status binary: cd /workspace/gitpod/components/ide/jetbrains/image/status && go build. Replace the status binary: rm /ide-desktop/status; cp status /ide-desktop/status
  • Kill the status process: ps aux | grep status; kill -9 <pid>
  • (supervisor restart status immediately) Check JetBrains IDE server VMOptions: jps -mlv | grep intellij | grep -i xmx

Expected result:

  • IDE Server should be running with -Xmx4g

Release Notes


- Allow customize VMOptions for JetBrains backend server, by setting "vmoptions" in .gitpod.yml

Documentation

@akosyakov
Copy link
Member

@yaohui-wyh I left some comment could you address please? We will need also a PR for docs which:

Don't forget to mention everywhere that this functionality is alpha and the can leave feedback about performance on #8704

@yaohui-wyh
Copy link
Contributor Author

@yaohui-wyh I left some comment could you address please? We will need also a PR for docs which:

Don't forget to mention everywhere that this functionality is alpha and the can leave feedback about performance on #8704

Sure, I'm glad to add a PR for docs :)

components/ide/jetbrains/image/status/main.go Outdated Show resolved Hide resolved
components/ide/jetbrains/image/status/main.go Outdated Show resolved Hide resolved
components/ide/jetbrains/image/status/main.go Outdated Show resolved Hide resolved
@akosyakov
Copy link
Member

akosyakov commented Jun 22, 2022

/werft run

👍 started the job as gitpod-build-yh-vmoptions-fork.0
(with .werft/ from main)

@akosyakov
Copy link
Member

@yaohui-wyh Could you have a look the build does not pass:

[components/local-app:app-linux-amd64] ?   	github.com/gitpod-io/local-app/pkg/bastion	[no test files]
[components/ide/jetbrains/image/status:app] === RUN   TestGetProductConfig
[components/ide/jetbrains/image/status:app] --- PASS: TestGetProductConfig (0.00s)
[components/ide/jetbrains/image/status:app] === RUN   TestParseGitpodConfig
[components/ide/jetbrains/image/status:app] --- FAIL: TestParseGitpodConfig (0.00s)
[components/ide/jetbrains/image/status:app] panic: runtime error: invalid memory address or nil pointer dereference [recovered]
[components/ide/jetbrains/image/status:app] 	panic: runtime error: invalid memory address or nil pointer dereference
[components/ide/jetbrains/image/status:app] [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x8d0e73]
[components/ide/jetbrains/image/status:app] 
[components/ide/jetbrains/image/status:app] goroutine 19 [running]:
[components/ide/jetbrains/image/status:app] testing.tRunner.func1.2({0x942fc0, 0xe0a2f0})
[components/ide/jetbrains/image/status:app] 	/home/gitpod/go/src/testing/testing.go:1389 +0x24e
[components/ide/jetbrains/image/status:app] testing.tRunner.func1()
[components/ide/jetbrains/image/status:app] 	/home/gitpod/go/src/testing/testing.go:1392 +0x39f
[components/ide/jetbrains/image/status:app] panic({0x942fc0, 0xe0a2f0})
[components/ide/jetbrains/image/status:app] 	/home/gitpod/go/src/runtime/panic.go:838 +0x207
[components/ide/jetbrains/image/status:app] github.com/gitpod-io/gitpod/jetbrains/status.TestParseGitpodConfig(0xc0001f09c0?)
[components/ide/jetbrains/image/status:app] 	/tmp/build/components-ide-jetbrains-image-status--app.0302babf4fd947cf7d430a788af95a341797b22b/main_test.go:32 +0x33
[components/ide/jetbrains/image/status:app] testing.tRunner(0xc0001f1040, 0xa22f50)
[components/ide/jetbrains/image/status:app] 	/home/gitpod/go/src/testing/testing.go:1439 +0x102
[components/ide/jetbrains/image/status:app] created by testing.(*T).Run
[components/ide/jetbrains/image/status:app] 	/home/gitpod/go/src/testing/testing.go:1486 +0x35f
[components/ide/jetbrains/image/status:app] FAIL	github.com/gitpod-io/gitpod/jetbrains/status	0.099s
[components/ide/jetbrains/image/status:app] FAIL
[components/ide/jetbrains/image/status:app] package build failed
[components/ide/jetbrains/image/status:app] Reason: exit status 1

@yaohui-wyh
Copy link
Contributor Author

Could you have a look the build does not pass

Hi @akosyakov Could you please rerun the CI job? I assume missing deps at BUILD.yaml caused the failure (since go test passed). If CI passed, I would rebase the commits and force push again.

@akosyakov
Copy link
Member

akosyakov commented Jun 22, 2022

/werft run

👍 started the job as gitpod-build-yh-vmoptions-fork.1
(with .werft/ from main)

@akosyakov
Copy link
Member

akosyakov commented Jun 22, 2022

/werft run with-preview

👍 started the job as gitpod-build-yh-vmoptions-fork.2
(with .werft/ from main)

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

it works nicely, tested that plugins are still working as well.

Copy link
Member

@loujaybee loujaybee left a comment

Choose a reason for hiding this comment

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

@akosyakov I have a couple of questions on this one...

  1. How can we provide guidance to users on the appropriate settings to set relative to their workspace spec? Considering self-hosted VM’s being potentially different configurations to SaaS?
  2. Is the .gitpod.yml the right place to have this API/abstraction? Does this not couple closely the project configuration with the underlying machine characteristics, e.g. what considerations should we take for workspace classes?

EDIT: Just noticed that we're identifying as alpha [1]

@akosyakov
Copy link
Member

akosyakov commented Jun 22, 2022

I have a couple of questions on this one...

An idea is to detect a user change to the actual max heap size in the backend plugin and suggest a user to put in .gitpod.yml to persist. So the flow would be like:

  • a user starts using with default Xmx
  • experience perf issues and follow notifications to upgrade Xmx of the running instance
  • after JB backend restart there will be a warning on .gitpod.yml that Xmx of the running instance was changed, but it should be applied to .gitpod.yml to be persistent

I think workspace classes is a bit orthogonal, we will need to evaluate whether configured Xmx in .gitpod.yml can be managed by the current workspace class, i.e. recommendation that JB backend should not be allowed to use more than 60% process of the total allowed memory. If it happens as a remedy we should suggest not only update Xmx but upgrade to the bigger workspace class.

@akosyakov
Copy link
Member

akosyakov commented Jun 22, 2022

@loujaybee just to clarify, here VM is JVM, it is a project characteristic which does not change from hardware on which you run, i.e. if you need 4096 JVM max heap size to load a project it will be the same whether you run on SaaS, Self-Hosted or in your local docker container. vmoptions is coming from JB terminology

@loujaybee loujaybee requested a review from a team June 22, 2022 11:59
Copy link
Contributor

@andrew-farries andrew-farries left a comment

Choose a reason for hiding this comment

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

👍 I'll leave @akosyakov to assess the IDE changes. I have just one question about naming of the options.

/hold

@akosyakov
Copy link
Member

akosyakov commented Jun 24, 2022

/werft run

👍 started the job as gitpod-build-yh-vmoptions-fork.3
(with .werft/ from main)

@akosyakov
Copy link
Member

/unhold

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

Successfully merging this pull request may close these issues.

5 participants