-
Notifications
You must be signed in to change notification settings - Fork 0
Threadripper workstation
The following are ways to interact with and use Nathan Skene's Threadripper workstation (or really any computer) remotely.
Certain programs within applications (e.g. Rstudio/R/Python) will try to parallelise many processes. But an ongoing issue seems to be that the Threadripper doesn't always close these processes (e.g. when you force an R command to stop early). This means that processes can accumulate, causing applications like Rstudio to crash, even or cause the whole machine to crash/restart!
To avoid this, you have to pay close attention to how many resources you're using with a manager software like htop. Simply open a command line window on the Threadripper (via Teamviewer or via a remote ssh session) and enter:
htop
This will show all of the processes currently running on the Threadripper.
You can then kill
the ones that are no longer needed.
Connect to the Threadripper via the command line (Mac Terminal) on your local machine. Ask Nathan Skene to create a username/password for you first.
ssh <username>@wmcr-nskene.med.ic.ac.uk
You can interact with Rstudio on the Threadripper via your web browser, by accessing a Docker image that's running on the Threadripper.
Brian Schilder has already created an Rstudio Docker image and launched it so it can be used by anyone in the lab.
Open the following link in your web browser: http://129.31.68.96:8787/
Then login using the following credentials:
USERNAME: rstudio
PASSWORD: scflow
If you ever need to create a new Docker image, you can follow these steps beforehand.
Here we will use the scfdev
Docker container, which is stored on Docker Hub courtesy of Alan Murphy (see here for more details).
To create the image, run the following in the Threadripper command line.
docker run
-e PASSWORD=scflow
-d -v /mnt/raid1/:/home/rstudio/raid1
-e ROOT=true
-p 8787:8787 almurphy/scfdev
Notes:
- Make sure you mount whatever folders you need access to from within Rstudio with one or more
-v
arguments. - Make sure you set your mounted file/folder permissions to be accessible by via the Rstudio server, e.g.:
chmod -R u=rwx,go=rwx <my_subfolder>/
- Note that we mount the folder
/mnt/raid1
which is an 8TB hard drive connected to the Threadripper. It's preferable to use this as it has much more storage capacity than the Threadripper's main hard drive (~750GB).
Troubleshooting:
- If you encounter errors, check that you can run
docker run hello-world
successfully. - If you get the error
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'.
then runnewgrp docker
first. - You can also add
newgrp docker
to your bash profile (nano ~/.bashrc
) so you don't have to run it manually each time you login.
This -p 8787:8787
bit forwards the port from inside of the docker image to the workstation, so it's -p <workstation_port>:<docker_port>
. If you wanted to run a new docker image then you could, for example, change this to : -p 8786:8787
and then connect to http://129.31.68.96:8786/ etc.
Notes:
- You may need to
sudo ufw enable 8786
first to ensure you can use that port.
Connect to a remote Jupyter notebook on the Threadripper as if it were on your local computer.
For detailed instructions, follow this Tutorial. To summarise you:
- If you haven't done so already, create a password for Jupyter on the Threadripper
jupyter notebook password
- Start a Jupyter notebook instance on the Threadripper (via command line).
- NOTE: make sure you change
<username>
to your actual Threadripper username first. Access it using the following bash command on your local computer saved in your
function tr_jupyter(){
# Forwards port $1 into port $2 and listens to it
### Example of what the final command looks like ###
## ssh -N -f -L localhost:1080:localhost:1070 bschilder@wmcr-nskene.med.ic.ac.uk
### A more flexible function to use any port you want
ssh -N -f -L localhost:$2:localhost:$1 <username>@wmcr-nskene.med.ic.ac.uk
open http://localhost:$2/
}
- Make sure the function is loaded (e.g.
- In command line, run:
- This will open a Jupyter notebook folder in your web browser, which you can then use to open a Jupyter notebook. Importantly, this notebook has access to files on the Threadripper and runs commands using the Threadripper's computing resources.
- If Jupyter doesn't automatically launch, you can also go to
- Install macFUSE.
- Create the folder that will be used as an access point to your remote computer's folder system.
sudo mkdir /Volumes/TR
sudo chown ${USER}:staff /Volumes/TR
- Mount the remote computer:
sshfs <username>@wmcr-nskene.med.ic.ac.uk:/home/<username> /Volumes/TR -o allow_other -o noappledouble -o volname=TR -o follow_symlinks
- [
ln -s /Volumes/TR ~/Desktop
The mounted subfolder will erase itself each time you umount it. To make this easier to remount each time, you can turn these commands into a function and add it to your ~/.bash_profile
or ~/.bashrc
.
nano ~/.bashrc
mountTR(){
diskutil umount force /Volumes/TR
sudo mkdir /Volumes/TR
sudo chown ${USER}:staff /Volumes/TR
sshfs <username>@wmcr-nskene.med.ic.ac.uk:/home/<username> /Volumes/TR -o allow_other -o noappledouble -o volname=TR -o follow_symlinks
}
The next step assumes your bash_profile/bashrc
have been sourced upon login.
If they haven't been, run source ~/.bash_profile
or source ~/.bashrc
first.
Then, simply run the function we created in command line.
mountTR()
The mounted folder should now appear, and be accessible via the link you created on your Desktop (if you did that step).
When setting this up, you might run into this error:
mount_macfuse: mount point /Volumes/TR is itself on a macFUSE volume
This arises when you've previously (unsuccessfully) tried mounting the directory of the same name.
To overcome this, simply run the following (Note; make sure you type umount, not unmount)
umount /Volumes/TR
If the above approaches don't work for you, you can also try the suggestion here:
https://unix.stackexchange.com/questions/62677/best-way-to-mount-remote-folder
- Download and install the Teamviewer app:
- Follow the instructions to create/login to a Teamviewer account.
- Ask Nathan Skene for the Threadripper login credentials (Partner ID and password).
Managing core and memory usage is important when using the Threadripper.
Programs like Rstudio are not very good at cancelling processes on the machine that you ended with Rstudio (e.g. via CTRL+C
or ESC
). This means that you can easily clog up the Threadripper with jobs you thought you cancelled already, but are actually still running indefinitely in the background.
The easiest way to kill processes on the TR is to use htop.
In command line:
htop
- Hit spacebar to select the processes you want to affect (use the up/down keys or click to move around). Hit spacebar again on the same item to deselect. Use
SHIFT+U
to deselect all items.-
/usr/lib/rstudio/libexec/QtWebEngineProcess
... When trying to kill Rstudio processes, look for rows with something similar to the following in the
-
- You can sort the processes according to different columns (including
- %MEM
- Hit
k
and then9
on your keyboard. Then hitEnter
. This will kill the selected processes.- Note, unless you have root privileges, you can only kill processes that you started (i.e.
htop is also quite handy for Macs, and can be easily installed via brew here.
- Home
- Useful Info
- To do list for new starters
- Recommended Reading
-
Computing
- Our Private Cloud System
- Cloud Computing
- Docker
- Creating a Bioconductor package
- PBS example scripts for the Imperial HPC
- HPC Issues list
- Nextflow
- Analysing TIP-seq data with the nf-core/cutandrun pipeline
- Shared tools on Imperial HPC
- VSCode
- Working with Google Cloud Platform
- Retrieving raw sequence data from the SRA
- Submitting read data to the European Nucleotide Archive
- R markdown
- Lab software
- Genetics
- Reproducibility
- The Lab Website
- Experimental
- Lab resources
- Administrative stuff