Skip to the content.

width:1000px

udocker - be anywhere

Part 2 - Hands On: basic stuff

https://github.com/indigo-dc/udocker

Mario David david@lip.pt, Jorge Gomes jorge@lip.pt

width:150px width:1200px


What udocker is not - I


What udocker is not - II


udocker aims/objectives


udocker: Installation

https://indigo-dc.github.io/udocker/installation_manual.html


Installation: tarball

Access the INCD advanced computing facility at Lisbon using ssh:

ssh -l <username> cirrus8.a.incd.pt
module load python/3.10.13
wget https://github.com/indigo-dc/udocker/releases/download/1.3.10/udocker-1.3.10.tar.gz
tar zxvf udocker-1.3.10.tar.gz
export PATH=`pwd`/udocker-1.3.10/udocker:$PATH

Installation: PyPI - I

python3 -m venv udockervenv
source udockervenv/bin/activate
pip install udocker==1.3.10

Installation: PyPI - II

The udocker command will be udockervenv/bin/udocker.

mkdir udocker-tutorial
cd udocker-tutorial/
export UDOCKER_DIR=$HOME/udocker-tutorial/.udocker

(More details: https://indigo-dc.github.io/udocker/installation_manual.html)


Installation: tools and libraries - I

udocker install

Installation: tools and libraries - II


udocker: CLI - the basic (introductory) stuff

https://indigo-dc.github.io/udocker/user_manual.html


0. help and version

Global help and version

udocker --help
udocker --version

You can get help on a given command

udocker run --help

1. pull

Pull an image from Dockerhub (for example, an officially supported tensorflow):

udocker pull tensorflow/tensorflow

2. images

List the images in your local repository (-l option shows long format):

udocker images
udocker images -l

3. create

To create a container named mytensor, the default execution engine is P1 (PTRACE + SECCOMP filtering):

udocker create --name=mytensor tensorflow/tensorflow

4. ps

List extracted containers. These are not processes but containers extracted and available for execution:

udocker ps

5. run: I

Executes a container. Several execution engines are provided. The container can be specified using the container id or its associated name. Additionally it is possible to invoke run with an image name:

udocker run mytensor bash

5. run: II

Now you are inside the container (apparently as root), you might as well try out:

root@pcdavid:~# python
Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf

Or:

udocker run mytensor cat /etc/lsb-release 

6. setup

With --execmode chooses an execution mode to define how a given container will be executed. The option --nvidia enables access to NVIDIA GPUs (only possible if they are available).

udocker setup --execmode=F1 mytensor
udocker ps -m  # confirm change of execution engine

7. rm

Delete a previously created container. Removes the entire directory tree extracted from the container image and associated metadata:

udocker rm mytensor

8. rmi

Delete a local container image previously pulled/loaded/imported:

udocker rmi tensorflow/tensorflow

End of Hands On part I

width:200px width:1200px