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

Investigate the possibility of integration with JetBrains Gateway #21412

Closed
Tracked by #21823 ...
azatsarynnyy opened this issue May 18, 2022 · 7 comments
Closed
Tracked by #21823 ...

Investigate the possibility of integration with JetBrains Gateway #21412

azatsarynnyy opened this issue May 18, 2022 · 7 comments
Assignees
Labels
area/editor/jetbrains/intellij Issues related to the IntelliJ-based IDE for Eclipse Che kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.

Comments

@azatsarynnyy
Copy link
Member

Is your task related to a problem? Please describe

We observe some interest among the community in connecting to a DevWorkspace from the local IDEs. We need to provide a solution for the JetBrains IDEs.

Describe the solution you'd like

Need to investigate how we can integrate Eclipse Che with JetBrains Gateway to make it possible to connect from a local JetBrains IDE to a remote DevWorkspace.

Describe alternatives you've considered

It can be some PoC with just a base functionality.

Additional context

Getting started with remote development https://www.jetbrains.com/help/idea/remote-development-a.html

@azatsarynnyy azatsarynnyy added kind/task Internal things, technical debt, and to-do tasks to be performed. sprint/current severity/P1 Has a major impact to usage or development of the system. team/editors area/editor/jetbrains/intellij Issues related to the IntelliJ-based IDE for Eclipse Che labels May 18, 2022
@azatsarynnyy azatsarynnyy mentioned this issue May 18, 2022
49 tasks
@vzhukovs
Copy link
Contributor

vzhukovs commented May 18, 2022

There is a one restriction from using JetBrains Gateway - is running only paid versions of IDEs [1]. It is not possible to run Community Editions using this technology. Only those versions contain built-in plugins for creating remote connection to the development environments.

[1] https://www.jetbrains.com/help/idea/remote-development-a.html

@azatsarynnyy
Copy link
Member Author

@kstevena
Copy link

I don't know if it might be helpful, but I've been working on my side on a proof of concept, which looks to work, however this is quite dirty as I did not wanted to write a specific plugin for the IDE...

Here are some elements:

  • JetBrains Gateway out of the box (no additional plugin installed) can connect to a remote environment through SSH, it uses that to make a port forwarding of the tcp port on which the server is listening.
    To address this needs in addition of installing a pro version of the desired IDE from JetBrains, I've also installed an SSH server into the container. Which is started by the entrypoint script. The authorized keys of the user are automatically mounted through a configmap in the user namespace properly labelled & annotated.

  • Endpoints can be of tcp type but won't be exposed outside of the cluster
    As a workaround I made a controller watching for che/devworkspace generated services matching some specifications such as the name of a port port of the service being set to "ssh", then creating an associated service of type LoadBalancer.
    In conjunction of that an instance of external-dns looking for those specific services, generating a templated dns record using the devworkspace Id

  • The dashboard needs to redirect the user to a web page
    As a workaround I made a small app to which the dashboard will redirect when the workspace will be ready and which will basically display and do a "window.open" of the JetBrains Gateway link.
    When the JetBrains Gateway has registered the "jetbrains-gateway://" type of link then it will open it smoothly.
    JetBrains Gateway Link for ssh are of the following format:
    jetbrains-gateway://connect#idePath=%s&projectPath=%s&host=%s&port=%s&user=%s&type=ssh&deploy=false
    IdePath, ProjectPath and user are naturally known, but the host and ports are slightly different. However as in my PoC I used the hostname of the CHE_DASHBOARD_URL and the DEVWORKSPACE_ID to generate a DNS record and I relied on a static 22 port number it was then able to point to the correct host name for the SSH server.

