Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
INTRODUCTION TO DOCKERSVOM GROUND SEGMENT MEETTING
Marseille, November 16th, 2016
Yannick Roehlly
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.
DIFFERENT KINDS OF VIRTUALISATION
HARDWARE EMULATIONBochs, QEMU, android emulator...
HYPERVISOR-BASED VIRTUALISATIONVirtualbox, KVM, Hyper-V
CONTAINERSLXC, OpenVZ, Docker
Filesystem
Netw
ork...
Guest O
.S.
File
syst
emN
etw
ork.
..
Gue
st O
.S.
FilesystemNetwork...
Guest O.S.
Kernel
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
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.
ADVANTAGES OF USING DOCKER FORSCIENTIFIC SOFTWARE
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.
DEPLOYING USING AN IMAGE REGISTRY
Mainframe
Dockerimageregistry
DOCKER BASICS
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.
EXAMPLE: USING DOCKER TO RUN CIGALE
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 .
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
INTERESTING STUFFS
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
SKA - RODRIGUESRATT Online Deconvolved Radio Image Generation UsingEsoteric Software: web based radio telescope simulation andreduction tool.
DOCKER SWARMCluster management integrated within Docker.
ONE MORE THING...
WARNING!!!Using Docker, it's really easy to forget about making your
application easily installable.
THANK YOU!