HPC Access

Pre-Requisites:

Generating Key Pair from your Device

  • For Windows
    • First, open “PowerShell” and execute the following command to generate public/private RSA key pair: ssh-keygen
    • You can click enter without entering anything for a default file location and you are advised to enter your paraphrase for security.
    • Your public key has been saved in C:\Users\[username]/.ssh/id_rsa.pub if you didn’t change the file location.
  • For MacOS/Linux
    • First, open Terminal and execute the following command to generate public/private RSA key pair: ssh-keygen -t rsa 
    • You can click enter without entering anything for a default file location and you are advised to enter your paraphrase for security.
    • Your public key has been saved in /Users/[username]/.ssh/id_rsa.pub if you didn’t change the file location.

Sending your SSH Public Key to the Server

  • OpenSSH provides a handy tool call called ssh-copy-id for copying ssh public keys to remote systems. It even creates required directories and files.
  • For MacOS, enter the following command on the terminal: ssh-copy-id -i <location of the pub key ex ~/.ssh/id_rsa.pub)> <username>@hpc.cspc.edu.ph
  • For Windows, enter the following command on the Windows Powershell: ssh -i <location of the pub key ex ~/.ssh/id_rsa.pub)> <username>@hpc.cspc.edu.ph
  • When prompted, enter the password for your user account at the remote server. Your public key should be copied at the appropriate folder on the remote server automatically.

Accessing Server via SSH

  • VS Code and the required extension must be installed before following this step-by-step instructions.
  • Click on the blue button on the lower left part of the VS Code window.
  • A small window modal will appear. Click on “Connect to Host”, then a new window modal will appear. Click on ”Add New SSH Host.”
  • Then enter this SSH Command: <username>@hpc.cspc.edu.ph
  • It will ask for an SSH configuration file, just click “Enter.”
  • A window modal will appear at the bottom right part of the screen saying Host Added. Click on “Connect”.
  • A new VS Code window will appear and will ask for your paraphrase from your generated SSH key pair earlier or the password of your account. Enter your SSH paraphrase or password to continue then click ”Enter”
  • If successful, you will see the status of your SSH connection on the bottom left part of the VS Code window.

Accessing your Server Files via SSH

  • Once you establish an SSH Connection to the GPU Server, you can now access the GPU Server files. 
  • Click the “Open Folder” Button on the Explorer Sidebar. A window modal will appear and just click the “OK” button. Then, enter your paraphrase key to continue.
  • Once you establish an SSH Connection to the GPU Server and its Files, you can now start setting up your own python environment via conda using the VS Code Terminal.

Setting up your own Python environment

  • The default python environment is “base”. To create your own environment, type the following on the VS Code Terminal: conda create –name <env-name>
  • Then click enter to continue.
  • Then it will ask for the location of the environment. Just type “y” to proceed with the default location. Then click enter to continue.
  • Once successful, it will show how to activate or deactivate the environment.
  • To activate the environment, type the following command, then click enter: conda activate <env_name>
  • Then it will now show your environment name, instead of the “base” environment.
  • You can now start installing python packages and libraries such as Tensorflow, NLTK, Scikit-Learn and others using the pip installer.