As said this is far from being clean, but allowed me to demonstrate the feasability (and test if the experience is better than with projector or a vnc connection). Beyond the bad design, the current issues I have are the following:

  • it requires one external IP per workspace (as I'm creating one service of type LoadBalancer per workspace requiring it), I assume it can be solved by configuring multiple ports on a single LoadBalancer entity ; not sure about another approach with a single ssh endpoint acting as a multiplexer or proxy such as containerssh or sshpiper or another one using an https proxy to be able to leverage TLS/SNI to point to the right ssh server within the cluster.
  • when the workspace is fully started, the LoadBalancer might not yet be ready and so the SSH connectivity might not be yet working, so the user may have to wait a bit a do few retries with the JetBrains Gateway app.

@che-bot
Copy link
Contributor

che-bot commented Jun 7, 2023

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 7, 2023
@che-bot che-bot closed this as completed Jun 14, 2023
@github-project-automation github-project-automation bot moved this from 📅 Planned to ✅ Done in Eclipse Che Team B Backlog Jun 14, 2023
@azatsarynnyy azatsarynnyy reopened this Jun 14, 2023
@l0rd l0rd moved this from ✅ Done to 🚧 In Progress in Eclipse Che Team B Backlog Jun 14, 2023
@azatsarynnyy azatsarynnyy moved this from 🚧 In Progress to 📅 Planned in Eclipse Che Team B Backlog Jun 19, 2023
@che-bot che-bot closed this as completed Jun 21, 2023
@github-project-automation github-project-automation bot moved this from 📅 Planned to ✅ Done in Eclipse Che Team B Backlog Jun 21, 2023
@azatsarynnyy azatsarynnyy moved this from ✅ Done to 📅 Planned in Eclipse Che Team B Backlog Jun 21, 2023
@azatsarynnyy azatsarynnyy reopened this Jun 21, 2023
@che-bot che-bot closed this as completed Jun 28, 2023
@github-project-automation github-project-automation bot moved this from 📅 Planned to ✅ Done in Eclipse Che Team B Backlog Jun 28, 2023
@l0rd l0rd reopened this Jun 28, 2023
@l0rd l0rd removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 28, 2023
@l0rd l0rd moved this from ✅ Done to 🚧 In Progress in Eclipse Che Team B Backlog Jun 28, 2023
@azatsarynnyy
Copy link
Member Author

/remove-lifecycle stale

@azatsarynnyy azatsarynnyy moved this from 🚧 In Progress to 📅 Planned in Eclipse Che Team B Backlog Jun 29, 2023
@azatsarynnyy azatsarynnyy moved this from 📅 Planned to 🚧 In Progress in Eclipse Che Team B Backlog Jul 18, 2023
@azatsarynnyy
Copy link
Member Author

Sharing the steps for testing my current PoC.

Start a Che Workspace with JetBrains Development Server as a Che IDE

  1. Create a new Workspace from the test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/idea-server.
  2. Wait until the Dashboard shows the Workspace is in a Running state. Note, that the Dashboard will not redirect to any page. Just check the Workspace state indicator.

Forward for IDEA dev server port to the local machine

  1. Get a Workspace pod name.
  2. oc port-forward pod/MY_WS_POD_NAME 5990

Get a link to connect to the IDEA Remote Dev Server

  1. With the help of OpenShift Console or oc client open a terminal to the tools container and check the /idea-server/entrypoint-logs.txt file.
  2. Find the dev server link at the top. It looks like:
    Join link: tcp://127.0.0.1:5990#jt=a981d291-6826-46e7-8460-77ec6745864f&p=IU&fp=C067327B446B4D7321850EBC5EFA6FDA9BE37603220E3C84BD61AE209B910CD0&cb=223.7571.182&jb=17.0.5b653.14.

Connect to the remote Che Workspace from a local JetBrains Thin Client
There are two options:

  • In JetBrains Gateway, select the Connect with a Link option
  • In IntelliJ IDEA Ultimate, choose Remote Development

Paste the "join" link to the Connect to Running IDE field and click the Connect button. JetBrains Thin Client should be downloaded, run, and connected to the remote Che Workspace.

@azatsarynnyy
Copy link
Member Author

I'm closing this one and filed a new issue for the next step #22493

@github-project-automation github-project-automation bot moved this from 🚧 In Progress to ✅ Done in Eclipse Che Team B Backlog Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/jetbrains/intellij Issues related to the IntelliJ-based IDE for Eclipse Che kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

6 participants