unikernel xebicon 2016

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

Upload: jean-baptiste-claramonte

Post on 23-Jan-2018

78 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Introduction à

Unikernel Jean-Baptiste Claramonte

&Tomas Rodriguez

Page 2: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Tomas Rodriguez

2

Page 3: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Jean-Baptiste Claramonte

3

Page 4: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Les motivations pour Unikernel

1

5

Page 6: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

La stack aujourd’hui

6

Hardware Driver

Page 7: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

La stack aujourd’hui

7

HypervisorHardware Driver

Page 8: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

La stack aujourd’hui

8

Virtual HW DriversHypervisor

Hardware Driver

Page 9: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

La stack aujourd’hui

9

Linux User ProcessesLinux Kernel

Virtual HW DriversHypervisor

Hardware Driver

Page 10: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

La stack aujourd’hui

10

Virtual HW DriversHypervisor

Hardware Driver

Shared LibrariesDocker Runtime

Linux User ProcessesLinux Kernel

Page 11: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

La stack aujourd’hui

11

ApplicationLanguage Runtime

Virtual HW DriversHypervisor

Hardware Driver

Shared LibrariesDocker Runtime

Linux User ProcessesLinux Kernel

Page 12: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Avec quel objectif ?

12

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

Page 13: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Linux sait tout faire !

● Linux fonctionne partout !

● On peut tout faire tourner sur linux !

14

Page 15: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Cela a un coût

15

● Small App: 10k

● Medium/Large: 100k

● Huge App: 1M

Page 16: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Cela a un coût

16

Small App: 10k

Medium/Large: 100k

Huge App: 1M

Page 17: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Quelle alternative ?

● Unikernel …

20

Page 21: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Unikernel : qu’est ce que c’est ?

2

21

Page 22: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

22

Kernel

libc libstd++ libgc

libgmp libz libtlc

gtk iconv

OpenGL

Application

Page 23: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

23

Kernel

libc libstd++ libgc

libgmp libz libtlc

gtk iconv

OpenGL

Application

Page 24: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

24

Application

Page 25: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

25

Application

Page 26: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

26

Application Unikernel

Page 27: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

27

ApplicationLanguage Runtime

OS User ProcessesOS Kernel

Virtual HW DriversHypervisor

Hardware Driver

Shared LibrariesDocker Runtime

Page 28: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

28

ApplicationLanguage Runtime

OS User ProcessesOS Kernel

Virtual HW DriversHypervisor

Hardware Driver

Shared LibrariesDocker Runtime

Page 29: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

29

ApplicationLanguage Runtime

Unikernel

Virtual HW DriversHypervisor

Hardware Driver

Page 30: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Fonctionnement high level

30

ApplicationLanguage Runtime

Unikernel

Virtual HW DriversHypervisor

Hardware Driver

Page 31: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Qu’est ce que ça change ?

3

31

Page 32: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Comment boot un Unikernel ?

33

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

Page 34: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Comment boot un Unikernel ?

34

Page 35: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Quelles conséquences

35

● Un seul processus

Page 36: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Quelles conséquences

36

● Un seul processus

Pas de “fork”

Page 37: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Quelles conséquences

37

● Un seul processus

Pas de “fork”

Pas de “context switching”

Page 38: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Quelles conséquences

38

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

Page 39: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Quelles conséquences

39

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

Gains en perf

Page 40: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Quelles conséquences

42

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

Page 43: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

kernel/user space : exécution avec un linux

46

Page 47: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Pas de kernel/user space avec Unikernel

47

Unikernel

Page 48: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

L’offre

4

48

Page 49: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Unikernel.org

49

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

Page 50: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

De nombreuses solutions

50

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

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

Page 51: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Comparaison de l’offre

51

Page 52: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Comparaison de l’offre

52

Page 53: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Unik

53

Page 54: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Unik

54

● Le “docker” de l’Unikernel

Page 55: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Une CLI à la docker

55

Page 56: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Un Hub à la Docker Hub

56

Page 57: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Un intermédiaire avec différents Unikernel

57

Page 58: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Excellent candidat pour une démo !

58

Page 59: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Démo time !

5

59

Page 60: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Démo time !

60

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

Page 61: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Démo time !

61

Étapes :

● Installation de Unik

Page 62: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Démo time !

62

Étapes:

● Installation de Unik

● Création d’une image

Page 63: Unikernel Xebicon 2016

@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: Unikernel Xebicon 2016

@xebiconfr #xebiconfr

Conclusion

6

64

Page 65: Unikernel Xebicon 2016

@xebiconfr #xebiconfr 65

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

Page 66: Unikernel Xebicon 2016

@xebiconfr #xebiconfr 66

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

Page 67: Unikernel Xebicon 2016

@xebiconfr #xebiconfr 67

Complexité de certaines solutions

Page 68: Unikernel Xebicon 2016

@xebiconfr #xebiconfr 68

Persistance des données

Page 69: Unikernel Xebicon 2016

@xebiconfr #xebiconfr 69

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

Page 70: Unikernel Xebicon 2016

@xebiconfr #xebiconfr 70

Unikernel n’est pas l’alter ego de Docker

Page 71: Unikernel Xebicon 2016

@xebiconfr #xebiconfr 71

Unikernel pour l’IoT

Page 72: Unikernel Xebicon 2016

@xebiconfr #xebiconfr 72

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