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-04-25 14:05] – [Using SSH keys] anitasoftware:vscode:caviness [2025-03-13 16:29] (current) – [Setting up remote connections] anita
Line 2: Line 2:
  
 ==== Download and install ==== ==== Download and install ====
-  - Install the [[http://code.visualstudio.com/download|Stable Build VSCode]] on the local machine. **DO NOT** install the VSCode Insiders Build, as it will not work with the proxy.+  - Install the [[http://code.visualstudio.com/download|Stable Build VSCode]] on the local machine. **DO NOT** install the VSCode Insiders Build, as it will not work with the proxy. If the version of VSCode downloaded is newer than version 1.90, please make sure to do these [[software:vscode:caviness#additional-steps-required-for-vscode-newer-than-version-190|additional steps]].
   - Install a [[https://code.visualstudio.com/docs/remote/troubleshooting|supported SSH client]].   - Install a [[https://code.visualstudio.com/docs/remote/troubleshooting|supported SSH client]].
   - In the extensions tab of VSCode, search for [[https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh|Remote - SSH]] and install.   - In the extensions tab of VSCode, search for [[https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh|Remote - SSH]] and install.
Line 45: 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 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.+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 using ''it_css'' workgroup 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 122: Line 122:
 <note important> <note important>
 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>
 +
 +==== 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|}}
 +
 +==== Additional Steps required for VSCode newer than version 1.90 ====
 +
 +Recent releases of VSCode require a newer version of ''wget'' than the system's default version on Caviness. This discrepancy can result in a "connection failed" error as reported and discussed [[https://groups.google.com/a/udel.edu/g/hpc-ask/c/l8jvUHk2bUE/m/mAzWz7k5AAAJ|here]]. To resolve this, wget v1.24.5 has been installed at ''/opt/shared/wget/bin/wget''
 +
 +<note important>
 +
 +To ensure the updated version of wget is used by default, you can create a symbolic link in your ''~/bin'' directory by following the steps below:
 +
 +
 +1. Create a bin directory in your home directory (if it doesn't already exist):
 +<code>mkdir ~/bin</code>
 +
 +
 +2. Create a symbolic link for wget v1.24.5 in the ''~/bin'' directory:
 +<code>ln -s /opt/shared/wget/1.24.5/bin/wget ~/bin/wget</code>
 +
 +3. Modify your ''~/.bash_profile'' on Caviness:
 +
 +Update the PATH variable by changing the line from:
 +<code>PATH=$PATH:$HOME/.local/bin:$HOME/bin</code> 
 +to:
 +<code>PATH=$HOME/.local/bin:$HOME/bin:$PATH</code>
 +
 +4. Apply the changes to your ''~/.bash_profile'':
 +
 +After making the changes, you can apply them by either logging out and back in or by running:
 +<code>source ~/.bash_profile</code>
 +
 </note> </note>
  
 ==== 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. 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. Proceed to [[https://docs.hpc.udel.edu/software/vscode/caviness#connect-vscode-to-compute-node]]. 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 155: Line 202:
  
 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.1714068308.txt.gz
  • Last modified: 2024-04-25 14:05
  • by anita