Skip to content

Commit 9f06744

Browse files
author
Katie Horne
authored
chore: minor edits to recently merged docs updates (#915)
1 parent 97ff277 commit 9f06744

File tree

5 files changed

+242
-226
lines changed

5 files changed

+242
-226
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
---
2+
title: "Multiple JetBrains instances configuration"
3+
description: Learn how to run multiple instances of JetBrains IDEs in Coder.
4+
---
5+
6+
This article walks you through the process of configuring Coder to support the
7+
use of multiple instances of the same JetBrains IDE.
8+
9+
![Multiple IntelliJ icons in a
10+
workspace](../../assets/workspaces/multi-intellij-icons-smaller.png)
11+
12+
You will:
13+
14+
1. Create and build the custom image
15+
1. Write the configure script
16+
1. Write the `config.yaml` file needed to utilize Coder's [workspace
17+
applications] feature to surface additional JetBrains IDE instances in your
18+
browser
19+
20+
This article shows you how to configure multiple instances of IntelliJ IDEA
21+
Ultimate, but you can use this process for any JetBrains IDEs.
22+
23+
> Using additional JetBrains IDEs consume extra workspace compute resources, so
24+
> ensure that you've allocated enough resources to your workspace to support all
25+
> of your IDE instances.
26+
27+
1. Build a custom image that installs the primary JetBrains IDE and copies the
28+
configure script, `.profile` script, and `config.yaml` file to the image:
29+
30+
```Dockerfile
31+
FROM codercom/enterprise-java:ubuntu
32+
33+
USER root
34+
35+
# Install IntelliJ IDEA Ultimate
36+
RUN mkdir -p /opt/idea
37+
RUN curl -L \
38+
"https://download.jetbrains.com/product?code=IU&latest&distribution=linux" \
39+
| tar -C /opt/idea --strip-components 1 -xzvf -
40+
41+
# Create a symbolic link in PATH that points to the Intellij startup script.
42+
RUN ln -s /opt/idea/bin/idea.sh /usr/bin/intellij-idea-ultimate
43+
44+
# bash .profile so projector can be added to the path
45+
COPY [".profile", "/coder/.profile"]
46+
47+
# configure script
48+
COPY ["configure", "/coder/configure"]
49+
RUN chmod +x /coder/configure
50+
51+
# copy custom apps info (config.yaml)
52+
COPY ["./coder", "/coder"]
53+
54+
# Set back to coder user
55+
USER coder
56+
```
57+
58+
1. Add the JetBrains Projector CLI to the workspace's PATH (in this example,
59+
`.profile` is located in the Coder directory within the directory that
60+
contains the image's Dockerfile:
61+
62+
```console
63+
export PATH=$PATH:$HOME/.local/bin
64+
```
65+
66+
1. Create the configure script that installs the Projector CLI into
67+
`/home/coder` and uses the CLI to install additional JetBrains IDEs. Each IDE
68+
configuration has a different directory in `/home/coder/.projector/configs`.
69+
In this example, the configure script is in the directory that contains the
70+
image's Dockerfile:
71+
72+
> Each additional IDE requires a unique port number.
73+
74+
```console
75+
# install projector into /home/coder/ pvc
76+
pip3 install projector-installer --user
77+
78+
# put projector CLI into path
79+
cp /coder/.profile $HOME
80+
source $HOME/.profile
81+
82+
# autoinstall intellij version specifying config name and port
83+
$HOME/.local/bin/projector --accept-license
84+
85+
PROJECTOR_CONFIG_PATH=$HOME/.projector/configs/IntelliJ_2
86+
87+
if [ -d $PROJECTOR_CONFIG_PATH ]; then
88+
echo 'projector has already been configured - skip step'
89+
else
90+
$HOME/.local/bin/projector ide autoinstall --config-name IntelliJ_2 \
91+
--ide-name "IntelliJ IDEA Ultimate 2021.3.2" --port 8997 \
92+
--use-separate-config
93+
$HOME/.local/bin/projector ide autoinstall --config-name IntelliJ_3 \
94+
--ide-name "IntelliJ IDEA Ultimate 2021.3.2" --port 8998 \
95+
--use-separate-config
96+
$HOME/.local/bin/projector ide autoinstall --config-name IntelliJ_4 \
97+
--ide-name "IntelliJ IDEA Ultimate 2021.3.2" --port 8999 \
98+
--use-separate-config
99+
fi
100+
```
101+
102+
1. Create the `config.yaml` file used by
103+
[workspace applications](../../workspaces/applications.md) to surface icons
104+
for each additional JetBrains IDE in the workspace. The configuration uses
105+
the JetBrains icon included with the initial JetBrains IDE installed.
106+
107+
In this example, `config.yaml` is located in a `coder/apps` directory within
108+
the directory that contains the image Dockerfile.
109+
110+
> Each workspace application name must be unique so that Projector can point
111+
> to the correct config directory.
112+
113+
```yaml
114+
# /coder/apps/config.yaml
115+
apps:
116+
# Name of application in launcher. Name may consist of alphanumeric
117+
# characters, dashes, underscores. Names must begin with an alphanumeric
118+
# character. Names must be unique per application. Required.
119+
- name: IntelliJ IDEA Ultimate 2
120+
# Application scheme - must be http or https. Required.
121+
scheme: http
122+
# Application port. Required.
123+
port: 8997
124+
# Host of the application to use when dialing. Defaults to localhost.
125+
# Optional.
126+
host: "localhost"
127+
# Working directory for the start command. Required.
128+
working-directory: /home/coder
129+
# File path to icon used in application launcher. Icons should be either
130+
# PNG, SVG, or JPG. Required.
131+
icon-path: /opt/idea/bin/idea.svg
132+
# Command to start the application. Required.
133+
command: /home/coder/.projector/configs/IntelliJ_2/run.sh
134+
# Array of arguments for command. Optional.
135+
args: [""]
136+
# Health checks to get running application status. Can use exec or http
137+
# health checks to localhost. Optional, but we recommend specifying a
138+
# health check. If you don't supply one, then an http request is sent to
139+
# the application root path "/".
140+
health-check:
141+
http:
142+
# Scheme must be "http" or "https". If not specified it inherits
143+
# the application scheme. Optional.
144+
scheme: "http"
145+
# The host to use when dialing the address. If not specified it
146+
# inherits the application host. Optional.
147+
host: "localhost"
148+
# Port to use when dialing the application. If not specified it
149+
# inherits the application port. Optional.
150+
port: 8997
151+
- name: IntelliJ IDEA Ultimate 3
152+
# Application scheme - must be http or https. Required.
153+
scheme: http
154+
# Application port. Required.
155+
port: 8998
156+
# Host of the application to use when dialing. Defaults to localhost.
157+
# Optional.
158+
host: "localhost"
159+
# Working directory for the start command. Required.
160+
working-directory: /home/coder
161+
# File path to icon used in application launcher. Icons should be either
162+
# PNG, SVG, or JPG. Required.
163+
icon-path: /opt/idea/bin/idea.svg
164+
# Command to start the application. Required.
165+
command: /home/coder/.projector/configs/IntelliJ_3/run.sh
166+
# Array of arguments for command. Optional.
167+
args: [""]
168+
# Health checks to get running application status. Can use exec or http
169+
# health checks to localhost. Optional, but we recommend specifying a
170+
# health check. If you don't supply one, then an http request is sent to
171+
# the application root path "/".
172+
health-check:
173+
http:
174+
# Scheme must be "http" or "https". If not specified it inherits
175+
# the application scheme. Optional.
176+
scheme: "http"
177+
# The host to use when dialing the address. If not specified it
178+
# inherits the application host. Optional.
179+
host: "localhost"
180+
# Port to use when dialing the application. If not specified it
181+
# inherits the application port. Optional.
182+
port: 8998
183+
- name: IntelliJ IDEA Ultimate 4
184+
# Application scheme - must be http or https. Required.
185+
scheme: http
186+
# Application port. Required.
187+
port: 8999
188+
# Host of the application to use when dialing. Defaults to localhost.
189+
# Optional.
190+
host: "localhost"
191+
# Working directory for the start command. Required.
192+
working-directory: /home/coder
193+
# File path to icon used in application launcher. Icons should be either
194+
# PNG, SVG, or JPG. Required.
195+
icon-path: /opt/idea/bin/idea.svg
196+
# Command to start the application. Required.
197+
command: /home/coder/.projector/configs/IntelliJ_4/run.sh
198+
# Array of arguments for command. Optional.
199+
args: [""]
200+
# Health checks to get running application status. Can use exec or http
201+
# health checks to localhost. Optional, but we recommend specifying a
202+
# health check. If you don't supply one, then an http request is sent to
203+
# the application root path "/".
204+
health-check:
205+
http:
206+
# Scheme must be "http" or "https". If not specified it inherits
207+
# the application scheme. Optional.
208+
scheme: "http"
209+
# The host to use when dialing the address. If not specified it
210+
# inherits the application host. Optional.
211+
host: "localhost"
212+
# Port to use when dialing the application. If not specified it
213+
# inherits the application port. Optional.
214+
port: 8999
215+
```
216+
217+
> See Projector's CLI documentation for additional information on
218+
> [installation](https://github.com/JetBrains/projector-installer#Installation)
219+
> and the
220+
> [CLI commands](https://github.com/JetBrains/projector-installer/blob/master/COMMANDS.md)
221+
> it accepts.

images/configure.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ file shows how you can clone a repo at build time:
4646
#!/bin/bash
4747
if [ ! -d "/home/coder/workspace/project" ]
4848
then
49-
ssh-keyscan -t rsa <your git provider endpoint> >> ~/.ssh/known_hosts
49+
ssh-keyscan -t rsa <yourGitProviderEndpoint> >> ~/.ssh/known_hosts
5050
git clone git://company.com/project.git /home/coder/workspace/project
5151
else
5252
echo "Project has already been cloned."
5353
fi
5454
```
5555

56-
> Change the git provider endpoint in the ```ssh-keyscan``` command. e.g.,
57-
> ```github.com``` ```bitbucket.org``` ```gitlab.com```
56+
> Ensure that you change the `<yourGitProviderEndpoint>` placeholder in the
57+
> `ssh-keyscan` command (e.g., `github.com`, `bitbucket.org`, `gitlab.com`).
5858
5959
Note that the instructions provided include `if-else` logic on whether the
6060
instructions should be re-run (and when) or if Coder should run the instructions

manifest.json

+3
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,9 @@
434434
{
435435
"path": "./guides/customization/macos-keybinding.md"
436436
},
437+
{
438+
"path": "./guides/customization/multiple-jetbrains-ides.md"
439+
},
437440
{
438441
"path": "./guides/customization/node.md"
439442
},

workspaces/editors.md

+15-16
Original file line numberDiff line numberDiff line change
@@ -291,27 +291,26 @@ participants. If they do, click **Accept** to proceed.
291291
At this point, you'll be able to share your project and work with your partner
292292
in real-time.
293293

294-
## Muliple Instances of the same JetBrains IDE
294+
## Multiple instances of a JetBrains IDE
295295

296-
Some JetBrains users like to have multiple projects open when coding which
297-
requires multiple JetBrains IDEs open at the same time. When using JetBrains in
298-
a browser, this requires additional configuration steps.
299-
300-
### Multiple JetBrains in a browser
301-
302-
To the user, they will use the default JetBrains IDE that Coder detects in the
303-
custom image, and one or more additional JetBrains IDEs will also appear in the
304-
workspace dashboard.
296+
If you'd like to have multiple projects open, you'll need to have multiple
297+
JetBrains IDEs open in Coder simultaneously. The following steps show you how to
298+
configure Coder to enable this behavior.
305299

306300
![Multiple IntelliJ icons in a workspace](../assets/workspaces/multi-intellij-icons-smaller.png)
307301

308-
The configuration requires installing the JetBrains Projector CLI with a
309-
configure script and a custom image. The configure script installs the Projector
310-
CLI then uses it to install as many additional IDE instances you require.
311-
Coder's [Workspace Applications](./applications.md) feature then surfaces the
312-
additional IDE icons in the workspace.
302+
Running multiple instances of the same JetBrains IDE requires you to create a
303+
custom image and configure script to install the JetBrains Projector CLI using a
304+
custom image and [configure](../images/configure.md) script.
305+
306+
The configure script will install JetBrains Projector, then use the Projector
307+
CLI to install as many additional IDE instances as you need. Coder's
308+
[workspace applications](./applications.md) feature surfaces the additional IDE
309+
icons in the workspace.
313310

314-
[Steps to configure additional JetBrains IDEs in a browser](./multi-jetbrains-in-browser.md)
311+
We have provided
312+
[detailed configuration steps](../guides/customization/multiple-jetbrains-ides.md)
313+
for setting up your custom image and configure script.
315314

316315
## RStudio
317316

0 commit comments

Comments
 (0)