Reserve an HPC-VCL Node

We strongly recommend users of VS Code to login to an HPC-VCL node (instead of an HPC login node, such as login01, login02, etc) to do their work. VS Code has been found to put a significant strain on resources on the HPC login nodes. Follow the below directions to do reserve an HPC-VCL node:

  1. Reserve an HPC-VCL node (RHEL 9 image) at: https://vcl.ncsu.edu .
  2. Once you get a reservation, click "Connect!"
  3. Copy the HPC-VCL IP address given there, after the words"Remote Computer". In the rest of this tutorial, the HPC-VCL IP address will be referred to as " <hpc-vcl ip address> ".

Installing and Configuring VS Code, and Using VS Code to Login to HPC-VCL

  1. Download and install VS Code (do one of following: a. or b.)
    1. If your computer is managed by an NCSU configuration management service, please use appropriate university configuration management system app (e.g., Jamf “Self Service” app for a Mac) to install VS Code.
    2. Otherwise, if your machine is not managed by an NCSU configuration management service, download and install the software manually from: https://code.visualstudio.com/
  2. Follow instructions at this website for installing the "Remote-SSH" VS Code extension, but do not connect to HPC-VCL yet : https://code.visualstudio.com/docs/remote/ssh.
  3. In the main VS Code window, press on your keyboard Command+Shift+X [Ctrl+Shift+X], click on "Remote-SSH" under "Installed" in the column on left side of the window, click the gear symbol from within the main window showing "Remote-SSH", and click "Extension Settings". Scroll down to remote.SSH.showLoginTerminal, and make sure the box is checked for this setting.
  4. In the main VS Code window, press on your keyboard Command+Shift+X [Ctrl+Shift+X], click on "Remote-SSH" under "Installed" in the column on left side of the window, click the gear symbol from within the main window showing "Remote-SSH", and click "Extension Settings". Scroll down to remote.SSH: Connect Timeout, and type “300”.
  5. In the main VS Code window, press on your keyboard Command+, [Ctrl+,], type in files.watcherExclude, and add the pattern “**” (without the quotes), and click “OK”.
  6. In the main VS Code window, press on your keyboard Command+, [Ctrl+,], type in search.exclude, and add the pattern “**” (without the quotes), and click “OK”.
  7. In the main VS Code window, press on your keyboard Command+, [Ctrl+,], type in search.followSymlinks, make sure it is unchecked
  8. In the main VS Code window, press on your keyboard Command+Shift+X [Ctrl+Shift+X], type in “todo tree”, click on the extension “Todo Tree”, and then in the right-side window click “Uninstall” (just make sure it is not installed)
  9. In the main VS Code window, press on your keyboard Command+, [Ctrl+,], type in trust.banner, and from the pull-down menu select “always”.
  10. (Continually, as you use VS Code): If you are using the “Explorer” feature in VS Code (top of left column in main window, looks like two sheets of paper, with the top paper having a corner folded down) to browse your files, please always select “No, I don’t trust the authors” when the dialogue box pops open. This will make it so you browse the folder in “Restricted Mode”, which reduces the processing power needed to browse the files/folders. This dialogue box usually appears the first time you navigate to a folder that you have not navigated to before.
  11. Connect to HPC-VCL
    1. Type Command+Shift+P [Ctrl+Shift+p], type in "Remote-SSH: Connect to Host...", and hit return [enter]
    2. Click "Add New SSH host"
    3. Type in <user_name>@<hpc-vcl ip address>, where <user_name> is your Hazel login ID (unity ID), and <hpc-vcl ip address> is the IP address of the HPC-VCL you reserved in the steps above.Now press return [enter] on keyboard .
    4. Press return [enter] again to select the default location for the config file
    5. Press Command+Shift+P [Ctrl+Shift+P] again, type in "Remote-SSH: Connect to Host...", and hit return [enter]. Click the connection you just created.
    6. If it asks for for Platform of Remote Host, select Linux
    7. In the terminal, if it asks "Are you sure you want to continue connecting (yes/no/[fingerprint])?", then type yes and press return [enter]
    8. Type in your password to login to Hazel, and complete the Duo two-factor authentication
    9. If a Window pops up asking "You are about to connect to an OS version that is unsupported by Visual Studio Code", click Allow
    10. It may take a minute or two to login to HPC-VCL.
    11. In the terminal window (in the menu bar click “View”, then “Terminal” if terminal section of window does not appear), click the "+" sign to get a new terminal window and bash shell in which to type your commands into HPC-VCL login node (it may take a while for a terminal prompt to appear).
  12. When you are done using the login node, press Command+Shift+P [Ctrl+Shift+P], type in "Remote: Close Remote Connection", and press return [enter]. This should end your SSH connection to the login node.

Cleaning up Lingering Processes on Hazel Login Node (Required for use of VS Code only if you Logged into a Hazel Login Node (e.g., login01, login02, etc.), not Required if you Logged into an HPC-VCL node):

We have found that VS Code does not shut down the ssh tunnel cleanly, thus, the user must manually kill any lingering VS Code processes left on the login node they were working on.

Issue the following commands with caution, as they will kill ALL VS Code processes (and any other process you have running called “node”) you have on the login node that you specify, including all old/lingering and current processes.

  1. Make sure you have ended your VS Code ssh login session to HPC. To end the session, press Command+Shift+P [Ctrl+Shift+P], type in "Remote: Close Remote Connection", and press return [enter]
  2. Login to <user_name>@<login_node>.hpc.ncsu.edu using an application other than VS Code. Replace <user_name> with your user name, and <login_node> with the login node that has the rogue “node” processes on it, e.g., login01, or login02, etc.
  3. Once logged in, issue the command: ps xu | grep .vscode-server | grep -v grep | awk '{print $2}' | xargs -r kill -9
  4. Confirm processes are killed by Typing in top -u $USER at the command prompt, and make sure there are no processes called "node" or "code-..."

Trouble logging in to Hazel using VS Code, Try the Following

  1. From some other application (see https://hpc.ncsu.edu/Documents/Login.php), while connected to a HPC login node, remove the $HOME/.vscode-server directory using the following instructions.

    Issue the following commands with caution, as they may kill ALL VS Code sessions and processes you have on all login nodes, including all old/lingering and current processes.

    1. If you have manually put important files into the directory $HOME/.vscode-server, move them out before removing the directory.

    2. rm -rf $HOME/.vscode-server. ####Note: The .vscode-server directory will just be downloaded again by VS Code next time you connect to Hazel using VSCode.
    3. Then try logging in to Hazel again through VS Code.