Strumenti Utente

Strumenti Sito


oph:cluster:apptainer

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
Prossima revisione
Revisione precedente
oph:cluster:apptainer [2023/12/18 13:48] – [Graphical applications with ssh X forwarding] diego.zuccato@unibo.itoph:cluster:apptainer [2024/11/28 09:25] (versione attuale) – Rimosse istruzioni troppo vecchie diego.zuccato@unibo.it
Linea 8: Linea 8:
 ===== Examples ===== ===== Examples =====
  
-=== Python Container === +<WRAP center round alert 60%> 
-By Amalie Louise Stokholm +Page is being worked on for updated instructions
- +</WRAP>
-  apptainer build --sandbox rockylinux8/ docker://rockylinux:8  +
-  find rockylinux8 -type d -not -writable -exec chmod +w {} + +
-  apptainer run -f --writable rockylinux8/ yum groupinstall -y "Development Tools" +
-  apptainer run -f --writable rockylinux8/ yum install -y zlib-devel libffi-devel openssl-devel bzip2-devel readline-devel sqlite-devel xz-devel +
-  mv .pyenv/versions/3.9.12{,_old4} +
-  apptainer run rockylinux8/ ~/.pyenv/bin/pyenv install 3.9.12 +
-  .pyenv/versions/3.9.12/bin/python3 -c 'import ctypes' +
- +
-=== Graphical applications with ssh X forwarding === +
-By Vsevolod Chestnov +
- +
-How to setup `X11` forwarding on `compute_node` via `apptainer` +
- +
-  - Create a file `config` with the following content:<code> +
-Bootstrap: docker +
-From: ubuntu:16.04 +
- +
-%post +
-    apt-get update -y +
-    apt-get install -y openssh-server +
-    # some tools, remove if not needed +
-    apt-get install -y vim firefox +
- +
-%startscript +
-    echo 'root:12345' | chpasswd +
-    sed -i 's/Port.*/Port 12121/'                                      /etc/ssh/sshd_config +
-    sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/'  /etc/ssh/sshd_config +
-    sed -i 's/UsePrivilegeSeparation yes/UsePrivilegeSeparation no/'   /etc/ssh/sshd_config +
-    sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config +
-    mkdir /var/run/sshd +
-    chmod 700 /var/run/sshd +
-    # /usr/sbin/sshd</code+
-  - Then build the container, here we call it `ubuntu16`<code> +
-apptainer build --sandbox --force ubuntu16 config</code> +
-  - Next go to the `compute_node` (say `mtx27` -- you need to have an active reservation)<code> +
-ssh compute_node</code> +
-  - Create an instance of the `ubuntu16` container and call it `test`<code> +
-apptainer instance start -f -w ubuntu16 test</code> +
-  - Jump into the `test` instance<code> +
-apptainer shell instance://test</code> +
-  - Once inside, run the `sshd` daemon<code> +
-/usr/sbin/sshd</code> which will listen to the `Port 12121`, as prescribed by the file `config` file above. +
-  - In a new shell to test things connect to the running instance use `root` as the username<code> +
-ssh -X -p 12121 root@localhost</code> after which you'll be prompted for `root`'s password, which was set to `12345` in the `config` file above. Now you may run some GUI application, for example:<code> +
-firefox</code>At this stage `X11` forwarding will allow the application to use your machine's display to show the GUI. +
-  - To connect from the outside one possibility is to setup port forwarding from `2010` on your machine to `12121` on the `compute_node` (where the instance is running) via the frontend node:<code> +
-ssh -L2010:compute_node_id:12121 your_unibo_username@137.204.50.177</code> +
-  - And then access via<code> +
-ssh -X -p 2010 root@localhost</code>from your machine +
-  - Done! Now you may run GUI applications on `compute_node` (like `firefox` and `Mathematica` frontend) and their graphical output will be forwarded to your machine's display.+
  
oph/cluster/apptainer.1702907321.txt.gz · Ultima modifica: 2023/12/18 13:48 da diego.zuccato@unibo.it

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki