-
Notifications
You must be signed in to change notification settings - Fork 9
Using the servers
Please read this document carefully before using the institute servers for the first time, at least the part on Monitoring.
The institute servers are running Ubuntu Linux. Using them requires at least a basic knowledge of the Linux command-line environment. There are many introductory materials online, this one covers the absolute basics.
All computing resources (CPU, RAM, I/O, disk space, etc.) are shared with other users and
it is your responsibility to make sure that you do not disrupt other users' work. The htop
tool makes it easy to track CPU and memory use, the du
tool can help in analyzing disk usage. If you need to use many CPUs at once, always use the nice command to launch your processes. If you're doing something I/O intensive, you should also use ionice.
Always keep an eye on the overall CPU and memory use of the server so that you know immediately if there is trouble.
Here's an example of things gone wrong:
At the bottom you can see that all of the server's RAM is in use, which is never good (most likely some applications are already running out of RAM and slowing down to the point of being unusable), and the system load (187) is more than 3 times the number of CPUs (56) , which means there is a 3x mismatch between the demand for CPU by applications and the actual resources available. See here for a detailed explanation of htop
.
You should avoid using the default python environment (you cannot install packages into it anyway). Virtual environment managers will let you create a Python environment for each project where you can install packages. We recommend conda
, you can get an easy-to-use minimal version here.
If you require other packages, usually you should find a way to install it locally, since on the servers only administrators have sudo privileges. Some tools offer explicit instructions for this, others make pre-compiled binaries available, and for open-source software you can always compile them yourself. See also the section on docker.
By default your processes are tied to the SSH connection you are using to access the servers, so e.g. an internet fallout can cause them to stop. You can avoid this by using a terminal multiplexer, we recommend tmux.
Some of us recommend using terminal-based editors and developing your code on the servers. For this we recommend vim
, here's an online interactive tutorial, but you can also launch a terminal-based tutorial by running vimtutor
. Some of us prefer using VS Code (https://code.visualstudio.com/) as an IDE for python development. The best thing about VS code is that it can be connected to any remote server via ssh, so it is possible to code remotely directly in it. Windows users should also check out this section
If you would like to run anything that requires sudo privileges it is advised to run it in a docker container instead (you can run your app in a docker container that uses Ubuntu, there you can install everything with sudo). If you would like to run docker on a server without sudo privileges, you need to install a rootless version. See more here: https://docs.docker.com/engine/security/rootless/
If you use Windows as your main OS, you can still install VS Code and access remote servers the same way as in Linux. For terminal commands, don't use Windows' built-in cmd, install Git Bash instead. You can also install a Windows Subsystem under Windows to have access to a fully functioning Linux kernel (if you don't want to install Ubuntu alongside Windows to create a dual boot system).
If you want to use jupyter on the server, you can use port forwarding to access it from the browser on your computer. First, start jupyter on the server with the following command (if the port is in use, choose another one):
jupyter notebook --port=8088 --ip=0.0.0.0 --no-browser
Then open a terminal on your own machine and start port-forwarding like this:
ssh -L 8088:localhost:8088 <server address> -N
Windows users may have to specify the ssh port (if not 22) and the username:
ssh -L 8088:localhost:8088 <username>@<server address> -p <ssh port> -N
Now you can acccess your jupyter server on localhost:8088. If you're using a newer version of jupyter, you will need to authenticate by pasting into the browser the link that jupyter prints on startup, which looks something like this:
http://0.0.0.0:8088/?token=<some long token>
Take care to stop jupyter when you're done using it, to save resources. It is also possible to use JupyterLab instead of Jupyter Notebook. Handling it is essentially the same, but it has more IDE capabilities.
See also: