cluster:usage_tips:visual-studio

You might want to use Visual Studio (VS) Code for coding on cluster instead of the jupyter lab environment provided as standard.

VS Code has many advantages over the standard jupyter lab application programming interface such as integrated variable inspector, graphical source control for git as well as many other user friendly configurations and smart coding extensions.

If you are interested to try out VS Code, follow the intructions below:

1) Download the latest version suitable for your os:

 https://code.visualstudio.com/download

2) Install the software following:

 https://code.visualstudio.com/docs/setup

3) Configure the application programming interface as you like. I recommend going through the “walkthroughs” provided by Microsoft.

For connecting VS Code to cluster you will need to install extensions:

1) Go to the “Extensions” sidebar in VS Code

2) Search for “Remote - SSH”

  
  Install:
  Remote - SSH
   Remote - SSH:Editing Configuration Files

3) Then search for “Python”

  
  Install:
  Python

4) Then search for “Jupyter”

  
  Install:
  Jupyter
  Jupyter Notebook Renderers

5) If you are usign git for source control (which I do recommend!) search for “Github Pull Requests and Issues” and install it.

6) I also have these extensions installed (not sure if necessarily needed but you might be interested):

 Pylance
  Jupyter Cell Tags
  Jupyter Keymap
  Jupyter Slide Show

Now you are ready to connect VS Code to cluster. Follow instructions below or https://code.visualstudio.com/docs/remote/ssh:

1) Got to “Remote explorer” sidebar 2) From SSH targets choose “Add new” 3) Write ssh your-cluster-username@130.208.209.4 (might need to add ssh-keygen before this, update the instructions if so) 4) Select platform of the remote host: “Linux” 5) VS code should connect to remote and new window opens 6) You should now see the connection in remote explorer and in status bar and be able to access your /home folder on cluster through explorer sidebar

If you have problems setting up the connection, you can refer to:

  
  https://code.visualstudio.com/docs/remote/ssh
  • cluster/usage_tips/visual-studio.txt
  • Last modified: 2022/11/02 06:29
  • by matiasrus