Immutable Distributed Infrastructure for Unikernels WG2.8, Greece - - PowerPoint PPT Presentation

immutable distributed infrastructure for unikernels
SMART_READER_LITE
LIVE PREVIEW

Immutable Distributed Infrastructure for Unikernels WG2.8, Greece - - PowerPoint PPT Presentation

Immutable Distributed Infrastructure for Unikernels WG2.8, Greece Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas Gazagnaire University of Cambridge Computer Laboratory May 26, 2015 Anil Madhavapeddy (speaker) with Benjamin


slide-1
SLIDE 1

Immutable Distributed Infrastructure for Unikernels

WG2.8, Greece Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas Gazagnaire University of Cambridge Computer Laboratory May 26, 2015

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 1 / 28

slide-2
SLIDE 2

Background ◮ Unikernels ◮ Irmin, a large-scale, immutable, branch-consistent storage Weakly consistent data structures ◮ Mergeable queues ◮ Mergeable ropes Benchmarking Irmin Use Cases

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 2 / 28

slide-3
SLIDE 3

Background Unikernels

  • Modern systems are built in memory-safe programming languages.
  • We build elaborate libraries and applications to express complex logic.
  • ...and watch it all come crashing down when it interfaces with the OS.

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 3 / 28

slide-4
SLIDE 4

Background Unikernels

Mirage OS is a library operating system that constructs unikernels for secure, high-performance network applications across a variety of cloud computing and mobile platforms.

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 4 / 28

slide-5
SLIDE 5

Background Unikernels

Mirage OS is a library operating system that constructs unikernels for secure, high-performance network applications across a variety of cloud computing and mobile platforms.

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 4 / 28

slide-6
SLIDE 6

Background Unikernels

Mirage OS is a library operating system that constructs unikernels for secure, high-performance network applications across a variety of cloud computing and mobile platforms.

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 4 / 28

slide-7
SLIDE 7

Background Unikernels

Unikernel compiler

Hardware Hypervisor OS Kernel User Processes Language Runtime Parallel Threads Application Binary Language Runtime Hardware Hypervisor Application Code Configuration Files application source code configuration files hardware architecture whole-system optimisation

specialised unikernel

}

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 5 / 28

slide-8
SLIDE 8

Background Unikernels

What should a storage interface to unikernels look like?

  • Highly distributed systems
  • Frequent failure is an option
  • Debugging and tracing must be built into the fabric

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 6 / 28

slide-9
SLIDE 9

Background Irmin, a large-scale, immutable, branch-consistent storage

Irmin, large-scale, immutable, branch-consistent storage

  • Irmin is a library to persist and synchronize distributed data

structures both on-disk and in-memory

  • It enables a style of programming very similar to the Git workflow,

where distributed nodes fork, fetch, merge and push data between each other

  • The general idea is that you want every active node to get a local

(partial) copy of a global database and always be very explicit about how and when data is shared and migrated

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 7 / 28

slide-10
SLIDE 10

Background Irmin, a large-scale, immutable, branch-consistent storage Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 8 / 28

slide-11
SLIDE 11

Background Irmin, a large-scale, immutable, branch-consistent storage

type t = ... (** User -defined

  • contents. *)

type result = [ ‘Ok of t | ‘Conflict of string ] val merge: old:t → t → t → result (** 3-way merge

  • functions. *)
  • ld

x y ?

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 9 / 28

slide-12
SLIDE 12

Weakly consistent data structures

Weakly consistent data structures

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 10 / 28

slide-13
SLIDE 13

Weakly consistent data structures Mergeable queues

Mergeable queues

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 11 / 28

slide-14
SLIDE 14

Weakly consistent data structures Mergeable queues

module type IrminQueue.S = sig type t type elt val create : unit → t val length : t → int val is_empty : t → bool val push : t → elt → t val pop : t → (elt * t) val peek : t → (elt * t) val merge : IrminMerge.t end

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 12 / 28

slide-15
SLIDE 15

Weakly consistent data structures Mergeable queues I0 n01 n02 n03 n04 n05 n06 n07 I1 n11 n12 n13 n14 top bottom top b

  • t

t

  • m

Index Node Elt pop list push list Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 13 / 28

slide-16
SLIDE 16

Weakly consistent data structures Mergeable queues

I old

A B C D

I 1

A B C D E

I 2

B C D F G

I 1

B C D E

I 2

F G

I 1

B C D E

I 2

F G

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 14 / 28

slide-17
SLIDE 17

Weakly consistent data structures Mergeable queues

Current state Operation Read Write Push 2 O(1) Pop 2 on average 1 on average O(1) Merge n 1 O(n)

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 15 / 28

slide-18
SLIDE 18

Weakly consistent data structures Mergeable queues

Current state Operation Read Write Push 2 O(1) Pop 2 on average 1 on average O(1) Merge n 1 O(n) With a little more work Operation Read Write Push 2 O(1) Pop 2 on average 1 on average O(1) Merge log n 1 O(log n)

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 15 / 28

slide-19
SLIDE 19

Weakly consistent data structures Mergeable ropes

Mergeable ropes

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 16 / 28

slide-20
SLIDE 20

Weakly consistent data structures Mergeable ropes

module type IrminRope.S = sig type t type value (* e.g char *) type cont (* e.g string *) val create : unit → t val make : cont → t ... val set : t → int → value → t val get : t → int → value val insert : t → int → cont → t val delete : t → int → int → t val append : t → t → t val split : t → int → (t * t) val merge : IrminMerge.t end

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 17 / 28

slide-21
SLIDE 21

Weakly consistent data structures Mergeable ropes

Operation Rope String Set/Get O(log n) O(1) Split O(log n) O(1) Concatenate O(log n) O(n) Insert O(log n) O(n) Delete O(log n) O(n) Merge log (f (n)) f (n)

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 18 / 28

slide-22
SLIDE 22

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-23
SLIDE 23

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-24
SLIDE 24

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met 5 2 2 lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-25
SLIDE 25

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met 5 2 2 lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-26
SLIDE 26

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met 5 2 2 2 lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-27
SLIDE 27

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met 5 2 2 2 4 3 lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-28
SLIDE 28

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met 5 5 2 2 2 4 3 lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-29
SLIDE 29

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met 10 5 5 2 2 2 4 3 lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-30
SLIDE 30

Weakly consistent data structures Mergeable ropes 10 5 2 2 2 1 lo rem ip sum do a met 10 5 5 2 2 2 1 lo rem ip sum do lor a met 10 5 2 2 2 4 3 lo rem ip sum do sit a met 10 5 5 2 2 2 4 3 lo rem ip sum do lor sit a met Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 19 / 28

slide-31
SLIDE 31

Benchmarking Irmin

Benchmarking Irmin

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 20 / 28

slide-32
SLIDE 32

Benchmarking Irmin

100000 200000 300000 400000 500000 500 1000 1500 2000 2500 3000 3500 4000 4500 Time spent for whole operations (µs) Number of push/pop successively applied Core Obj Memory GitMem GitDsk

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 21 / 28

slide-33
SLIDE 33

Benchmarking Irmin

module ObjBackend ... = struct type t = unit type key = K.t type value = V.t let create () = return () let clear () = return () let add t value = return (Obj.magic (Obj.repr value)) let read t key = return (Obj.obj (Obj.magic key)) let mem t key = return true ... end

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 22 / 28

slide-34
SLIDE 34

Benchmarking Irmin

100 200 300 400 500 500 1000 1500 2000 2500 3000 3500 4000 4500 Time spent for whole operations (µs) Number of push/pop successively applied Core Obj Memory GitMem GitDsk

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 23 / 28

slide-35
SLIDE 35

Benchmarking Irmin

10 20 30 40 50 60 70 80 10 20 30 40 50 60 70 80 Write time estimation (µs) Read time estimation (µs) IrminMemory backend 10 20 30 40 50 60 70 80 10 20 30 40 50 60 70 80 Write time estimation (µs) Read time estimation (µs) IrminGit.Memory backend

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 24 / 28

slide-36
SLIDE 36

Use Cases

Status

  • HTTP REST APIs for remote clients.
  • JavaScript compilation for pure browser operation.
  • Bidirectional lenses (Git commits map to Irmin commits from

any direction)

  • Open source at https://github.com/mirage/irmin
  • JFLA 2015 paper got great feedback. Now building more data

structures, evaluating block scheduling.

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 25 / 28

slide-37
SLIDE 37

Use Cases

  • Jitsu: Just-In-Time Summoning of Unikernels

https://www.youtube.com/watch?v=DSzvFwIVm5s

  • Ported complex Xen toolstack to use Irmin.
  • Jitsu becomes the inetd of Xen:
  • Launch VMs in response to network requests in real-time.
  • Irmin coordinates toolstack RPCs with low latency.
  • Connection setup is proxied to eliminate packet loss.

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 26 / 28

slide-38
SLIDE 38

Use Cases

DNS TCP HTTP Jitsud Synjitsu Client Jitsu VM boot domain builder Netfront Xen Unikernel

query answer SYN ACK

Xenstore

libxl boot plug stop record GET HTTP response

1

bridge

Active

replay

2 3 4 5

Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 27 / 28

slide-39
SLIDE 39

Use Cases 200 400 600 800 1000 1200 1400 1600

Time in milliseconds

10 20 30 40 50 60 70

Percentage

...100%

Jitsu cold start (no synjitsu) Jitsu cold start w/ synjitsu, vanilla toolstack Jitsu cold start w/ synjitsu, optimised toolstack

200 400 600 800 1000 1200 1400 1600

Time in milliseconds

10 20 30 40 50 60 70

Percentage

Docker w/ ext4 on tmpfs Docker w/ ext4 on SD card Docker in Xen dom0 w/ ext4 on SD card Anil Madhavapeddy (speaker) with Benjamin Farinier and Thomas GazagnaireUniversity of Cambridge Computer Laboratory Immutable Distributed Infrastructure for Unikernels 28 / 28