How to use JetBrains Gateway with Workshop¶
JetBrains Gateway allows you to connect to remote development environments while using your favorite JetBrains IDEs (IntelliJ IDEA, PyCharm, and so on). A workshop can serve as the remote development target for JetBrains Gateway, letting you use your favorite JetBrains IDEs against Workshop.
Prerequisites¶
Download and install JetBrains Gateway on your host system.
Create a workshop or choose an existing one.
Generate an SSH key pair if you don’t have one already:
$ ssh-keygen -t rsa -b 4096 -C "<your_email@example.com>"
Configure your workshop¶
Configure your workshop to accept SSH connections by adding a plug, a slot, and an action to upload your public SSH key.
First, add a tunnel interface plug for the system SDK in the workshop definition:
workshop.yaml¶sdks: - name: system plugs: gateway: interface: tunnel endpoint: 2200
This exposes port
2200on the host that you will use in JetBrains Gateway.Next, add a corresponding slot; you can graft it onto an existing SDK or add it with sketching:
Add an action to upload your public SSH key to the workshop:
workshop.yaml¶actions: upload-public-key: | PUBLIC_KEY="$1" if [ -z "${PUBLIC_KEY}" ]; then echo 'cannot upload public key: pass the public key as the argument' 1>&2 exit 1 fi echo "${PUBLIC_KEY}" >> $HOME/.ssh/authorized_keys
This appends your public SSH key to the list of authorized keys for the
workshopuser.Refresh the workshop to apply the changes if you haven’t done so already:
$ workshop refresh
Use the action to upload your public SSH key to the workshop, for example:
$ workshop run dev upload-public-key "$(cat ~/.ssh/id_rsa.pub)"
The workshop is now ready to accept SSH connections.
Connect with Gateway¶
Open JetBrains Gateway.
Create a new SSH connection using these values:
Username:
workshopHost:
localhostPort:
2200Specify private key: Your private SSH key counterpart to the public key you uploaded earlier.
Click Check connection and continue.
At the next screen, select your preferred JetBrains IDE version, e.g. PyCharm.
Under Installation options, choose Customize installation path and set it to a path under
/project/, e.g./project/pycharm/; this ensures the IDE has enough disk space.For Project directory, choose
/project/.Click Start IDE and connect, then wait for the IDE to install and launch; this may take a few minutes. After the IDE starts, log in and proceed as usual.
Your JetBrains IDE will now run remotely in the workshop while providing a native desktop experience.
See also¶
Explanation:
Reference: