-
Notifications
You must be signed in to change notification settings - Fork 894
feat: update IDE docs with advanced examples with pods and custom images #3002
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8f412c3
feat: update IDE docs with advanced examples with pods and custom images
sharkymark 1fdceee
Update docs/ides/configuring-web-ides.md
sharkymark de4799a
Update docs/ides/configuring-web-ides.md
sharkymark 1b44f12
Update docs/ides/configuring-web-ides.md
sharkymark 4ce2f48
Update docs/ides/configuring-web-ides.md
sharkymark ffaf75d
Update docs/ides/configuring-web-ides.md
sharkymark edbb733
remove projector-container issue
bpmct File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
feat: update IDE docs with advanced examples with pods and custom images
- Loading branch information
commit 8f412c3badfa700202a18c023ba33f99cb4526fb
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -77,9 +77,10 @@ resource "coder_app" "code-server" { | |||
``` | ||||
|
||||
<blockquote class="warning"> | ||||
If the `code-server` integrated terminal fails to load, (i.e., xterm fails to load), go to DevTools to ensure xterm is loaded, clear your browser cache and refresh. | ||||
If the code-server integrated terminal fails to load, (i.e., xterm fails to load), go to DevTools to ensure xterm is loaded, clear your browser cache and refresh. | ||||
</blockquote> | ||||
|
||||
|
||||
## VNC Desktop | ||||
|
||||
 | ||||
|
@@ -112,12 +113,10 @@ As a starting point, see the [desktop-container](https://github.com/bpmct/coder- | |||
|
||||
Workspace requirements: | ||||
|
||||
- JetBrains server | ||||
- IDE (e.g IntelliJ IDEA, pyCharm) | ||||
|
||||
Installation instructions will vary depending on your workspace's operating system, platform, and build system. | ||||
- JetBrains projector CLI | ||||
- At least 4 CPU cores and 4 GB RAM | ||||
|
||||
As a starting point, see the [projector-container](https://github.com/bpmct/coder-templates/tree/main/projector-container) community template. It builds & provisions a Dockerized workspaces for the following IDEs: | ||||
If you would like to use a Docker host to run a JetBrains IDE, see the [projector-container](https://github.com/bpmct/coder-templates/tree/main/projector-container) community template. It builds Docker images based on JetBrains-provided images & provisions Dockerized workspaces for the following IDEs: | ||||
|
||||
- CLion | ||||
- pyCharm | ||||
|
@@ -132,6 +131,94 @@ As a starting point, see the [projector-container](https://github.com/bpmct/code | |||
- WebStorm | ||||
- ➕ code-server (just in case!) | ||||
|
||||
|
||||
For advanced users who want to make a custom image, you can install the Projector CLI in the `startup_script` of the `coder_agent` resource in a Coder template. Using the Projector CLI, you can use `projector ide autoinstall` and `projector run` to download and start a JetBrains IDE in your workspace. | ||||
|
||||
|
||||
 | ||||
|
||||
|
||||
In this example, the version of JetBrains IntelliJ IDE is passed in from a Terraform input variable. You create a JetBrains icon in the workspace using a `coder_app` resource. | ||||
|
||||
> There is known issue passing query string parameters when opening a JetBrains IDE from an icon in your workspace. Note the `grep` statement to remove an optional password token from the configuration so a query string parameter is not passed. | ||||
sharkymark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
```hcl | ||||
|
||||
variable "jetbrains-ide" { | ||||
description = "JetBrains IntelliJ IDE" | ||||
default = "IntelliJ IDEA Community Edition 2022.1.3" | ||||
validation { | ||||
condition = contains([ | ||||
"IntelliJ IDEA Community Edition 2022.1.3", | ||||
"IntelliJ IDEA Community Edition 2021.3", | ||||
"IntelliJ IDEA Ultimate 2022.1.3", | ||||
"IntelliJ IDEA Ultimate 2021.3" | ||||
], var.jetbrains-ide) | ||||
sharkymark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
error_message = "Invalid JetBrains IDE!" | ||||
} | ||||
} | ||||
|
||||
resource "coder_agent" "coder" { | ||||
dir = "/home/coder" | ||||
startup_script = <<EOT | ||||
#!/bin/bash | ||||
|
||||
# install projector | ||||
PROJECTOR_BINARY=/home/coder/.local/bin/projector | ||||
if [ -f $PROJECTOR_BINARY ]; then | ||||
echo 'projector has already been installed - check for update' | ||||
/home/coder/.local/bin/projector self-update 2>&1 | tee projector.log | ||||
else | ||||
echo 'installing projector' | ||||
pip3 install projector-installer --user 2>&1 | tee projector.log | ||||
fi | ||||
|
||||
echo 'access projector license terms' | ||||
/home/coder/.local/bin/projector --accept-license 2>&1 | tee -a projector.log | ||||
|
||||
PROJECTOR_CONFIG_PATH=/home/coder/.projector/configs/intellij | ||||
|
||||
if [ -d "$PROJECTOR_CONFIG_PATH" ]; then | ||||
echo 'projector has already been configured and the JetBrains IDE downloaded - skip step' 2>&1 | tee -a projector.log | ||||
else | ||||
echo 'autoinstalling IDE and creating projector config folder' | ||||
/home/coder/.local/bin/projector ide autoinstall --config-name "intellij" --ide-name "${var.jetbrains-ide}" --hostname=localhost --port 8997 --use-separate-config --password coder 2>&1 | tee -a projector.log | ||||
sharkymark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
# delete the configuration's run.sh input parameters that check password tokens since tokens do not work with coder_app yet passed in the querystring | ||||
grep -iv "HANDSHAKE_TOKEN" $PROJECTOR_CONFIG_PATH/run.sh > temp && mv temp $PROJECTOR_CONFIG_PATH/run.sh 2>&1 | tee -a projector.log | ||||
chmod +x $PROJECTOR_CONFIG_PATH/run.sh 2>&1 | tee -a projector.log | ||||
|
||||
echo "creation of intellij configuration complete" 2>&1 | tee -a projector.log | ||||
fi | ||||
sharkymark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
# start JetBrains projector-based IDE | ||||
/home/coder/.local/bin/projector run intellij & | ||||
|
||||
EOT | ||||
} | ||||
|
||||
resource "coder_app" "intellij" { | ||||
agent_id = coder_agent.coder.id | ||||
name = "${var.jetbrains-ide}" | ||||
icon = "/icon/intellij.svg" | ||||
url = "http://localhost:8997/" | ||||
relative_path = true | ||||
} | ||||
sharkymark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
``` | ||||
|
||||
Here are [Kubernetes pod](https://github.com/mark-theshark/v2-templates/tree/main/pod-with-intellij) and [Docker container](https://github.com/mark-theshark/v2-templates/tree/main/docker-with-intellij) examples with a JetBrains IntelliJ IDE. | ||||
|
||||
Here are [Kubernetes pod](https://github.com/mark-theshark/v2-templates/tree/main/pod-with-pycharm) and [Docker container](https://github.com/mark-theshark/v2-templates/tree/main/docker-with-pycharm) examples with a JetBrains PyCharm IDE. | ||||
|
||||
 | ||||
|
||||
Here are [Kubernetes pod](https://github.com/mark-theshark/v2-templates/tree/main/pod-with-goland) and [Docker container](https://github.com/mark-theshark/v2-templates/tree/main/docker-with-goland) examples with a JetBrains GoLand IDE. | ||||
|
||||
> You need to have a valid `~/.kube/config` on your Coder host and a namespace on a Kubernetes cluster to use the Kubernetes pod template examples. | ||||
sharkymark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
> Coder OSS currently does not perform a health check that any IDE or commands in the `startup_script` have completed, so wait a minute or so before opening the JetBrains or code-server icons. As a precaution, you can open Terminal and run `htop` to see if the processes have completed. | ||||
sharkymark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
|
||||
|
||||
Comment on lines
+226
to
+228
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's remove these extra spaces
Suggested change
|
||||
## JupyterLab | ||||
|
||||
Configure your agent and `coder_app` like so to use Jupyter: | ||||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.