Skip to content

Switching from Mox to Klone

Steven Goodreau edited this page Dec 29, 2023 · 2 revisions

Caution: I began taking these notes around Step 6, and had to go back and remember the previous ones. It's possible I've forgotten to include something before that point.

  1. Log into Klone: ssh [email protected]. If you do so from RStudioServer, you may want to create an alias for this. In the file .ssh/config, add the text below; then you can just use ssh klone. You probably already have comparable text for mox:
Host klone klone.hyak.uw.edu
    User userID
    HostName klone.hyak.uw.edu
    ControlPath ~/.ssh/master-%r@%h:%p
    ControlMaster auto
    ControlPersist yes
    Compression yes
  1. Re-create all your aliases. These are in ~/.bashrc. You will want to edit them to point to klone instead of mox, of course.

  2. Learn about the directory structure. A good place for more info is: https://hyak.uw.edu/docs/storage/gscratch/. Basically:

    • Your home directory is at /usr/lusers/userID on Mox, but /mmfs1/home/userID on Klone. If you have any aliases pointing here, you'll need to update them.

    • On mox you had gscratch drives for yourself and within your org, i.e. /gscratch/home/userID and /gscratch/csde/userID. On klone, there is no /gscratch/home; it's just by org, so /gscratch/csde/userID.

    • Note that /gscratch is mirrored at /mmfs1/gscratch/. My guess is that this is done to allow some relative paths that worked on mox to keep doing so on klone.

  3. Re-build your project's directory structure. I did this manually, since mine isn't that complicated.

  4. Copy up all your project files. Your aliases will likely help you here.

  5. Set up the loadR.sh file. This is in your home directory. It fill need some different content than the version on mox, including the syntax for how R is loaded. Here is the version from Adrien. You should be able to change the version of R to any that is built. Note that you are not yet running this.

#!/bin/bash
. /gscratch/csde/spack/spack/share/spack/setup-env.sh
spack unload -a
spack load [email protected]
spack load git
  1. Make note of the fact that there are no build nodes on Klone! This means that you will need to use a compute node to do the things you used to do on a build node. This means that you'll want to replace your build alias with a comparable compute one: alias compute='srun -p compute --time=3:00:00 --mem=20G --pty /bin/bash'

  2. Find the compiler and copy the file. Before you can load R the first time, you need to tell Spack to find the compiler. You only need to do this once on Klone. Load spack with . /gscratch/csde/spack/spack/share/spack/setup-env.sh and then type spack compiler find. This should give you the path to a .yaml file; copy it to ~/.spack/linux/compilers.yaml. This may not work (it didn't for Steve G). If not, you can grab the file manually from a colleague's directory (e.g. mmfs1/home/goodreau/.spack/linux/compilers.yaml) and copy it to ~/.spack/linux/compilers.yaml.

  3. Find the available versions of R with spack find r. Edit your loadR.sh file to use the version you prefer.

  4. Open R. If you haven't loaded spack yet this session, type . /gscratch/csde/spack/spack/share/spack/setup-env.sh). Then spack load [email protected], using whichever version number you prefer.

  5. Set your Github PAT. There are multiple ways to do this, but I find the easiest is to add the following line directly into a file .Renviron in your home directory: GITHUB_PAT=xxxxxxxxxxxxxxxxxxxxxxxxxxxx.

  6. Set up your R packages, using renv or otherwise. This should all be one the same way you would do it on Mox.

  7. Optional add some additional useful aliases. Drawn from here, I use alias lspack='. /gscratch/csde/spack/spack/share/spack/setup-env.sh' and alias lr='lspack; spack load git; spack load [email protected]; R --no-save --no-restore'.

  8. Learn klone's added functionality. The first one I've discovered is the very useful command hyakstorage.