Category: Computing

Sagemath

Since Fedora 39 sagemath is not included as a package anymore. There are several possibilities you can use sagemath on Fedora, let’s highlight two:

  • Using the offical docker image
  • Installing it with conda

Podman

sagemath commandline

As our installation provides a fully configured rootless podman configuration, you can for example use the following commands to run the sagemath image:

# connect to a central client
ssh ada-X
# start tmux, alternativly you can use screen
tmux
# create a .sage folder
mkdir $HOME/.sage

# run sage with your home mounted to /home/sage/mydata and a mounted .sage
podman run --user 0 -ti -v $HOME/.sage:/home/sage/.sage -v $HOME:/home/sage/mydata sagemath/sagemath:latest

# to detach from the tmux session use the following keystrokes
#CTRL+B then D

To add a additional folder you can put a other -v parameter, for example:

-v /userdata/username:/home/sage/mydata2
sagemath jupyter notebook

When you want to use the sage jupyter notebook, you can do the following:

# connect to a central client
ssh ada-X
# start tmux, alternativly you can use screen
tmux
# create a .sage folder
mkdir $HOME/.sage

# run sage jupyter on port 8888
podman run --user 0 -p 8888:8888 -v $HOME/.sage:/home/sage/.sage -v $HOME:/home/sage/mydata sagemath/sagemath:latest sage-jupyter --allow-root

# to detach from the tmux session use the following keystrokes
#CTRL+B then D

Then open a second terminal on your local machine and open ssh tunnel to the ada:

# port forward from to ada-X
ssh -t username@ada-X -L 8888:localhost:8888

# Open webbrowser using the url with token shown in the output.

Conda

Please follow the official installation instruction:

Read more

Posted on

Jupyter Notebook

Linux Desktop

To run a jupyter notebook on your linux is simple just run:

jupyter notebook

Euler Cluster

This service is made for developing and debugging your code, not to run your code on the cluster. If you wish to run it, please use the SLURM queue system. Please only request multiple cores if you are planning to run some code that can make use of multiple cores.

For more information go to the following website:

~/.config/euler/jupyterhub

I want to load a cluster module / I want to activate a virtualenv / Jupyterlab is missing some features

This script will be sourced (. ~/.config/euler/jupyterhub/jupyterlabrc) before starting any service.

cat << EOF > ~/.config/euler/jupyterhub/jupyterlabrc
module load stack
module load python_cuda
#module load sage
#jupyter kernelspec install --user $SAGE_EULER_ROOT/share/jupyter/kernels
EOF

Compute Clients (ada-X)

But if you like to run it on our “central clients” (ada-X) you need to do a port forwarding, to have access to the notebook.

There are some requirements:

The following command will start a new jupyter notebook and open a ssh tunnel.

You need to modify the following in the command:

  • HOST="ada-10" with the host you like
  • USERNAME="username" with your username to connect.

The list of hosts you can use is on the following page:

HOST="ada-10"; USERNAME="username"; PORT=$(($RANDOM % 1000 + 8000)); ssh -t $USERNAME@$HOST -L $PORT:localhost:$PORT "screen jupyter notebook --port $PORT --no-browser"

You need to keep the terminal window running otherwise the port forwarding will stop. The notebook however will still be running on the “central client”, you will just loose the connection in to the webinterface.


To be able to connect to it again, it get’s a bit tricky, you need to know on which port you have started the notebook and reopen a port forwarding to it.

This can be done with the following command (you need to modify HOST=, USERNAME= and PORT=):

HOST="ada-10"; USERNAME="username"; PORT=8943; ssh $USERNAME@$HOST -L $PORT:localhost:$PORT

Read more

Posted on

Howto use docker at D-MATH

To use docker at D-MATH is to use podman -> https://podman.io/

With podman you can use all docker commands just write podman instead of docker in the command, all the parameter stay the same.

With podman we are able to provide a possibility that a user without administrative rights can download and run docker images.

Example 1

The following example will run the latest docker image of alpine linux (https://hub.docker.com/_/alpine).

podman run -ti -v $(pwd):/home/test alpine:latest

The parameter

  • -v $(pwd):/home/test

is very helpful, this will add the current folder you are in now, to the container at /home/test. If you have seLinux activated you need to add a Z:

  • -v $(pwd):/home/test:Z

Example 2

The following example shows howto run a more complicated docker image named fenics and transfer files.

First open a terminal and go into the folder which you want to have accessable in the docker image.

mkdir -p ~/Documents/mydata
cd ~/Documents/mydata

Now run the container with the following parameters:

podman run -ti -p 127.0.0.1:8000:8000 -v $(pwd):/home/fenics/shared -w /home/fenics/shared quay.io/fenicsproject/stable:current

This will connect you to the container.

But the docker image of the fenicsproject will log you in a user fenics, this user will not have access to the data in ~/Documents/mydata.

With podman the user root in the container will have access to your files.

So you need to become root inside the container to have access:

sudo su -

Read more

Posted on

Linux Environment Modules at the D-MATH

With Environment Modules or simply called Modules it is possible to dynamically expand the active user environment and to remove it again without closing the shell.

Read more

Posted on ,

Using “screen” to run simulations on a remote host

The suggested way to run your simulations on a remote host (let say for instance on ada-18) is to use screen, which allows you to:

  • use multiple shell windows from a single SSH session
  • keep a shell active even through network disruptions
  • disconnect and re-connect to a shell sessions from multiple locations
  • run a long running process without maintaining an active shell session.

Read more

Posted on ,

Tensorflow

On our Linux devices we are providing a Python Tensorflow Module ready to use that is accessible trough a Linux Environment Module. With the command “module” you have the possibility to add Tensorflow in many different versions. By default the newest is chosen. Read more

Posted on , 2 Comments

Central Clients of D-MATH

Central Clients are powerful computers in the server room, running Fedora. The software available is the same as on the Linux desktops at the D-MATH. We distinguish between two types of Central Clients: Compute Clients and Load Clients.

Read more

Posted on ,

PROTECT YOUR BRAINWORK.

An IT Security Initiative
https://itsecurity.ethz.ch

Trending

Categories

Recent Posts