software:vscode:caviness

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:vscode:caviness [2024-03-28 11:08] anitasoftware:vscode:caviness [2024-04-26 17:34] (current) anita
Line 21: Line 21:
     "remote.SSH.localServerDownload": "off",     "remote.SSH.localServerDownload": "off",
     "remote.SSH.lockfilesInTmp": true,     "remote.SSH.lockfilesInTmp": true,
 +    "remote.SSH.useLocalServer": true,
 +    "remote.SSH.useExecServer": false,
     "remote.SSH.enableRemoteCommand": true     "remote.SSH.enableRemoteCommand": true
 </code> </code>
    
-Clicking on the 'x' next to ''{} settings.json'' will prompt you to save the settings file. Again keep in mind ''~/vscode-remote-ssh/config'' is used for illustrative purposes. You can change this to specify the path and filename of choice. The ''Connect Timeout'' is set to 300 seconds in order to allow Slurm enough time to schedule and launch the interactive job.+Clicking on the ''X'' next to ''{} settings.json'' will prompt you to save the settings file. Again keep in mind ''~/vscode-remote-ssh/config'' is used for illustrative purposes. You can change this to specify the path and filename of choice. The ''Connect Timeout'' is set to 300 seconds in order to allow Slurm enough time to schedule and launch the interactive job.
  
 <note important> <note important>
Line 36: Line 38:
 </note> </note>
  
-Now, click on the 'x' to close the ''Settings'' tab for the ''Remote - SSH Extensions Settings''. On the lower left corner, click the button ''Open a Remote Window''(or ''F1''), select ''Connect Current Window to Host'' and then ''Configure SSH Hosts''+Now, click on the ''X'' to close the ''Settings'' tab for the ''Remote - SSH Extensions Settings''. On the lower left corner, click the button ''Open a Remote Window''(or ''F1''), select ''Connect Current Window to Host'' and then ''Configure SSH Hosts''
  
 {{:software:vscode:vscode-4.png?400|}} {{:software:vscode:vscode-4.png?400|}}
Line 43: Line 45:
 {{:software:vscode:vscode-7.png?400|}} {{:software:vscode:vscode-7.png?400|}}
  
-It will open the Config file located in the path specified by ''~/vscode-remote-ssh/config''. You may have multiple configurations used for Caviness with different Host names. For example, in this Config file, ''Host Caviness'' starts the interactive job on the ''devel'' partition and requests 4 CPUs for the remote shell to use. '' Host CavinessGPU'' requests the GPU for the interactive job.+It will open the Config file located in the path specified by ''~/vscode-remote-ssh/config''. You may have multiple configurations used for Caviness with different Host definitions. For example, in this Config file, ''Host Caviness'' starts the interactive job on the ''devel'' partition and requests 4 CPUs for the remote shell to use. '' Host CavinessGPU'' requests a P100 GPU for the interactive job on the ''devel'' partition.
  
 For this example,  the Config file ''~/vscode-remote-ssh/config'' contains the following definitions  (remember User ''traine'' should be replace with your username as well as possible partition and other options) For this example,  the Config file ''~/vscode-remote-ssh/config'' contains the following definitions  (remember User ''traine'' should be replace with your username as well as possible partition and other options)
Line 121: Line 123:
 Do not run the script ''vscode-shell-proxy'' itself on the login node, as it will start a remote interactive session. Do not run the script ''vscode-shell-proxy'' itself on the login node, as it will start a remote interactive session.
 </note> </note>
 +
 +==== Connect VSCode to Compute Node ====
 +Now, we can connect the VSCode to the compute node. Follow the similar steps when adding the Config file from the [[:software:vscode:caviness#setting-up-remote-connections|Setting up Remote Connections]] except step 3. Since we created the host named ''Caviness'', choose it and enter the credentials for Caviness login (or use [[software:vscode:caviness#using-ssh-keys|SSH keys]]). 
 +
 +{{:software:vscode:vscode-4.png?400|}}
 +{{:software:vscode:vscode-5.png?400|}}
 +{{:software:vscode:vscode-8.png?400|}}
 +
 +After successful login, you will now connect to the compute node. Open the built-in terminal in VSCode and print the hostname,
 +
 +<code>
 +[(it_css:traine)@r00n56 ~]$ hostname
 +r00n56.localdomain.hpc.udel.edu
 +</code>
 +
 +You can open the file on your home directory in Caviness and edit it. After completing the job, click ''Close Remote Connection'' to stop the job.
 +{{:software:vscode:vscode-9.png?400|}}
  
 ==== Using SSH keys ==== ==== Using SSH keys ====
-SSH public key authentication is a secure way to authenticate with an SSH host by combining a local "private" key with a "public" key associated with your user account. Once you set up the SSH keys, you will not need to enter the password for every login. Please only generate the SSH keys on the trusted computer. For macOS / Linux, you can run the following command in a local terminal:+SSH public key authentication is a secure way to authenticate with an SSH host by combining a local "private" key with a "public" key associated with your user account. Once you set up the SSH keys, you will not need to enter the password for every login. If you have previously set up your SSH keys (i.e. you can login with SSH to Caviness without having to enter your password), then you do not need to do this step unless you want to create SSH keys specifically for VSCode. Please only generate the SSH keys on the trusted computer. For macOS / Linux, you can run the following command in a local terminal:
 <code> <code>
 ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519-remote-ssh ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519-remote-ssh
Line 132: Line 151:
 For Windows, run the following command in a local PowerShell as administrator: For Windows, run the following command in a local PowerShell as administrator:
 <code> <code>
-ssh-keygen -t ed25519 -f "$HOME\.ssh\id_ed25519-remote-ssh.pub"+ssh-keygen -t ed25519 -f "$HOME\.ssh\id_ed25519-remote-ssh"
 $USER_AT_HOST="your-user-name@caviness.hpc.udel.edu" $USER_AT_HOST="your-user-name@caviness.hpc.udel.edu"
 $PUBKEYPATH="$HOME\.ssh\id_ed25519-remote-ssh.pub" $PUBKEYPATH="$HOME\.ssh\id_ed25519-remote-ssh.pub"
Line 153: Line 172:
  
 For more information, please refer to [[https://code.visualstudio.com/docs/remote/troubleshooting|SSH tips]]. For more information, please refer to [[https://code.visualstudio.com/docs/remote/troubleshooting|SSH tips]].
-==== Connect VSCode to Compute Node ==== 
-Now, we can connect the VSCode to the compute node. Follow the similar steps when adding the Config file from the [[:software:vscode:caviness#setting-up-remote-connections|Setting up Remote Connections]] except step 3. Since we created the host named ''Caviness'', choose it and enter the credentials for Caviness login (or use [[software:vscode:caviness#using-ssh-keys|SSH keys]]).  
- 
-{{:software:vscode:vscode-4.png?400|}} 
-{{:software:vscode:vscode-5.png?400|}} 
-{{:software:vscode:vscode-8.png?400|}} 
- 
-After successful login, you will now connect to the compute node. Open the built-in terminal in VSCode and print the hostname, 
- 
-<code> 
-[(it_css:traine)@r00n56 ~]$ hostname 
-r00n56.localdomain.hpc.udel.edu 
-</code> 
- 
-You can open the file on your home directory in Caviness and edit it. After completing the job, click ''Close Remote Connection'' to stop the job. 
-{{:software:vscode:vscode-9.png?400|}} 
  • software/vscode/caviness.1711638520.txt.gz
  • Last modified: 2024-03-28 11:08
  • by anita