Getting Started with Hyak - statnet/computing GitHub Wiki
Setting up an account
To use the CSDE Hyak nodes (Klone is latest generation, as of 4/2021), all of the following are required:
- CSDE Computing admins must add your UW NetID to the group “u_hyak_csde” to enable access. Request Hyak access from [email protected].
- You need to have DUO two-factor enrollment enabled on your UWNETID. CSDE Help must do this on your behalf if you are not a current UW member. If you are a current UW member you can enroll your device yourself
- You must enroll a compatible two factor device in the UW Duo system.
- You must add the Hyak server and the Lolo server (storage system) to your UW NetID self-services pages. To do this, click here, click “Computing Services,” check the the “Hyak Server” and “Lolo Server” boxes in the “Inactive Services” section, click “Subscribe” at the bottom of the page, and click “Finish.” After subscribing, it may take up to an hour to be fully provisioned.
Helpful Hyak Links
- The official Hyak Wiki
- At login, do you get the message:
Sorry, that's not a good PRN
? Then Reset your PRN
Hyak Linux Scripts
Below are some helpful scripts for linux to automate some tedious log-in and file transfer processes.
ssh Config File
The ssh Config file allows you to use short logins at the terminal. On your local machine, set up your own config file:
cd .ssh
ls
If a config
file does not exist then:
touch config
Then edit the config
file:
vi config
Press i
to get into interactive mode, then add this to the file:
Host mox mox.hyak.uw.edu
User <your hyak username>
HostName mox.hyak.uw.edu
ControlPath ~/.ssh/master-%r@%h:%p
ControlMaster auto
ControlPersist yes
Compression yes
Host union
User <your csde account name>
HostName union.csde.washington.edu
Host libra
User <your csde account name>
HostName libra.csde.washington.edu
Host nori
User <your csde account name>
HostName nori.csde.washington.edu
To close vi
, press esc
then :wq
.
Now in the terminal window, you can log on to hyak just with:
ssh mox
Once you are logged on to hyak, set up the config file there to easily switch between hyak and CSDE linux nodes. Follow the same procedures to open the config
file on hyak, entering the following lines:
Host union
User <your csde account name>
HostName union.csde.washington.edu
Host libra
User <your csde account name>
HostName libra.csde.washington.edu
ssh Keyless Login
Setting up keyless login allows you to bypass having to enter your password every time you ssh. This isn't allowed for Hyak (you will always need your keygen), but it is for the CSDE cluster. This is highly recommended as it will save time when transferring files between Hyak and CSDE or your local computer.
To get started, on your local machine type the following to generate a private-public linked key:
ssh-keygen -t rsa
If prompted for a file name or password, hit enter until a public key is created.
Now add that key onto your authorized key file on union.
ssh union mkdir -p .ssh
cat .ssh/id_rsa.pub | ssh union 'cat >> .ssh/authorized_keys'
Next, log in to Hyak and follow the similar two steps, but omitting the mkdir step since you already made the directory:
ssh-keygen -t rsa
cat .ssh/id_rsa.pub | ssh union 'cat >> .ssh/authorized_keys'
Finally, test the passwordless logins between local-to-union and hyak-to-union.
Aliases
Linux aliases are shortcuts in typing. In each of the alias listings below, typing what is on the left side of the equals sign will be shorthand for what's on the right side. Again, this is a big time saver for often-repeated commands.
Login to hyak. Aliases here are stored in a file called either .bashrc
or .bash_profile
in your home directory. To take a look at what's currently in it:
cat .bashrc
If the command reads "no such file", then try it with the .bash_profile
file. It's unclear why, but it seems like most newer Hyak users have the latter rather than the former file. They both function the same way: the commands you put in here will be automatically source
'ed in when you log on to Hyak.
To edit it, use the vi
method from above, and consider adding these types of these aliases to your file. These are just examples, and you can always come back and edit this file later.
This is shorthand for changing the directory to your local gscratch folder (where you should save your simulation results). You can name that alias anything you want (not just gsr
) and you can point it to any folder you want (e.g., you shouldn't just point it to Sam's folder).
alias gsr='cd /gscratch/csde/sjenness'
As you will learn next, there are four types of nodes on the Hyak cluster. These aliases start up jobs on the interactive node and build node, respectively.
alias shell='srun -N 1 -p csde -A csde --time=24:00:00 --mem=50G --pty /bin/bash'
alias build='srun -p build --time=2:00:00 --mem=20G --pty /bin/bash'
The scp
command is short for secure copy, and it is the way to transfer files between Hyak and outside computers. The first command here transfers data from Hyak to CSDE (and specifically, .rda
files from that specific folder on Hyak to that specific folder on CSDE's libra node). The second command transfers scripts from CSDE to Hyak (and specifically any files ending with .R
or .s
from that specific folder on libra to that specific folder on Hyak).
alias transdat='scp /gscratch/csde/sjenness/project/*.rda libra:~/project/data'
alias transscr='scp libra:~/project/*.[Rs]* /gscratch/csde/sjenness/project/'
To test whether they were set correctly, logout
and login again, then type alias
.
You can set similar aliases on your local computer. If you transferring many files between Hyak and your local computer, be sure to log on to Hyak in one session, then open another session to do the file transfers (otherwise, you'll have to enter your password and keygen number each time).