Skip to content

Commit aeff6f8

Browse files
[Feature] Add support for Cursor (#32)
1 parent 2be2f64 commit aeff6f8

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

installation/docker-amd64-cuda/CSCS-Clariden-setup/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ When the container starts, its entrypoint does the following:
177177
- It then tries to install the project in editable mode.
178178
This is a lightweight installation that allows to avoid all the hacky import path manipulations.
179179
(This will be skipped if `PROJECT_ROOT_AT` has not been specified or if you specify `SKIP_INSTALL_PROJECT=1`.)
180-
- It also handles all the remote development setups (VS Code, PyCharm, Jupyter, ...)
180+
- It also handles all the remote development setups (VS Code, Cursor, PyCharm, Jupyter, ...)
181181
that you specify with environment variables.
182182
These are described in the later sections of this README.
183183
- Finally, it executes a provided command (e.g. `bash` here for an interactive job with a connected --pty).
@@ -250,7 +250,7 @@ to run with `sbatch`.
250250

251251
Below, we list and describe in more detail the tools and IDEs supported for remote development.
252252

253-
### SSH Configuration (Necessary for PyCharm and VS Code)
253+
### SSH Configuration (Necessary for PyCharm, VS Code, and Cursor)
254254

255255
Your job will open an ssh server when you set the environment variable `SSH_SERVER=1`.
256256
You also have to mount the authorized keys file from your home directory to the container (done in the example).
@@ -424,10 +424,10 @@ You can find an example in `submit-scripts/remote-development.sh`.
424424
So far, it seems like the SSH env variables workaround works fine for this.
425425
- Support for programs with graphical interfaces (i.g. forwarding their interface) has not been tested yet.
426426

427-
### VSCode
427+
### VSCode / Cursor
428428

429429
We support the [Remote Development using SSH ](https://code.visualstudio.com/docs/remote/ssh)
430-
feature of VS code that runs a remote IDE in the container via SSH.
430+
feature of VS code that runs a remote IDE in the container via SSH. To set this up for Cursor, simply replace `VSCODE` by `CURSOR` and `vscode` by `cursor` in all instructions below. For example, `VSCODE_SERVER_AT` becomes `CURSOR_SERVER_AT`, and `~/.vscode-server` becomes `~/.cursor-server`.
431431

432432
**Preliminaries: saving the IDE configuration**
433433

installation/docker-amd64-cuda/EPFL-SCITAS-setup/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ When the container starts, its entrypoint does the following:
152152
- It then tries to install the project in editable mode.
153153
This is a lightweight installation that allows to avoid all the hacky import path manipulations.
154154
(This will be skipped if `PROJECT_ROOT_AT` has not been specified or if you specify `SKIP_INSTALL_PROJECT=1`.)
155-
- It also handles all the remote development setups (VS Code, PyCharm, Jupyter, ...)
155+
- It also handles all the remote development setups (VS Code, Cursor, PyCharm, Jupyter, ...)
156156
that you specify with environment variables.
157157
These are described in the later sections of this README.
158158
- Finally, it executes a provided command (e.g. `bash` here for an interactive job with a connected --pty).
@@ -207,7 +207,7 @@ to run with `sbatch`.
207207

208208
Below, we list and describe in more detail the tools and IDEs supported for remote development.
209209

210-
### SSH Configuration (Necessary for PyCharm and VS Code)
210+
### SSH Configuration (Necessary for PyCharm, VS Code, and Cursor)
211211

212212
Your job will open an ssh server when you set the environment variable `SSH_SERVER=1`.
213213
You also have to mount the authorized keys file from your home directory to the container (done in the example).
@@ -379,10 +379,10 @@ You can find an example in `submit-scripts/remote-development.sh`.
379379
So far, it seems like the SSH env variables workaround works fine for this.
380380
- Support for programs with graphical interfaces (i.g. forwarding their interface) has not been tested yet.
381381

382-
### VSCode
382+
### VSCode / Cursor
383383

384384
We support the [Remote Development using SSH ](https://code.visualstudio.com/docs/remote/ssh)
385-
feature of VS code that runs a remote IDE in the container via SSH.
385+
feature of VS code that runs a remote IDE in the container via SSH. To set this up for Cursor, simply replace `VSCODE` by `CURSOR` and `vscode` by `cursor` in all instructions below. For example, `VSCODE_SERVER_AT` becomes `CURSOR_SERVER_AT`, and `~/.vscode-server` becomes `~/.cursor-server`.
386386

387387
**Preliminaries: saving the IDE configuration**
388388

installation/docker-amd64-cuda/EPFL-runai-setup/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ When the container starts, its entrypoint does the following:
112112
(You can skip this if you have a different project structure,
113113
e.g.,
114114
just copied the installation directory of the template by not specifying `PROJECT_ROOT_AT`).
115-
- It also handles all the remote development setups (VS Code, PyCharm, Jupyter, ...)
115+
- It also handles all the remote development setups (VS Code, Cursor, PyCharm, Jupyter, ...)
116116
that you specify with environment variables.
117117
These are described in the later sections of this README.
118118
- Finally, it executes a provided command (e.g. `sleep infinity`), otherwise by default will run a shell and stop.
@@ -222,7 +222,7 @@ An example of an interactive job submission can be found in `submit-scripts/remo
222222

223223
Below, we list and describe in more detail the tools and IDEs supported for remote development.
224224

225-
### SSH Configuration (Necessary for PyCharm and VS Code)
225+
### SSH Configuration (Necessary for PyCharm, VS Code, and Cursor)
226226

227227
Your job will open an ssh server when you set the environment variable `SSH_SERVER=1`.
228228
This is necessary for some remote IDEs like PyCharm to work and can be beneficial
@@ -399,10 +399,11 @@ You can find an example in `submit-scripts/remote-development.sh`.
399399
So far, it seems like the SSH env variables workaround works fine for this.
400400
- Support for programs with graphical interfaces (i.g. forwarding their interface) has not been tested yet.
401401
402-
### VSCode
402+
### VSCode / Cursor
403403
404404
We support the [Remote Development using SSH ](https://code.visualstudio.com/docs/remote/ssh)
405-
feature of VS code that runs a remote IDE in the container via SSH.
405+
feature of VS code that runs a remote IDE in the container via SSH. To set this up for Cursor, simply replace `VSCODE` by `CURSOR` and `vscode` by `cursor` in all instructions below. For example, `VSCODE_SERVER_AT` becomes `CURSOR_SERVER_AT`, and `~/.vscode-server` becomes `~/.cursor-server`.
406+
406407
407408
**Preliminaries: saving the IDE configuration**
408409

installation/docker-amd64-cuda/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ services:
5757
# To persist IDE settings and cache.
5858
- ${HOME}/.template-gitconfig:/home/${USR}/.gitconfig
5959
- ${HOME}/.template-dev-vscode-server:/home/${USR}/.dev-vscode-server
60+
- ${HOME}/.template-dev-cursor-server:/home/${USR}/.dev-cursor-server
6061
- ${HOME}/.template-dev-jetbrains-server:/home/${USR}/.jetbrains-server
6162
environment:
6263
PYCHARM_IDE_AT: ${PYCHARM_IDE_AT}
6364
JETBRAINS_SERVER_AT: /home/${USR}/.jetbrains-server
6465
VSCODE_SERVER_AT: /home/${USR}/.dev-vscode-server
66+
CURSOR_SERVER_AT: /home/${USR}/.dev-cursor-server
6567

6668
run-local-cuda: # Service to run the image locally with NVIDIA GPU.
6769
extends:

installation/docker-amd64-cuda/entrypoints/remote-development-setup.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ if [ -n "${VSCODE_SERVER_AT}" ]; then
111111
ln -s "${PROJECT_VSCODE_SERVER_AT}" "${HOME}/.vscode-server"
112112
fi
113113

114+
####################
115+
## Cursor remote development server.
116+
# Same as VSCode up to naming
117+
118+
if [ -n "${CURSOR_SERVER_AT}" ]; then
119+
echo "[TEMPLATE INFO] Sym-linking to Cursor server config files."
120+
# Per-project server.
121+
# Create if doesn't exist.
122+
PROJECT_CURSOR_SERVER_AT="${CURSOR_SERVER_AT}/projects${PROJECT_ROOT_AT}"
123+
mkdir -p "${PROJECT_CURSOR_SERVER_AT}"
124+
ln -s "${PROJECT_CURSOR_SERVER_AT}" "${HOME}/.cursor-server"
125+
fi
126+
114127
#####################
115128
# Jupyter Lab server.
116129
# Jupyter must be installed in the environment.

0 commit comments

Comments
 (0)