When you want to run Docker containers on the clusters.

What is Shifter ?

Shifer allows to use Docker images in a shared computing environment in userland. It converts the docker image to the squashfs format that can be mounted and chrooted into as a user.

The SCITAS filesystems are also mounted inside the image so you can easily access your data. Please note that if your image has some files in /home there will not appear in the image and will be hidden.

Authentication

You can use public images without being authenticated (shifterimg login) in the following cases:

Image sourcePublic imageLogin required
DockerhubYesNo
DockerhubNoYes, Dockerhub
C4science registryYes

No

C4science registryNoYes, c4science registry

When using authentication, it's relative to the source you want to use (Dockerhub and c4science registry supported) and the authentication is saved per cluster.

You need to ask for an account on the c4science registry, see Account request.

NOTE: By defaut, shiterimg is pulling from c4science registry, you have to specify registry-1.docker.io/library/alpine:latest for Dockerhub

Upload an image to Shifter from Dockerhub using the registry.c4science.ch (preferred)

You need to have Docker installed on your machine

  1. Get a docker image from Dockerhub for instance (From local computer)

    $ docker pull alpine:latest
    $ docker images


  2. Set up your machine (From local computer)

    Login on the registry from your local Docker installation (you need an account, see Account request)

    $ docker login registry.c4science.ch
    Username (username): username
    Password: 
    Login Succeeded


  3. Upload a Docker image to the registry (From local computer)

  4. Pull an image on Shifter and specify a user or group ACL (From cluster login node)

Upload an image directly from Dockerhub to Shifter

Optional (needed for private images only)

$ shifterimg login registry-1.docker.io

Get the image from Dockerhub by specifying the image account (optional for official image) and name

$ shifterimg pull registry-1.docker.io/alpine:latest
# OR
$ shifterimg pull registry-1.docker.io/library/alpine:latest

$ shifterimg images
fidis      docker     READY    4a28aef4f8   2020-10-16T14:52:41 registry-1.docker.io/alpine:latest
fidis      docker     READY    d0877b767c   2020-09-16T15:26:31 registry-1.docker.io/library/busybox:latest

$ srun --pty -p debug -N 1 shifter --image registry-1.docker.io/alpine:latest /bin/sh
~ $ cat /etc/alpine-release 
3.12.0

Run the image on the clusters

You can submit the following Slurm script with the sbatch command

#!/bin/bash -l
 
#SBATCH --nodes 1
#SBATCH --ntasks 1
#SBATCH --cpus-per-task 1
#SBATCH --mem 1024
 
srun shifter --image yourproject/alpine ls /etc

Interactive Shell (Bash)

To have an interactive shell within your image, simply use this:

$ srun --pty shifter --image yourproject/alpine bash

Using GPUs

On Deneb shifter runtime is installed on the GPU nodes. You need prior access to the GPUs nodes, see FAQ

[aubort@deneb1 ~]$ srun --gres gpu:1 --partition gpu --qos gpu shifter --image library/debian:stable-slim nvidia-smi -L
GPU 0: Tesla K40m (UUID: GPU-21730043-7144-85e7-d251-7834adb2d1ee)

[aubort@deneb1 ~]$ srun --gres gpu:1 --partition gpu --qos gpu shifter --image library/nvidia-cuda:9.1-runtime /home/aubort/gpu/cuda-samples/bin/x86_64/linux/release/simpleCUFFT 
[simpleCUFFT] is starting...
GPU Device 0: "Tesla K40m" with compute capability 3.5

Temporary buffer size 448 bytes
Transforming signal cufftExecC2C
Launching ComplexPointwiseMulAndScale<<< >>>
Transforming signal back cufftExecC2C

FEEDBACK is welcome as this feature is experimental.

Account on the c4science registry


Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.



Related issues