65
Shifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14 th 2016

Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter: Containers in HPC EnvironmentsSecond ADAC Workshop, Lugano, June 2016

Lucas Benedicic, CSCSJune 14th 2016

Page 2: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Second ADAC Workshop, Lugano, June 2016 | 2

Page 3: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Agenda

BackgroundImplementationUse CasesSecurity

Second ADAC Workshop, Lugano, June 2016 | 3

Page 4: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Background

Page 5: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Docker overview

Build an imagecapturing allapplicationrequirements

Commit the imageor use a recipe file

Send the imagedescriptor tocollaborators

Push it toDockerHub or aprivate Registry

Pull the imagefrom DockerHub ora private Registry

Launch the imageas a container

Second ADAC Workshop, Lugano, June 2016 | 5

Page 6: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Docker overview

Build an imagecapturing allapplicationrequirements

Commit the imageor use a recipe file

Send the imagedescriptor tocollaborators

Push it toDockerHub or aprivate Registry

Pull the imagefrom DockerHub ora private Registry

Launch the imageas a container

Second ADAC Workshop, Lugano, June 2016 | 5

Page 7: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Docker overview

Build an imagecapturing allapplicationrequirements

Commit the imageor use a recipe file

Send the imagedescriptor tocollaborators

Push it toDockerHub or aprivate Registry

Pull the imagefrom DockerHub ora private Registry

Launch the imageas a container

Second ADAC Workshop, Lugano, June 2016 | 5

Page 8: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Docker drawbacks

ArchitectureDocker assumesa local disk

SecurityDocker userscan easilyescalateprivileges onthe hostsystem

IntegrationDocker is notdesigned towork with batchsystems

ComplexityDocker uses aclient/daemonarchitecture

Second ADAC Workshop, Lugano, June 2016 | 6

Page 9: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Docker drawbacks

ArchitectureDocker assumesa local disk

SecurityDocker userscan easilyescalateprivileges onthe hostsystem

IntegrationDocker is notdesigned towork with batchsystems

ComplexityDocker uses aclient/daemonarchitecture

Second ADAC Workshop, Lugano, June 2016 | 6

Page 10: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Docker drawbacks

ArchitectureDocker assumesa local disk

SecurityDocker userscan easilyescalateprivileges onthe hostsystem

IntegrationDocker is notdesigned towork with batchsystems

ComplexityDocker uses aclient/daemonarchitecture

Second ADAC Workshop, Lugano, June 2016 | 6

Page 11: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Docker drawbacks

ArchitectureDocker assumesa local disk

SecurityDocker userscan easilyescalateprivileges onthe hostsystem

IntegrationDocker is notdesigned towork with batchsystems

ComplexityDocker uses aclient/daemonarchitecture

Second ADAC Workshop, Lugano, June 2016 | 6

Page 12: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Solution: Shifter

Partnership with NERSC and Cray to design asolution to run containers on HPC platforms

Design goalsFlexibility requires no administrator assistance to launch a containerIntegration shared resource availability (e.g., mounts, devices andnetwork interfaces)Compatibility integrates with public image repositories (e.g.,DockerHub)Security stripped-down version of the original image is deployed inread-only mode

Second ADAC Workshop, Lugano, June 2016 | 7

Page 13: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Solution: Shifter

Partnership with NERSC and Cray to design asolution to run containers on HPC platformsDesign goals

Flexibility requires no administrator assistance to launch a container

Integration shared resource availability (e.g., mounts, devices andnetwork interfaces)Compatibility integrates with public image repositories (e.g.,DockerHub)Security stripped-down version of the original image is deployed inread-only mode

Second ADAC Workshop, Lugano, June 2016 | 7

Page 14: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Solution: Shifter

Partnership with NERSC and Cray to design asolution to run containers on HPC platformsDesign goals

Flexibility requires no administrator assistance to launch a containerIntegration shared resource availability (e.g., mounts, devices andnetwork interfaces)

Compatibility integrates with public image repositories (e.g.,DockerHub)Security stripped-down version of the original image is deployed inread-only mode

Second ADAC Workshop, Lugano, June 2016 | 7

Page 15: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Solution: Shifter

Partnership with NERSC and Cray to design asolution to run containers on HPC platformsDesign goals

Flexibility requires no administrator assistance to launch a containerIntegration shared resource availability (e.g., mounts, devices andnetwork interfaces)Compatibility integrates with public image repositories (e.g.,DockerHub)

Security stripped-down version of the original image is deployed inread-only mode

Second ADAC Workshop, Lugano, June 2016 | 7

Page 16: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Solution: Shifter

Partnership with NERSC and Cray to design asolution to run containers on HPC platformsDesign goals

Flexibility requires no administrator assistance to launch a containerIntegration shared resource availability (e.g., mounts, devices andnetwork interfaces)Compatibility integrates with public image repositories (e.g.,DockerHub)Security stripped-down version of the original image is deployed inread-only mode

Second ADAC Workshop, Lugano, June 2016 | 7

Page 17: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Implementation

Page 18: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter Architecture

Second ADAC Workshop, Lugano, June 2016 | 9

Page 19: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter vs Docker: similarities

The user-defined images are under user control

Allows volume mappingmount /a/b on the host on /b/a in the container

Containers can be executedenvironment variables, working directory, entry-point scripts, ...

Instantiate multiple containers on the same computenode

Second ADAC Workshop, Lugano, June 2016 | 10

Page 20: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter vs Docker: similarities

The user-defined images are under user controlAllows volume mapping

mount /a/b on the host on /b/a in the container

Containers can be executedenvironment variables, working directory, entry-point scripts, ...

Instantiate multiple containers on the same computenode

Second ADAC Workshop, Lugano, June 2016 | 10

Page 21: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter vs Docker: similarities

The user-defined images are under user controlAllows volume mapping

mount /a/b on the host on /b/a in the container

Containers can be executedenvironment variables, working directory, entry-point scripts, ...

Instantiate multiple containers on the same computenode

Second ADAC Workshop, Lugano, June 2016 | 10

Page 22: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter vs Docker: similarities

The user-defined images are under user controlAllows volume mapping

mount /a/b on the host on /b/a in the container

Containers can be executedenvironment variables, working directory, entry-point scripts, ...

Instantiate multiple containers on the same computenode

Second ADAC Workshop, Lugano, June 2016 | 10

Page 23: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter vs Docker: differences

Containers run under the user’s UID inside thecontainer

Images are modified at construction timeReplaces /etc/passwd, /etc/group, ...

Generates hostsfiles to identify other nodes in the allocation

Images are read-only on the compute nodeShifter does not use cgroups directly

Resources are handled by the workload manager (e.g., SLURM)

Second ADAC Workshop, Lugano, June 2016 | 11

Page 24: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter vs Docker: differences

Containers run under the user’s UID inside thecontainerImages are modified at construction time

Replaces /etc/passwd, /etc/group, ...

Generates hostsfiles to identify other nodes in the allocation

Images are read-only on the compute nodeShifter does not use cgroups directly

Resources are handled by the workload manager (e.g., SLURM)

Second ADAC Workshop, Lugano, June 2016 | 11

Page 25: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter vs Docker: differences

Containers run under the user’s UID inside thecontainerImages are modified at construction time

Replaces /etc/passwd, /etc/group, ...

Generates hostsfiles to identify other nodes in the allocation

Images are read-only on the compute node

Shifter does not use cgroups directlyResources are handled by the workload manager (e.g., SLURM)

Second ADAC Workshop, Lugano, June 2016 | 11

Page 26: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter vs Docker: differences

Containers run under the user’s UID inside thecontainerImages are modified at construction time

Replaces /etc/passwd, /etc/group, ...

Generates hostsfiles to identify other nodes in the allocation

Images are read-only on the compute nodeShifter does not use cgroups directly

Resources are handled by the workload manager (e.g., SLURM)

Second ADAC Workshop, Lugano, June 2016 | 11

Page 27: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Use Cases

Page 28: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Creating a Docker image

Dockerfile

FROM ubuntu:14.04

# Update packages and install dependencies

RUN apt-get update -y &&

apt-get install -y build-essential

# Copy in the application

ADD . /theapp

# Build it

RUN cd /theapp &&

make &&

make install

Second ADAC Workshop, Lugano, June 2016 | 13

Page 29: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Use the image with Shifter

SLURM batch job

#!/bin/bash

#SBATCH -N 16 -t 20

#SBATCH --image=docker:ubuntu:14.04

#SBATCH --volume=/scratch/user/data:/data

module load shifter

srun -n 16 shifter /theapp/app

Second ADAC Workshop, Lugano, June 2016 | 14

Page 30: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter: Extending the Docker workflow to HPC

Develop an application on your laptop and run it on aSupercomputer

Enables the user to define complex software-stacksthemselves

Runs the Linux flavor of their choice

Improves reproducibility

Improves sharing (e.g., Dockerfile, DockerHub)

Second ADAC Workshop, Lugano, June 2016 | 15

Page 31: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter: Extending the Docker workflow to HPC

Develop an application on your laptop and run it on aSupercomputer

Enables the user to define complex software-stacksthemselves

Runs the Linux flavor of their choice

Improves reproducibility

Improves sharing (e.g., Dockerfile, DockerHub)

Second ADAC Workshop, Lugano, June 2016 | 15

Page 32: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter: Extending the Docker workflow to HPC

Develop an application on your laptop and run it on aSupercomputer

Enables the user to define complex software-stacksthemselves

Runs the Linux flavor of their choice

Improves reproducibility

Improves sharing (e.g., Dockerfile, DockerHub)

Second ADAC Workshop, Lugano, June 2016 | 15

Page 33: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter: Extending the Docker workflow to HPC

Develop an application on your laptop and run it on aSupercomputer

Enables the user to define complex software-stacksthemselves

Runs the Linux flavor of their choice

Improves reproducibility

Improves sharing (e.g., Dockerfile, DockerHub)

Second ADAC Workshop, Lugano, June 2016 | 15

Page 34: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter: Extending the Docker workflow to HPC

Develop an application on your laptop and run it on aSupercomputer

Enables the user to define complex software-stacksthemselves

Runs the Linux flavor of their choice

Improves reproducibility

Improves sharing (e.g., Dockerfile, DockerHub)

Second ADAC Workshop, Lugano, June 2016 | 15

Page 35: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Atlas and LHC

CSCS operates a cluster running experiments of theLHC at CERN

Jobs expect a RHEL-compatible OS and aprecompiled software stack

Shifter reproduces the complete software stack onthe Cray XC

Job efficiency is comparable on both systems

Second ADAC Workshop, Lugano, June 2016 | 16

Page 36: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Atlas and LHC

CSCS operates a cluster running experiments of theLHC at CERN

Jobs expect a RHEL-compatible OS and aprecompiled software stack

Shifter reproduces the complete software stack onthe Cray XC

Job efficiency is comparable on both systems

Second ADAC Workshop, Lugano, June 2016 | 16

Page 37: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Atlas and LHC

CSCS operates a cluster running experiments of theLHC at CERN

Jobs expect a RHEL-compatible OS and aprecompiled software stack

Shifter reproduces the complete software stack onthe Cray XC

Job efficiency is comparable on both systems

Second ADAC Workshop, Lugano, June 2016 | 16

Page 38: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Atlas and LHC

CSCS operates a cluster running experiments of theLHC at CERN

Jobs expect a RHEL-compatible OS and aprecompiled software stack

Shifter reproduces the complete software stack onthe Cray XC

Job efficiency is comparable on both systemsSecond ADAC Workshop, Lugano, June 2016 | 16

Page 39: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Apache Spark

Designed around commodity clusters, i.e., ethernetand local disks

Does not scale well on parallel filesystems, e.g.,Lustre

Shifter minimizes the metadata overhead

Tested on NERSC’s Cori up to 1600 nodes

Second ADAC Workshop, Lugano, June 2016 | 17

Page 40: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Apache Spark

Designed around commodity clusters, i.e., ethernetand local disks

Does not scale well on parallel filesystems, e.g.,Lustre

Shifter minimizes the metadata overhead

Tested on NERSC’s Cori up to 1600 nodes

Second ADAC Workshop, Lugano, June 2016 | 17

Page 41: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Apache Spark

Designed around commodity clusters, i.e., ethernetand local disks

Does not scale well on parallel filesystems, e.g.,Lustre

Shifter minimizes the metadata overhead

Tested on NERSC’s Cori up to 1600 nodes

Second ADAC Workshop, Lugano, June 2016 | 17

Page 42: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Apache Spark

Designed around commodity clusters, i.e., ethernetand local disks

Does not scale well on parallel filesystems, e.g.,Lustre

Shifter minimizes the metadata overhead

Tested on NERSC’s Cori up to 1600 nodes

Second ADAC Workshop, Lugano, June 2016 | 17

Page 43: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Accessing GPUs

Containers are both hardware-agnostic andplatform-agnostic by design

This is not the case when using GPUsit uses specialized hardware, andit requires specific software on the host, i.e., NVIDIA kernel driver

Shifter approach (CSCS + NVIDIA)direct access to device charactersthe required libraries are dynamically discovered at runtime

Second ADAC Workshop, Lugano, June 2016 | 18

Page 44: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Accessing GPUs

Containers are both hardware-agnostic andplatform-agnostic by designThis is not the case when using GPUs

it uses specialized hardware, andit requires specific software on the host, i.e., NVIDIA kernel driver

Shifter approach (CSCS + NVIDIA)direct access to device charactersthe required libraries are dynamically discovered at runtime

Second ADAC Workshop, Lugano, June 2016 | 18

Page 45: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Accessing GPUs

Containers are both hardware-agnostic andplatform-agnostic by designThis is not the case when using GPUs

it uses specialized hardware, andit requires specific software on the host, i.e., NVIDIA kernel driver

Shifter approach (CSCS + NVIDIA)direct access to device charactersthe required libraries are dynamically discovered at runtime

Second ADAC Workshop, Lugano, June 2016 | 18

Page 46: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Accessing GPUs

The Stream benchmark within a Shifter container shows nativeperformance!

NVIDIA’s DGX-1 software stack is based on this solution

Second ADAC Workshop, Lugano, June 2016 | 19

Page 47: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter and MPI

Challengesdifferent versions, implementations (vendors), hardware ...

Embedded in the Imageadd the required libraries into the imageusers should maintain their own images

Site-specific base imagesusers extend a managed image including the required librariesthese are upgraded together with the system

Dynamic-linking at runtimeuser’s application built with ABI compatibilitysystem-specific implementation dynamically mounted at runtime

Second ADAC Workshop, Lugano, June 2016 | 20

Page 48: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter and MPI

Challengesdifferent versions, implementations (vendors), hardware ...

Embedded in the Imageadd the required libraries into the imageusers should maintain their own images

Site-specific base imagesusers extend a managed image including the required librariesthese are upgraded together with the system

Dynamic-linking at runtimeuser’s application built with ABI compatibilitysystem-specific implementation dynamically mounted at runtime

Second ADAC Workshop, Lugano, June 2016 | 20

Page 49: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter and MPI

Challengesdifferent versions, implementations (vendors), hardware ...

Embedded in the Imageadd the required libraries into the imageusers should maintain their own images

Site-specific base imagesusers extend a managed image including the required librariesthese are upgraded together with the system

Dynamic-linking at runtimeuser’s application built with ABI compatibilitysystem-specific implementation dynamically mounted at runtime

Second ADAC Workshop, Lugano, June 2016 | 20

Page 50: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter and MPI

Challengesdifferent versions, implementations (vendors), hardware ...

Embedded in the Imageadd the required libraries into the imageusers should maintain their own images

Site-specific base imagesusers extend a managed image including the required librariesthese are upgraded together with the system

Dynamic-linking at runtimeuser’s application built with ABI compatibilitysystem-specific implementation dynamically mounted at runtime

Second ADAC Workshop, Lugano, June 2016 | 20

Page 51: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Security

Page 52: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Container Security

Security contexts don’t provide enough security andare difficult to configure, e.g., SELinux

Docker’s approach is broken by design, e.g., root inthe container is still root in the host

Look at what RedHat did

Second ADAC Workshop, Lugano, June 2016 | 22

Page 53: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Container Security

Security contexts don’t provide enough security andare difficult to configure, e.g., SELinux

Docker’s approach is broken by design, e.g., root inthe container is still root in the host

Look at what RedHat did

Second ADAC Workshop, Lugano, June 2016 | 22

Page 54: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Container Security

Security contexts don’t provide enough security andare difficult to configure, e.g., SELinux

Docker’s approach is broken by design, e.g., root inthe container is still root in the host

Look at what RedHat did

Second ADAC Workshop, Lugano, June 2016 | 22

Page 55: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter Security Model

User accesses the container as their UID, not root orcontextual root

Generated site /etc/passwd, /etc/group inside thecontainer

Embeded sshd is statically linked and accessibleunder the user’s UID

User-provided data are verified and filtered ifneeded, e.g., sudo

Second ADAC Workshop, Lugano, June 2016 | 23

Page 56: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter Security Model

User accesses the container as their UID, not root orcontextual root

Generated site /etc/passwd, /etc/group inside thecontainer

Embeded sshd is statically linked and accessibleunder the user’s UID

User-provided data are verified and filtered ifneeded, e.g., sudo

Second ADAC Workshop, Lugano, June 2016 | 23

Page 57: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter Security Model

User accesses the container as their UID, not root orcontextual root

Generated site /etc/passwd, /etc/group inside thecontainer

Embeded sshd is statically linked and accessibleunder the user’s UID

User-provided data are verified and filtered ifneeded, e.g., sudo

Second ADAC Workshop, Lugano, June 2016 | 23

Page 58: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Shifter Security Model

User accesses the container as their UID, not root orcontextual root

Generated site /etc/passwd, /etc/group inside thecontainer

Embeded sshd is statically linked and accessibleunder the user’s UID

User-provided data are verified and filtered ifneeded, e.g., sudo

Second ADAC Workshop, Lugano, June 2016 | 23

Page 59: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Conclusions

Containers are here to stay

Not an universal solution

They can be secured and isolated to matchhypervisorsStill, several important issues arise

Support, e.g., how should images be maintained and/ortroubleshooted?Adoption, e.g., how are users adopting Docker?Training, e.g., can we leverage from the Docker community? Issite-specific documentation needed?

We haven’t even scratched the surface of thepossibilities

Second ADAC Workshop, Lugano, June 2016 | 24

Page 60: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Conclusions

Containers are here to stay

Not an universal solution

They can be secured and isolated to matchhypervisorsStill, several important issues arise

Support, e.g., how should images be maintained and/ortroubleshooted?Adoption, e.g., how are users adopting Docker?Training, e.g., can we leverage from the Docker community? Issite-specific documentation needed?

We haven’t even scratched the surface of thepossibilities

Second ADAC Workshop, Lugano, June 2016 | 24

Page 61: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Conclusions

Containers are here to stay

Not an universal solution

They can be secured and isolated to matchhypervisors

Still, several important issues ariseSupport, e.g., how should images be maintained and/ortroubleshooted?Adoption, e.g., how are users adopting Docker?Training, e.g., can we leverage from the Docker community? Issite-specific documentation needed?

We haven’t even scratched the surface of thepossibilities

Second ADAC Workshop, Lugano, June 2016 | 24

Page 62: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Conclusions

Containers are here to stay

Not an universal solution

They can be secured and isolated to matchhypervisorsStill, several important issues arise

Support, e.g., how should images be maintained and/ortroubleshooted?Adoption, e.g., how are users adopting Docker?Training, e.g., can we leverage from the Docker community? Issite-specific documentation needed?

We haven’t even scratched the surface of thepossibilities

Second ADAC Workshop, Lugano, June 2016 | 24

Page 63: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Conclusions

Containers are here to stay

Not an universal solution

They can be secured and isolated to matchhypervisorsStill, several important issues arise

Support, e.g., how should images be maintained and/ortroubleshooted?Adoption, e.g., how are users adopting Docker?Training, e.g., can we leverage from the Docker community? Issite-specific documentation needed?

We haven’t even scratched the surface of thepossibilities

Second ADAC Workshop, Lugano, June 2016 | 24

Page 64: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Conclusions

Containers are here to stay

Not an universal solution

They can be secured and isolated to matchhypervisorsStill, several important issues arise

Support, e.g., how should images be maintained and/ortroubleshooted?Adoption, e.g., how are users adopting Docker?Training, e.g., can we leverage from the Docker community? Issite-specific documentation needed?

We haven’t even scratched the surface of thepossibilities

Second ADAC Workshop, Lugano, June 2016 | 24

Page 65: Shifter: Containers in HPC EnvironmentsShifter: Containers in HPC Environments Second ADAC Workshop, Lugano, June 2016 Lucas Benedicic, CSCS June 14th 2016 Second ADAC Workshop, Lugano,

Thank you for your attention.