VSCode in interactive node¶
Description¶
These are the instructions to use Visual Studio Code to run and debug scripts/notebooks within an interactive node from the cluster.
Requirements¶
- Conda or Mamba installed
- Have an account on ngrok
Create a conda environment¶
The conda environment must include the packages code-server
, pyngrok
and screen
Run code server in a screen (inside login01
)¶
Right after creating the screen, create an interactive session and remember on which node you are allocated.
Exit the screen with Ctrl + A + D
Run a Ngrok tunnel in a screen (inside login01
)¶
Note
If this is your first time doing this step, you'll first need to setup your authentification token for ngrok.
- Log in to your ngrok home page.
- On the left-hand side bar:
Getting Started > Your Authtoken
- On the
Command Line
section, copy only the key, which is the big string with random letters and numbers. -
Go back to the terminanl in the cluster (with the
vsc_pyngrok
environment activated) and add your authentification token with the following command:ngrok authtoken <the_token_you_copied_in_the_previous_step>
This setup only has to be done once.
Copy the URL to your browser and exit the session Ctrl + A + D
Check your VSCode password¶
Browse your VSCode remotely¶
When entering the URL in your browser, click Visit site
and introduce the password you obtained in the previous step in order to be able to use VSCode.
Reference¶
- Jordi Deu Pons
- Carlos López-Elorduy
- Federica Brando