-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Create and use jetbrains' workspace images #5642
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
Comments
/schedule |
@akosyakov: Issue scheduled in the IDE team (WIP: 0) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Based on the discussion with @akosyakov, @atduarte, and @csweichel I would suppose the following solution. ObjectivesThe goal is to allow us to add a second “IDE” to the workspace image. This second “IDE” is actually a backend service that allows to connect an external/remote IDE to the running workspace (e.g., a desktop IDE like IntellJ). If the remote IDE cannot connect for some reason or the user would like to start the web IDE instead, we still have a web IDE backend (e.g., VSCode) running in the workspace. The user should be able to open this web IDE with a click on a button (see screenshot above). I personally prefer the term “remote IDE” over “desktop IDE” for the second IDE because technically, it's not limited to desktop IDEs but allows all kinds of IDEs that are not delivered by us to connect to the workspace, e.g. another web IDE hosted somewhere can connect to this workspace as well. However, if you are not convinced, we still can change it to use the term “desktop IDE” instead. The implementation should be backward as well as forward compatible. ImplementationRegistry FacadeThe remote IDE process that allows other (remote) IDEs to connect to this workspace should be implemented as an own image that is used in the registry facade as additional layers. For this we need to add the remote IDE image ref to the gitpod/components/registry-facade-api/imagespec.proto Lines 8 to 15 in 2aa2db6
To be compatible with different versions, I would suggest that we don't touch the message ImageSpec {
// base_ref points to an image in another registry
string base_ref = 1;
// ide_ref points to an image denoting the IDE to use
string ide_ref = 2;
// content_layer describe the last few layers which provide the workspace's content
repeated ContentLayer content_layer = 3;
// remote_ide_ref points to an image denoting the remote IDE to use
string remote_ide_ref = 4;
} The registry-facade needs to consider this as an additional layer source (and needs to make sure that it can handle a missing value if this workspace does not have a remote image): gitpod/components/registry-facade/pkg/registry/registry.go Lines 126 to 133 in 2aa2db6
ServerThe additional remote image ref needs to be added to the gitpod/components/gitpod-protocol/src/workspace-instance.ts Lines 198 to 209 in 2aa2db6
Again, we can just add another attribute for the remote IDE image and leave the and used here:
and here: gitpod/components/server/src/workspace/workspace-starter.ts Lines 694 to 710 in 2aa2db6
ws-managerThe additional remote image ref needs to be added to the gitpod/components/ws-manager-api/core.proto Lines 250 to 271 in 2aa2db6
Again, we can just add another attribute for the remote IDE image and leave the The remote IDE image needs to be set here for the registry facade: gitpod/components/ws-manager/pkg/manager/create.go Lines 239 to 242 in 2aa2db6
And in the gitpod/components/ws-manager/pkg/manager/status.go Lines 247 to 254 in 2aa2db6
gitpod/components/ws-manager/pkg/manager/status.go Lines 268 to 275 in 2aa2db6
SupervisorThe supervisor config needs to be extended so that we can add an additional IDEConfig for the remote IDE here: gitpod/components/supervisor/pkg/supervisor/config.go Lines 35 to 39 in 2aa2db6
It makes sense to re-use the IDEConfig struct for the remote IDE config as well: gitpod/components/supervisor/pkg/supervisor/config.go Lines 109 to 134 in 2aa2db6
However, since the config is a struct that merges
type Config struct {
StaticConfig
IDEConfig
RemoteIDE *IDEConfig
WorkspaceConfig
} That has the advantage that the references to IDEConfig do not need to be touched and the disadvantage that RemoteIDE does not fit well into this struct and has a special role.
type Config struct {
StaticConfig
IDE IDEConfig
RemoteIDE *IDEConfig
WorkspaceConfig
} With this change, we need to change all references to the Thus, I think that option 2 would be preferable. Besides this, there are a lot of changes in the supervisor that have to be made, e.g.:
TestingWe still need to make a plan on how to test this. |
@corneliusludmann Thank you for the detailed analysis and write-up. A few comments:
|
@atduarte Could you add a link to the internal discussion? How can I call the |
@corneliusludmann done.
Unless something weird is being done, values in protobuf messages are identified by their index and the name of the attribute is not present. As such compatibility should not be affected, right? |
I think we should rename |
Regarding the term that we use for the second kind of IDE images
Indeed. I personally find “local IDE” confusing for the same reason—it's a matter of the origin. However, because we already have the “local app” it would make sense to call it “local IDE” as well. Then we are aligned with the terms. 👍 Another option would call it “external IDE”. Perhaps that would be even more accurate?
You mean rename At the end of the day, it's just a name and I don't want to start an unnecessary discussion here. If you're more comfortable with “desktop IDE”, I can live with that. However, please let me explain why I don't prefer this.
In my opinion, that's not 100 % true. The actual difference between these 2 IDEs is that we serve the first one ourselves (the “web IDE”) and the second one is served by someone else. Currently, the second kind of IDEs is always a desktop IDE but technically JetBrains could also serve their IDEs as a web IDE on their servers and connect to our workspaces. And with Electron & Co, the boundaries between web and desktop are blurred anyway. That's why I think the term “desktop IDE” is too narrow. In fact, the “IDE image” for the desktop/remote/local IDE (however we call this) is actually not what I would call an “IDE” it's more like a gateway that allows external IDEs to connect to our workspace. IMO, it would be even more accurate if we call it something like |
I mean the change from message FooBar {
ide_ref string = 1;
} to message FooBar {
message IDE {
ide_ref string = 1;
remote_ide_ref string = 2;
}
ide_refs IDE = 2;
} would be incompatible or at least need to be handled. Just renaming is not a bug problem (but you still need to change the code occurrences that refer to the attributes of the generated code). |
From user perspective:
I don't like remote because |
Just to make it clear: I don't have any problems with speaking about Desktop IDEs to our users in our docs etc. I just think that we should call it in the code more open and technically accurate. Technically, there is no reason that an external IDE that connects to the workspace is a Desktop IDE. I just want to prevent that we call it I see that But hey, when I'm the only one who thinks so and cannot convince you with my point of view, then let's stick with |
message FooBar {
message IDE {
ide_ref string = 1;
remote_ide_ref string = 2;
}
ide_ref IDE = 2;
} would indeed be incompatible with the current API. However, message WorkspaceSpec {
// IDEImage configures the IDE images a workspace will use
message IDEImage struct {
// web_ref is a reference to an OCI image used for serving the web-based IDE
string web_ref = 1;
// remote_ref is an optional reference to an OCI image used for serving remote IDEs
string remote_ref = 2;
}
// workspace_image is the name of the Docker image this workspace runs
string workspace_image = 1;
// deprecated_ide_image is a field present for backwards compatibility and the same
// as IDEImage.web_ref. If both fields are present, IDEImage.web_ref takes precedence.
string deprecated_ide_image = 2;
// ide_image is the name of the Docker image used as IDE
IDEImage ide_image = 8;
...
} is compatible because the new message uses a new index, and the field number 2 remains a |
Also +1 for |
Since there were other alternatives like
Sure. We are on the same page here. Just wanted to stress that this needs code changes to reflect the changed field (what makes it some kind of incompatible on another layer).
While we're on this topic: I actually don't see the benefit of making this field composite. It would produce additional code to make this change backwards compatible that we need for a very short transition phase only. But I read from it that it has advantages for the move of the |
Here is a first draft: https://github.com/gitpod-io/gitpod/compare/clu/intellij-ide Still with a lot of rough edges and not everything has been considered but working prototype: ScreenshotsUser preferences: Workspace start: Smaller Issues / PRs
💯 Having smaller issues / PRs is always a good thing! However, I don't know yet how to divide this in a meaningful way to have changes that are viable on their own. Especially the API changes are all somehow connected. I'll think about it some more … |
As defined in #5641, users will be able to select Jetbrains IDEs as their preferred IDE. When that is the case, starting (a new) workspace should make Gitpod install and run the appropriate Jetbrains IDE backend and lead the user to a page similar to the following:
The page should automatically redirect to the Jetbrains link (for now, a code with me link). And instead of "Jetbrains IDE" the button should mention the actual IDE name (e.g. Pycharm).
Questions & answers
How can we detect if the IDE backend is ready and fetch the link?
One option would be to monitor the stdout of the process, but the recommended option is to either run the
status
method (see internal discussion) or do an HTTP call (see here).Is the VS code web supposed to be running simultaneously in the same workspace?
Yes.
The text was updated successfully, but these errors were encountered: