23
INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16 th , 2016 Yannick Roehlly

INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

INTRODUCTION TO DOCKERSVOM GROUND SEGMENT MEETTING

Marseille, November 16th, 2016

Yannick Roehlly

Page 2: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

OUTLINE1. Presentation of the different kinds of virtualisation.2. How Docker can be useful for scienti�c software?3. Quick presentation of how to use Docker.

Page 3: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

DIFFERENT KINDS OF VIRTUALISATION

Page 4: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

HARDWARE EMULATIONBochs, QEMU, android emulator...

Page 5: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

HYPERVISOR-BASED VIRTUALISATIONVirtualbox, KVM, Hyper-V

Page 6: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

CONTAINERSLXC, OpenVZ, Docker

Filesystem

Netw

ork...

Guest O

.S.

File

syst

emN

etw

ork.

..

Gue

st O

.S.

FilesystemNetwork...

Guest O.S.

Kernel

Page 7: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

Hardware

Host O.S.

Hypervisor

Guest O.S. Guest O.S. Guest O.S.

Bins/Libs Bins/Libs Bins/Libs

App. 1 App. 2 App. 3

Hardware

Host O.S.

Container Engine

App. 1 App. 2 App. 3

Bins/Libs Bins/Libs

Hypervisor-based virtualisation Container virtualisation

Page 8: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

DIFFERENT KINDS OF CONTAINERS1. - FULL-SYSTEM CONTAINERS

Contains a complete Linux system. E.g.: LXC, OpenVZ.

2. - APPLICATION CONTAINERS

Launch only one application. E.g.: Docker, rkt.

Page 9: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

ADVANTAGES OF USING DOCKER FORSCIENTIFIC SOFTWARE

Page 10: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

EASY DEVELOPING AND DEPLOYING

Mainframe

The developers work on their softwareand run it in a Docker container on theircomputer.

They send the Docker image to a powerfulmachine.

They run the software on this machineusing Docker: the code is run in the verysame environment as on the developermachine.

Page 11: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

DEPLOYING USING AN IMAGE REGISTRY

Mainframe

Dockerimageregistry

Page 12: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

DOCKER BASICS

Page 13: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

IMAGES & CONTAINERS1. A Docker container is not like a virtual machine that can be

switched on and off.2. We build and image containing the application.3. We instantiate a container to run the application from this

image.4. When the container stops, its content is lost.5. A new run will start a new container.

Page 14: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

EXAMPLE: USING DOCKER TO RUN CIGALE

Page 15: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

IMAGE CREATION: THE DOCKERFILEFROM debian:jessie # Base Image# Install dependenciesRUN DEBIAN_FRONTEND=noninteractive \ apt-get update && apt-get -y upgrade && \ apt-get -y install git python3-numpy python3-scipy \ python3-sqlalchemy python3-configobj python3-astropy \ python3-setuptools python3-matplotlib && apt-get clean# Install cigaleRUN git clone [email protected]:cigale/cigale.git /root/pcigale && \ cd /root/pcigale && git checkout developRUN cd /root/pcigale && python3 setup.py buildRUN cd /root/pcigale && python3 setup.py develop# Data directoryRUN mkdir /data# Command to launch in the containerWORKDIR /dataENTRYPOINT ["/usr/local/bin/pcigale"]

$ docker build -t cigale .

Page 16: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

CONTAINER EXECUTION$ docker -v ./data:/data run cigale init

-v ./data:/data → mount a local directory inside thecontainerrun → docker command saying that we want to run acontainercigale → name of the image to runinit → argument passed to the entry point command

Page 17: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

INTERESTING STUFFS

Page 18: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

DOCKER-COMPOSERun simultaneously several containers.

# docker-compose.ymlversion: "2"services: dachs-server: image: chbrandt/dachs:server container_name: "server" volumes: - ./volumes/dachs-server/inputs/:/var/gavo/inputs/ - ./volumes/entrypoint/:/bin/entrypoint/

links: - "postgres"

ports: - "8080:8080"

entrypoint: /bin/entrypoint/dachs-server.sh postgres

Page 19: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

SKA - RODRIGUESRATT Online Deconvolved Radio Image Generation UsingEsoteric Software: web based radio telescope simulation andreduction tool.

Page 20: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

DOCKER SWARMCluster management integrated within Docker.

Page 21: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

ONE MORE THING...

Page 22: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

WARNING!!!Using Docker, it's really easy to forget about making your

application easily installable.

Page 23: INTRODUCTION TO DOCKER · INTRODUCTION TO DOCKER SVOM GROUND SEGMENT MEETTING Marseille, November 16th, 2016 Yannick Roehlly. OUTLINE 1. Presentation of the different kinds of virtualisation

THANK YOU!