Top Banner
@xebiconfr #xebiconfr Introduction à Unikernel Jean-Baptiste Claramonte & Tomas Rodriguez
72

Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

Apr 16, 2017

Download

Technology

Xebia France
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Introduction à

Unikernel Jean-Baptiste Claramonte

&Tomas Rodriguez

Page 2: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Tomas Rodriguez

2

Page 3: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Jean-Baptiste Claramonte

3

Page 4: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Agenda

● Les motivations

● Unikernel : qu’est-ce que c’est ?

● Qu’est-ce que ça change ?

● L’offre

● Démo

● Conclusion

4

Page 5: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Les motivations pour Unikernel

1

5

Page 6: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

La stack aujourd’hui

6

Hardware Driver

Page 7: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

La stack aujourd’hui

7

HypervisorHardware Driver

Page 8: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

La stack aujourd’hui

8

Virtual HW DriversHypervisor

Hardware Driver

Page 9: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

La stack aujourd’hui

9

Linux User ProcessesLinux Kernel

Virtual HW DriversHypervisor

Hardware Driver

Page 10: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

La stack aujourd’hui

10

Virtual HW DriversHypervisor

Hardware Driver

Shared LibrariesDocker Runtime

Linux User ProcessesLinux Kernel

Page 11: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

La stack aujourd’hui

11

ApplicationLanguage Runtime

Virtual HW DriversHypervisor

Hardware Driver

Shared LibrariesDocker Runtime

Linux User ProcessesLinux Kernel

Page 12: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Avec quel objectif ?

12

● Faire tourner ○ une seule application○ sur un serveur○ et un seul user (OS)

Page 13: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Sécurité apportée par le kernel linux

● Les utilisateurs sont sécurisés les uns des autres

● Les applications sont sécurisées les unes des autres

● Les applications sont sécurisées des utilisateurs

13

Page 14: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Linux sait tout faire !

● Linux fonctionne partout !

● On peut tout faire tourner sur linux !

14

Page 15: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Cela a un coût

15

● Small App: 10k

● Medium/Large: 100k

● Huge App: 1M

Page 16: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Cela a un coût

16

Small App: 10k

Medium/Large: 100k

Huge App: 1M

Page 17: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Cela a un coût

17

Small App: 10k

Medium/Large: 100k

Huge App: 1M

Le kernel linux en fait 22M !

Page 18: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Bilan du kernel linux

● Système de permissions complexe

● Le kernel inclut des drivers inutiles

● Difficile de maîtriser tout ce qu’un gestionnaire de paquets installe

● Des solutions comme CoreOS optimisent l’OS pas le kernel

18

Page 19: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Côté sécurité

● “Surface d’attaque” très large

(on estime en moyenne 20 à 30 erreurs pour 1000 lignes de code)

● Linux est devenu une cible privilégiée car devenu très populaire sur les serveurs et les systèmes mobiles

19

Page 20: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelle alternative ?

● Unikernel …

20

Page 21: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Unikernel : qu’est ce que c’est ?

2

21

Page 22: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

22

Kernel

libc libstd++ libgc

libgmp libz libtlc

gtk iconv

OpenGL

Application

Page 23: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

23

Kernel

libc libstd++ libgc

libgmp libz libtlc

gtk iconv

OpenGL

Application

Page 24: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

24

Application

Page 25: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

25

Application

Page 26: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

26

Application Unikernel

Page 27: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

27

ApplicationLanguage Runtime

OS User ProcessesOS Kernel

Virtual HW DriversHypervisor

Hardware Driver

Shared LibrariesDocker Runtime

Page 28: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

28

ApplicationLanguage Runtime

OS User ProcessesOS Kernel

Virtual HW DriversHypervisor

Hardware Driver

Shared LibrariesDocker Runtime

Page 29: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

29

ApplicationLanguage Runtime

Unikernel

Virtual HW DriversHypervisor

Hardware Driver

Page 30: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Fonctionnement high level

30

ApplicationLanguage Runtime

Unikernel

Virtual HW DriversHypervisor

Hardware Driver

Page 31: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Qu’est ce que ça change ?

3

31

Page 32: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Processus de construction d’une image Unikernel

32

App Binary

App Config

App Deps

Lang runtime

Virt, HW Drivers

Packaging Tool Image Unikernel

AP

PLI

CA

TIO

NU

NIK

ER

NE

LR

UN

TIM

E

Page 33: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Comment boot un Unikernel ?

33

Booter un Unikernel c’est tout simplement booter une image dans un hypervisor

Page 34: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Comment boot un Unikernel ?

34

Page 35: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

35

● Un seul processus

Page 36: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

36

● Un seul processus

Pas de “fork”

Page 37: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

37

● Un seul processus

Pas de “fork”

Pas de “context switching”

Page 38: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

38

● Un seul espace mémoire● Pas de mémoire virtuelle

Page 39: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

39

● Un seul espace mémoire● Pas de mémoire virtuelle

Gains en perf

Page 40: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

40

● Un seul espace mémoire● Pas de mémoire virtuelle

Gains en perf

Une Application ne peut utiliser plus de mémoire physique que ce qui est disponible

Page 41: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

41

● Un seul espace mémoire● Pas de mémoire virtuelle

Gains en perf

Une Application ne peut utiliser plus de mémoire physique que ce qui est disponible

Pas de mmap

Page 42: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

42

● Il n’y a plus de cloisonnement entre les espaces kernel et utilisateur

Page 43: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

43

● Il n’y a plus de cloisonnement entre les espaces kernel et utilisateur

Votre application s’exécute dans le kernel space

Page 44: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

44

● Il n’y a plus de cloisonnement entre les espaces kernel et utilisateur

Votre application s’exécute dans le kernel space

Gain en performance pour les I/O

Page 45: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Quelles conséquences

45

● Il n’y a plus de cloisonnement entre les espaces kernel et utilisateur

Votre application s’exécute dans le kernel space

Gain en performance pour les I/O

Pas de protection de la mémoire entre kernel/app

Page 46: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

kernel/user space : exécution avec un linux

46

Page 47: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Pas de kernel/user space avec Unikernel

47

Unikernel

Page 48: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

L’offre

4

48

Page 49: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Unikernel.org

49

● MirageOS● OSv● Rumprun● runtime.js● UniK

Page 50: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

De nombreuses solutions

50

● ClickOS● Clive● Drawbridge● HaLVM● IncludeOS● LING

● MirageOS● OSv● Rumprun● runtime.js● UniK

Page 51: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Comparaison de l’offre

51

Page 52: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Comparaison de l’offre

52

Page 53: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Unik

53

Page 54: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Unik

54

● Le “docker” de l’Unikernel

Page 55: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Une CLI à la docker

55

Page 56: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Un Hub à la Docker Hub

56

Page 57: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Un intermédiaire avec différents Unikernel

57

Page 58: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Excellent candidat pour une démo !

58

Page 59: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Démo time !

5

59

Page 60: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Démo time !

60

● Démo d’une application Java avec l’Unikernel Unik sur VirtualBox

Page 61: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Démo time !

61

Étapes :

● Installation de Unik

Page 62: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Démo time !

62

Étapes:

● Installation de Unik

● Création d’une image

Page 63: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Démo time !

63

Étapes:

● Installation de Unik

● Création d’une image

● Création d’une instance à partir de l’image

Page 64: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr

Conclusion

6

64

Page 65: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr 65

Pas d’image hub unikernel “à la” docker registry

Page 66: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr 66

Cloud Public on paye à l’utilisation de l’instance

Page 67: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr 67

Complexité de certaines solutions

Page 68: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr 68

Persistance des données

Page 69: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr 69

Le plus : les performances et la sécurité annoncées

Page 70: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr 70

Unikernel n’est pas l’alter ego de Docker

Page 71: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr 71

Unikernel pour l’IoT

Page 72: Xebicon'16 : Introduction à Unikernel. Par Jean-Baptiste Claramonte et Tomas Rodriguez, Développeurs chez Xebia

@xebiconfr #xebiconfr 72

À suivre, mais tout ça n’est pas sec pour l’instant !