SlideShare a Scribd company logo
1 of 102
Download to read offline
on
$ whoami
Name: Zvi Avraham
E-mail: zvi@nivertech.com
/ˈkɒm.
pɑː(ɹ)t.
mɛntl̩.
aɪˌzeɪ.
ʃən/
Physicalization
• The opposite of Virtualization
• dedicated machines
• no virtualization overhead
• no noisy neighbors
– nobody stealing your CPU cycles, IOPS or bandwidth
– your EC2 instance may have a Netflix “roommate” ;)
• Mostly used by ARM-based public clouds
• also called Bare Metal or HPC clouds
Sandbox–
a virtual container in which
untrusted code can be safely run
Sandbox examples:
ZeroVM & AWS Lambda
based on Google Native Client:
A Sandbox for Portable,
Untrusted x86 Native Code
Compartmentalization
in terms of Virtualization
Physicalization No Virtualization
Virtualization HW-level Virtualization
Containerization OS-level Virtualization
Sandboxing Userspace-level
Virtualization*
HARDWARE
Cloud runs on virtual HW
Does the OS on your Cloud instance
still supports floppy drive?
$ ls /dev
on Ubuntu 14.04 AWS EC2 instance
• 64 teletype devices?
• 32 serial ports?
• Sound?
• VGA?
Hardware
Hypervisor
Guest OS
Managed Runtime (JVM/BEAM)
“It’s DUPLICATED on so many LAYERS”
Container
OSprocess*
Middleware (Spring/OTP)
Application + Configuration
Guest Container OS
Container
VM
APPS
We run Single App per VM
USERS
We run in Single User mode
Minimalistic Linux OSes
• Embedded Linux versions
• DamnSmall Linux
• Linux with BusyBox
Min. Linux OSes for Containers
JeOS – “Just Enough OS”
• CoreOS
• RancherOS
• RedHat Project Atomic
• VMware Photon
• Intel Clear Linux
• Hyper
# of Processes and Threads per OS
0 50 100 150
Ubuntu 14.04
CoreOS
RancherOS
OSv + CLI
processes
threads
What’s Unikernel?
• A “library” operating system
• kernel library linked with your application
• A kernel that can only support one process
• Single Address Space
• No kernel / userspace separation
• “Unikernels: Library Operating Systems for the
Cloud”
– http://anil.recoil.org/papers/2013-asplos-mirage.pdf
What’s Anykernel?
• Programming discipline for kernel code
reuse
• Capabilities
–NetBSD filesystems as Linux processes
–User-space TCP/IP stack
• “The Design and Implementation of the
Anykernel and Rump Kernels”, Antti
Kantee
–http://book.rumpkernel.org/
Unikernel + Anykernel
• Unikernels originally were designed to run on
top of Hypervisor
• Now combined with Anykernel / Rump kernel
ideas, some unikernels, like MirageOS or LING
VM can run on Bare Metal
Source: http://erlangonxen.org/http://erlangonxen.org/
http://osv.io
Unikernel Projects
Name Target
MirageOS OCaml
HalVM Haskell
ClickOS Click DSL
Clive Go (inpired by Plan 9 & CSP)
Boxfuse JVM
LING VM
(Erlang-on-Xen)
Erlang
OSv POSIX*, JVM,
High Performance non-POSIX API
Windows 10 & Ubuntu – are outliers
0 500000 1000000 1500000 2000000 2500000 3000000 3500000
Xen miniOS
MirageOS
BusyBox without kernel
HalVM
ClickOS
LING (Erlang-on-Xen)
OSv v0.20
Boxfuse
DamnSmall Linux
BusyBox with Linux kernel
Linux Kernel 3.x.x
Ubuntu 14.04 Vagrant Box
Ubuntu 14.04 Server
Ubuntu 14.04 Desktop
Windows 10
OS min image size (in KB)
0 10000 20000 30000 40000 50000 60000 70000 80000
Xen miniOS
MirageOS
BusyBox without kernel
HalVM
ClickOS
LING (Erlang-on-Xen)
OSv v0.20
Boxfuse
DamnSmall Linux
BusyBox with Linux kernel
Linux Kernel 3.x.x
OS min image size (in KB)
OSv is half-way between
Unikernels & Linux Kernel
0 5000 10000 15000 20000 25000
Xen miniOS
MirageOS
HalVM
ClickOS
LING (Erlang-on-Xen)
OSv v0.20
OS min image size (in KB)
OSv is “fat” Unikernel or Anykernel-ish
Specialized Unikernels
• Compile to very small images
• Boot very fast
• requires writing all code in Higher Level
statically typed language, like OCaml or
Haskell
• Hard/impossible to port existing code
• Very secure: tiny attack surface
Anykernel-ish or “fat unikernels”
• Larger images (still much smaller that Linux)
• Longer boot times (much faster that Linux)
• Larger attack surface (much smaller that Linux)
• Easier to port existing code
• More pragmatic solution overall
OSv is “Fat” Unikernel / Anykernel-ish
• OSv sometimes called “fat” unikernel
• since OSv images are a little bit larger than for
other unikernels
• It also called anykernel-ish, since it
–run on top of multiple hypervisors
–provide TCP/IP stack and filesystem
• Small price to pay for LINUX ABI compatibility
Capstan – Docker-like CLI for OSv
$ capstan
NAME: capstan - pack, ship, and run applications in light-weight VMs
USAGE: capstan [global options] command [command options] [args...]
VERSION: v0.1.8
COMMANDS:
info show disk image information
import import an image to the local repository
pull pull an image from a repository
rmi delete an image from a repository
run launch a VM. You may pass the image name as the first arg
build build an image
images, i list images
search search a remote images
instances, I list instances
stop stop an instance
delete delete an instance
help, h Shows a list of commands or help for one command
Download & Run OSv+CLI image
$ capstan run cloudius/osv
Downloading cloudius/osv/index.yaml...
170 B / 170 B [====================] 100.00 %
Downloading cloudius/osv/osv.qemu.gz...
21.78 MB / 21.78 MB [==============] 100.00 %
Created instance: cloudius-osv
OSv v0.20
eth0: 192.168.122.15
pthread_setcancelstate() stubbed
/#
Match
Made
in
Heaven
+ =
on
Containers add new layers
vs
Unikernels remove layers
"All problems in computer science can be
solved by another level of indirection“
–David Wheeler
"...except for the problem of too many
layers of indirection.“
–Kevlin Henney
Hardware
Traditional OS
BEAM
Erlang on Physical Machine
OSprocess*
OTP
Erlang / Elixir application + config
Hardware
Hypervisor
Traditional OS
BEAM
Erlang in VM
OSprocess*
OTP
Erlang / Elixir application + config
VM
Hardware
Hypervisor
Traditional OS
BEAM
Container in VM
Container
OSprocess*
OTP
Erlang / Elixir application + config
Guest Container OS
Container
VM
Hardware
Hypervisor
Traditional OS
BEAM
Multitenancy - VM in Container in VM
Container
OSprocess*
OTP
Erlang / Elixir application + config
Guest Container OS
Container
VM
KVM
Hardware
Traditional OS
BEAM
Container on Physical Machine
Container
OSprocess*
OTP
Erlang / Elixir application + config
Guest Container OS
Container
Hardware
Traditional OS
BEAM
VM in Container on Physical Machine
for Multitenancy
Container
OSprocess*
OTP
Erlang / Elixir application + config
Guest Container OS
Container
KVM
Hardware
Hypervisor
OSv + BEAM
Erlang on OSv
OSprocess
OTP
Erlang / Elixir application + config
VM
Hardware
Hypervisor
LING VM
LING VM (Erlang-on-Xen)
OSprocess
OTP
Erlang / Elixir application + config
VM
Hardware
LING VM
LING VM on Bare Metal
Singleapp
OTP
Erlang / Elixir application + config
Erjang – Erlang for JVM
OSv has built-in JVM support,
so Erjang runs w/o porting on OSv
on
$ git clone https://github.com/cloudius-
systems/osv-apps
$ cd osv-apps/erjang/
$ cat Capstanfile
base:
cloudius/osv-openjdk
cmdline: >
/java.so -jar erjang.jar
build:
./GET
files:
/erjang.jar: erjang.jar
Build OSv+JVM+Erjang image
$ cd osv-apps/erjang
$ capstan build
Building erjang...
Downloading cloudius/osv-
openjdk/index.yaml...
169 B / 169 B [==================] 100.00 %
Downloading cloudius/osv-openjdk/osv-
openjdk.qemu.gz...
74.26 MB / 74.26 MB [============] 100.00 %
Uploading files...
1 / 1 [==========================] 100.00 %
$ capstan run
Created instance: erjang
OSv v0.20
eth0: 192.168.122.15
** Erjang R16B01 ** [root:/~resource]
[erts:5.10.2] [smp S:1 A:10]
[java:1.7.0_55] [unicode]
WARNING: fcntl(F_SETLK) stubbed
Eshell V5.10.2 (abort with ^G)
1> lists:reverse("Hello, World!").
"!dlroW ,olleH“
2> q().
ok
Porting a C/C++ application to OSv
• A single-process application
–may not fork() or exec()
• Position Independent Code
–recompile with –fPIC flag
• Need to rebuild as a shared object (.so)
–link with –shared flag
• or as Position Independent Exec. (– fpie)
– can run the same executable in Linux and OSv
Build OSv image with native code
Makefile
$ git clone https://github.com/cloudius-
systems/capstan-example
$ cd capstan-example
$ cat Capstanfile
base:
cloudius/osv-base
cmdline:
/tools/hello.so
build:
make
files:
/tools/hello.so: hello.so
Build OSv + Hello World image
$ capstan build
Building capstan-example...
Downloading cloudius/osv-base/index.yaml...
154 B / 154 B [==================] 100.00 %
Downloading cloudius/osv-base/osv-
base.qemu.gz...
20.13 MB / 20.13 MB [============] 100.00 %
Uploading files...
1 / 1 [==========================] 100.00 %
Run OSv + Hello World image
$ capstan run
Created instance: capstan-example
OSv v0.20
eth0: 192.168.122.15
Hello, world!
$
PORTING ERLANG/OTP TO OSV
No fork() or exec() in OSv
BUT ERLANGFORKS
ERLANGPORTS
Interfaces to the outside world
How Erlang Port Works
Port
Source: Ulf Wiger, Erlang Open Telecom Platform
fork/exec the Port executable
Port
External
process
• Erlang Port is a middleman/proxy
• allow External Process to pretend to be another Erlang process
• allow communication using regular Erlang message passing
Source: Ulf Wiger, Erlang Open Telecom Platform
Erlang process sends msg to Port
Port
External
process
Port ! {self(), {command, [1,2,3]}}
Source: Ulf Wiger, Erlang Open Telecom Platform
Port send msg to External Process
Port
External
process
Port ! {self(), {command, [1,2,3]}}
A port can use a TCP, UDP, SSL
socket, UNIX pipe, stdin/stdout
or a custom transport
Source: Ulf Wiger, Erlang Open Telecom Platform
Port rcv msg from External Process
Port
External
process
A port can use a TCP, UDP, SSL
socket, UNIX pipe, stdin/stdout
or a custom transport
receive
{Port, {data, Info}} -> ...
end
Source: Ulf Wiger, Erlang Open Telecom Platform
Port send msg to Erlang Process
Port
External
process
receive
{Port, {data, Info}} -> ...
end
A port can use a TCP, UDP, SSL
socket, UNIX pipe, stdin/stdout
or a custom transport
Source: Ulf Wiger, Erlang Open Telecom Platform
Communicating with External world
In-proc Out-of-proc
Custom
Protocol
Linked-in
Drivers (.so)
Ports
(executable)
Generic
Protocol
NIF (.so) C-Node
How to adapt existing Ports to OSv?
• the solution was to rewrite ports using OS
processes as linked-in drivers using POSIX
threads
• With some exceptions
Community Port of Erlang/OTP to OSv
• I “ported” Erjang a year ago
• I tried to port official Erlang/OTP – but quickly
lost myself in the Erlang build system
• Also reliance on lots of ports and shell scripts
made me less optimistic
• Cloudius is focused on POSIX & JVM, Erlang is
not a priority
• OSv mailing list discussed porting Erlang, but
there was no progress
Community Port of Erlang/OTP to OSv
• People who helped to port Erlang to OSv:
– Yao Zheng (https://github.com/bhuztez)
– Bas Wegh
– Zika L'Etrange
• Yao Zheng also ported following projects:
– Elixir
– LFE
– yaws
The most important executables
• erl – wrapper to erlexec
• epmd – Erlang Port Mapping Daemon
• heart – watchdog for BEAM (Erlang VM)
• inet_gethost – native DNS resolver
• osmon – mem_sup, disk_sup, cpu_sup
• odbserver – ODBC connectivity
Not everything ported yet.
erl
• erlang.so – OSv shared object executable
wrapper to erlexec
• pass vm.args and other CLI parameters to
erlexec
base:
cloudius/osv-base
cmdline: >
/usr/lib64/erlang.so -env HOME / 
/etc/erlang/vm.args 
/etc/default/erlang/vm.args
build:
make
files:
/usr/lib64/erlang/: ROOTFS/usr/lib64/erlang/
/usr/lib64/erlang.so: erlang.so
/etc/default/erlang/: default/
/etc/erlang/vm.args: default/vm.args
$ git clone git@github.com:cloudius-
systems/osv-apps.git
$ cd osv-apps/erlang
$ capstan run
Created instance: erlang
OSv v0.20
eth0: 192.168.122.15
sched_getaffinity() stubbed
Eshell V6.2 (abort with ^G)
1> lists:reverse("Hello, World!").
"!dlroW ,olleH“
2>
epmd – Erlang Port Mapper Daemon
• Option #1: use pure Erlang implementation of
epmd:
– https://github.com/bhuztez/noepmd
– https://github.com/lemenkov/erlpmd
• Option #2: run unmodified epmd as a POSIX
thread, instead of a separate OS process
• Option #2 was selected
• Q: How epmd implemented in Erlang on RTOS
like VxWorks or OSE?
inet_gethost
1> httpc:request("http://google.com").
=ERROR REPORT==== 6-May-2015::13:43:58 ===
Error in process <0.79.0> with exit value:
{unknown,[{erlang,open_port,[
{spawn,"inet_gethost 4"}, ...
inet_gethost
• Currently DNS resolving doesn’t work yet
• Force to use pure-Erlang inet DNS resolver
• It’s a default in Erlang on VxWorks & ENEA
OSE RTOS
erl -sname mynode -kernel inetrc "'./erl_inetrc'“
{edns, 0}
http://www.erlang.org/doc/apps/erts/inet_cfg.html
osmon
• osmon ports where modified from standalone
OS processes to linked-in drivers on POSIX
thread
– disk_sup
– mem_sup
– cpu_sup is disabled since OSv lacks required API
OTP apps + BEAM + Unikernel OS
• Erlang releases already may include Erlang VM
• Adding a Unikernel OS to releases will make
them truly self-contained!
Development process
• Currently Erlang OSv port is developed as a set
of patch files in Osv apps repo:
– https://github.com/cloudius-systems/osv-apps
• Better way would be, to make it part of
Erlang/OTP official repository (just like other
OSes):
– https://github.com/erlang/otp
HIGH PERFORMANCE
NETWORKING & I/O
Why Use Unikernels?
Long time before “Erlang The Movie”.
Telephone Switches worked like …
Source: Erlang The Movie
Worker processes
Supervisors
Sockets / Ports
mic - send msgs
headphones – rcv msgs
Supervisors
Data Plane was handled by
specialized HW or RTOS
Source: Erlang The Movie
Erlang for both
Control Plane + Data Plane
• In traditional OSes like Linux, IO & TCP/IP
implemented via system calls, which has
kernel overhead
• Many unikernels have user-space TCP/IP stack
• OSv implements Van Jacobsen’s Net Channels
optimization
• Optimized for NFV & SDN applications
• It’s already possible with LING VM
• And with non-POSIX APIs in OSv
LING VM (ERLANG-ON-XEN) &
ERLANG/OTP ON OSV
Comparing LING VM vs Erlang on OSv
LING VM Erlang/OTP on OSv
Erlang VM Custom VM (latest
update from OTP –
Dec 2014)
Open-source
Ericsson’s
Erlang/OTP 17.3
State Production-grade
(3.5 years)
Experimental
(6 months)
License Proprietary (Sleepycat) BSD 3-clause
SMP (threads) - +
Ports - -
NIFs - + (possible)
HiPE - - (possible)
Disable GC + -
LING VM Erlang/OTP on OSv
Hypervisors Xen only KVM, Xen, VMware,
VirtualBox
Bare Metal Bare Metal RPi -
Cloud support AWS AWS, Google Cloud
Machine arch X86-64,ARM-32,MIPS X86-64, ARM-64
Min img size 9 MB 21 MB
Boot time < 100 ms < 1 sec
“Dockerfiles” railing Capstan
Filesystem goofs (Plan9) ZFS
Data Plane,
NFV/SDN
+ possible via non-
POSIX API?
Takeaways
• It seems that after Docker, Unikernels are going to be
“The Next Big Thing” in the Cloud
• Erlang community now has 2 options to choose from
- try both
• Try to port your Erlang app
• Try to port your favorite open-source Erlang app
• But only when it makes sense!
• Download OSv and help porting standard Ericsson’s
Erlang/OTP to Osv
• https://github.com/erlang-on-osv
Thank You! Now Q&A
All images are taken from Google Image search and various other places on the Internet
© Copyright of corresponding owners
Thanks!
• Thanks to everybody who gave me the
feedback on this presentation:
– Dor Laor
– Tzach Livyatan
– Yao Zheng
– Dave Cottlehuber
BACKUP SLIDES
Mandatory Meme slide ;)
Old-style VMs peaked in 2010
Containers on the rise since 2013
Unikernels spiking in 2015
Erlang on OSv

More Related Content

What's hot

Shipping python project by docker
Shipping python project by dockerShipping python project by docker
Shipping python project by dockerWei-Ting Kuo
 
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarryCeph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarryThe Linux Foundation
 
Live migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasLive migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasDocker, Inc.
 
Windsor: Domain 0 Disaggregation for XenServer and XCP
	Windsor: Domain 0 Disaggregation for XenServer and XCP	Windsor: Domain 0 Disaggregation for XenServer and XCP
Windsor: Domain 0 Disaggregation for XenServer and XCPThe Linux Foundation
 
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCPOscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCPThe Linux Foundation
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)HungWei Chiu
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedDataStax Academy
 
Wanting distributed volumes - Experiences with ceph-docker
Wanting distributed volumes - Experiences with ceph-dockerWanting distributed volumes - Experiences with ceph-docker
Wanting distributed volumes - Experiences with ceph-dockerEwout Prangsma
 
QNAP COSCUP Container Station
QNAP COSCUP Container StationQNAP COSCUP Container Station
QNAP COSCUP Container StationWu Fan-Cheng
 
Scaling and Managing Cassandra with docker, CoreOS and Presto
Scaling and Managing Cassandra with docker, CoreOS and PrestoScaling and Managing Cassandra with docker, CoreOS and Presto
Scaling and Managing Cassandra with docker, CoreOS and PrestoVali-Marius Malinoiu
 
Ceph in the GRNET cloud stack
Ceph in the GRNET cloud stackCeph in the GRNET cloud stack
Ceph in the GRNET cloud stackNikos Kormpakis
 
Introducing Container Technology to TSUBAME3.0 Supercomputer
Introducing Container Technology to TSUBAME3.0 SupercomputerIntroducing Container Technology to TSUBAME3.0 Supercomputer
Introducing Container Technology to TSUBAME3.0 SupercomputerAkihiro Nomura
 
General Bare-metal Provisioning Framework.pdf
General Bare-metal Provisioning Framework.pdfGeneral Bare-metal Provisioning Framework.pdf
General Bare-metal Provisioning Framework.pdfOpenStack Foundation
 
Docker Container Orchestration
Docker Container OrchestrationDocker Container Orchestration
Docker Container OrchestrationFernand Galiana
 
Isn't it ironic - managing a bare metal cloud (OSL TES 2015)
Isn't it ironic - managing a bare metal cloud (OSL TES 2015)Isn't it ironic - managing a bare metal cloud (OSL TES 2015)
Isn't it ironic - managing a bare metal cloud (OSL TES 2015)Devananda Van Der Veen
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in KubernetesMinhan Xia
 

What's hot (20)

Shipping python project by docker
Shipping python project by dockerShipping python project by docker
Shipping python project by docker
 
Docker.io
Docker.ioDocker.io
Docker.io
 
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarryCeph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
Ceph, Xen, and CloudStack: Semper Melior-XPUS13 McGarry
 
Live migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasLive migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchas
 
Windsor: Domain 0 Disaggregation for XenServer and XCP
	Windsor: Domain 0 Disaggregation for XenServer and XCP	Windsor: Domain 0 Disaggregation for XenServer and XCP
Windsor: Domain 0 Disaggregation for XenServer and XCP
 
LXC
LXCLXC
LXC
 
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCPOscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
Oscon 2012 : From Datacenter to the Cloud - Featuring Xen and XCP
 
Openstack Xen and XCP
Openstack Xen and XCPOpenstack Xen and XCP
Openstack Xen and XCP
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
 
Wanting distributed volumes - Experiences with ceph-docker
Wanting distributed volumes - Experiences with ceph-dockerWanting distributed volumes - Experiences with ceph-docker
Wanting distributed volumes - Experiences with ceph-docker
 
QNAP COSCUP Container Station
QNAP COSCUP Container StationQNAP COSCUP Container Station
QNAP COSCUP Container Station
 
Scaling and Managing Cassandra with docker, CoreOS and Presto
Scaling and Managing Cassandra with docker, CoreOS and PrestoScaling and Managing Cassandra with docker, CoreOS and Presto
Scaling and Managing Cassandra with docker, CoreOS and Presto
 
Ceph in the GRNET cloud stack
Ceph in the GRNET cloud stackCeph in the GRNET cloud stack
Ceph in the GRNET cloud stack
 
Introducing Container Technology to TSUBAME3.0 Supercomputer
Introducing Container Technology to TSUBAME3.0 SupercomputerIntroducing Container Technology to TSUBAME3.0 Supercomputer
Introducing Container Technology to TSUBAME3.0 Supercomputer
 
General Bare-metal Provisioning Framework.pdf
General Bare-metal Provisioning Framework.pdfGeneral Bare-metal Provisioning Framework.pdf
General Bare-metal Provisioning Framework.pdf
 
Docker Container Orchestration
Docker Container OrchestrationDocker Container Orchestration
Docker Container Orchestration
 
Isn't it ironic - managing a bare metal cloud (OSL TES 2015)
Isn't it ironic - managing a bare metal cloud (OSL TES 2015)Isn't it ironic - managing a bare metal cloud (OSL TES 2015)
Isn't it ironic - managing a bare metal cloud (OSL TES 2015)
 
Docker vs kvm
Docker vs kvmDocker vs kvm
Docker vs kvm
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in Kubernetes
 

Similar to Erlang on OSv

Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014André Rømcke
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationErica Windisch
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Arun prasath
 
Ignite 2016 - Windows Containers
Ignite 2016 - Windows ContainersIgnite 2016 - Windows Containers
Ignite 2016 - Windows ContainersTaylor Brown
 
Baylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStackBaylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStackJesse Andrews
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetesDongwon Kim
 
Webinar - Getting Started With Ceph
Webinar - Getting Started With CephWebinar - Getting Started With Ceph
Webinar - Getting Started With CephCeph Community
 
Automating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with PuppetAutomating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with Puppetbuildacloud
 
Introduction to Container Management on AWS
Introduction to Container Management on AWSIntroduction to Container Management on AWS
Introduction to Container Management on AWSAmazon Web Services
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java binOlve Hansen
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Jérôme Petazzoni
 
Virtual machines and containers
Virtual machines and containersVirtual machines and containers
Virtual machines and containersPatrick Pierson
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemVan Phuc
 
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISORVanika Kapoor
 
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)Ruoshi Ling
 

Similar to Erlang on OSv (20)

Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 
Ignite 2016 - Windows Containers
Ignite 2016 - Windows ContainersIgnite 2016 - Windows Containers
Ignite 2016 - Windows Containers
 
Belvedere
BelvedereBelvedere
Belvedere
 
Aplura virtualization slides
Aplura virtualization slidesAplura virtualization slides
Aplura virtualization slides
 
Proxmox for DevOps
Proxmox for DevOpsProxmox for DevOps
Proxmox for DevOps
 
Baylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStackBaylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStack
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Webinar - Getting Started With Ceph
Webinar - Getting Started With CephWebinar - Getting Started With Ceph
Webinar - Getting Started With Ceph
 
Automating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with PuppetAutomating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with Puppet
 
Introduction to Container Management on AWS
Introduction to Container Management on AWSIntroduction to Container Management on AWS
Introduction to Container Management on AWS
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...
 
Virtual machines and containers
Virtual machines and containersVirtual machines and containers
Virtual machines and containers
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
 
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
 
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
 

More from Zvi Avraham

Data isn't the new Oil - it's a new Asset Class!
Data isn't the new Oil - it's a new Asset Class!Data isn't the new Oil - it's a new Asset Class!
Data isn't the new Oil - it's a new Asset Class!Zvi Avraham
 
Functional APIs with Absinthe GraphQL
Functional APIs with Absinthe GraphQLFunctional APIs with Absinthe GraphQL
Functional APIs with Absinthe GraphQLZvi Avraham
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Zvi Avraham
 
[http://1PU.SH] Building Wireless Sensor Networks with MQTT-SN, RaspberryPi a...
[http://1PU.SH] Building Wireless Sensor Networks with MQTT-SN, RaspberryPi a...[http://1PU.SH] Building Wireless Sensor Networks with MQTT-SN, RaspberryPi a...
[http://1PU.SH] Building Wireless Sensor Networks with MQTT-SN, RaspberryPi a...Zvi Avraham
 
Erlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent WorldErlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent WorldZvi Avraham
 
Cloud Computing: AWS for Lean Startups
Cloud Computing: AWS for Lean StartupsCloud Computing: AWS for Lean Startups
Cloud Computing: AWS for Lean StartupsZvi Avraham
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsZvi Avraham
 

More from Zvi Avraham (10)

Data isn't the new Oil - it's a new Asset Class!
Data isn't the new Oil - it's a new Asset Class!Data isn't the new Oil - it's a new Asset Class!
Data isn't the new Oil - it's a new Asset Class!
 
Functional APIs with Absinthe GraphQL
Functional APIs with Absinthe GraphQLFunctional APIs with Absinthe GraphQL
Functional APIs with Absinthe GraphQL
 
Limited supply
Limited supplyLimited supply
Limited supply
 
TimeSpaceDB
TimeSpaceDBTimeSpaceDB
TimeSpaceDB
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
 
[http://1PU.SH] Building Wireless Sensor Networks with MQTT-SN, RaspberryPi a...
[http://1PU.SH] Building Wireless Sensor Networks with MQTT-SN, RaspberryPi a...[http://1PU.SH] Building Wireless Sensor Networks with MQTT-SN, RaspberryPi a...
[http://1PU.SH] Building Wireless Sensor Networks with MQTT-SN, RaspberryPi a...
 
Erlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent WorldErlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent World
 
Cloud Computing: AWS for Lean Startups
Cloud Computing: AWS for Lean StartupsCloud Computing: AWS for Lean Startups
Cloud Computing: AWS for Lean Startups
 
Erlang OTP
Erlang OTPErlang OTP
Erlang OTP
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming Models
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Erlang on OSv

  • 1. on
  • 2. $ whoami Name: Zvi Avraham E-mail: zvi@nivertech.com
  • 4.
  • 5. Physicalization • The opposite of Virtualization • dedicated machines • no virtualization overhead • no noisy neighbors – nobody stealing your CPU cycles, IOPS or bandwidth – your EC2 instance may have a Netflix “roommate” ;) • Mostly used by ARM-based public clouds • also called Bare Metal or HPC clouds
  • 6. Sandbox– a virtual container in which untrusted code can be safely run
  • 7. Sandbox examples: ZeroVM & AWS Lambda based on Google Native Client: A Sandbox for Portable, Untrusted x86 Native Code
  • 8. Compartmentalization in terms of Virtualization Physicalization No Virtualization Virtualization HW-level Virtualization Containerization OS-level Virtualization Sandboxing Userspace-level Virtualization*
  • 10. Does the OS on your Cloud instance still supports floppy drive?
  • 11. $ ls /dev on Ubuntu 14.04 AWS EC2 instance • 64 teletype devices? • 32 serial ports? • Sound? • VGA?
  • 12. Hardware Hypervisor Guest OS Managed Runtime (JVM/BEAM) “It’s DUPLICATED on so many LAYERS” Container OSprocess* Middleware (Spring/OTP) Application + Configuration Guest Container OS Container VM
  • 13. APPS We run Single App per VM
  • 14. USERS We run in Single User mode
  • 15.
  • 16. Minimalistic Linux OSes • Embedded Linux versions • DamnSmall Linux • Linux with BusyBox
  • 17. Min. Linux OSes for Containers JeOS – “Just Enough OS” • CoreOS • RancherOS • RedHat Project Atomic • VMware Photon • Intel Clear Linux • Hyper
  • 18. # of Processes and Threads per OS 0 50 100 150 Ubuntu 14.04 CoreOS RancherOS OSv + CLI processes threads
  • 19. What’s Unikernel? • A “library” operating system • kernel library linked with your application • A kernel that can only support one process • Single Address Space • No kernel / userspace separation • “Unikernels: Library Operating Systems for the Cloud” – http://anil.recoil.org/papers/2013-asplos-mirage.pdf
  • 20. What’s Anykernel? • Programming discipline for kernel code reuse • Capabilities –NetBSD filesystems as Linux processes –User-space TCP/IP stack • “The Design and Implementation of the Anykernel and Rump Kernels”, Antti Kantee –http://book.rumpkernel.org/
  • 21. Unikernel + Anykernel • Unikernels originally were designed to run on top of Hypervisor • Now combined with Anykernel / Rump kernel ideas, some unikernels, like MirageOS or LING VM can run on Bare Metal
  • 23.
  • 25. Unikernel Projects Name Target MirageOS OCaml HalVM Haskell ClickOS Click DSL Clive Go (inpired by Plan 9 & CSP) Boxfuse JVM LING VM (Erlang-on-Xen) Erlang OSv POSIX*, JVM, High Performance non-POSIX API
  • 26. Windows 10 & Ubuntu – are outliers 0 500000 1000000 1500000 2000000 2500000 3000000 3500000 Xen miniOS MirageOS BusyBox without kernel HalVM ClickOS LING (Erlang-on-Xen) OSv v0.20 Boxfuse DamnSmall Linux BusyBox with Linux kernel Linux Kernel 3.x.x Ubuntu 14.04 Vagrant Box Ubuntu 14.04 Server Ubuntu 14.04 Desktop Windows 10 OS min image size (in KB)
  • 27. 0 10000 20000 30000 40000 50000 60000 70000 80000 Xen miniOS MirageOS BusyBox without kernel HalVM ClickOS LING (Erlang-on-Xen) OSv v0.20 Boxfuse DamnSmall Linux BusyBox with Linux kernel Linux Kernel 3.x.x OS min image size (in KB) OSv is half-way between Unikernels & Linux Kernel
  • 28. 0 5000 10000 15000 20000 25000 Xen miniOS MirageOS HalVM ClickOS LING (Erlang-on-Xen) OSv v0.20 OS min image size (in KB) OSv is “fat” Unikernel or Anykernel-ish
  • 29. Specialized Unikernels • Compile to very small images • Boot very fast • requires writing all code in Higher Level statically typed language, like OCaml or Haskell • Hard/impossible to port existing code • Very secure: tiny attack surface
  • 30. Anykernel-ish or “fat unikernels” • Larger images (still much smaller that Linux) • Longer boot times (much faster that Linux) • Larger attack surface (much smaller that Linux) • Easier to port existing code • More pragmatic solution overall
  • 31.
  • 32. OSv is “Fat” Unikernel / Anykernel-ish • OSv sometimes called “fat” unikernel • since OSv images are a little bit larger than for other unikernels • It also called anykernel-ish, since it –run on top of multiple hypervisors –provide TCP/IP stack and filesystem • Small price to pay for LINUX ABI compatibility
  • 33.
  • 34. Capstan – Docker-like CLI for OSv $ capstan NAME: capstan - pack, ship, and run applications in light-weight VMs USAGE: capstan [global options] command [command options] [args...] VERSION: v0.1.8 COMMANDS: info show disk image information import import an image to the local repository pull pull an image from a repository rmi delete an image from a repository run launch a VM. You may pass the image name as the first arg build build an image images, i list images search search a remote images instances, I list instances stop stop an instance delete delete an instance help, h Shows a list of commands or help for one command
  • 35. Download & Run OSv+CLI image $ capstan run cloudius/osv Downloading cloudius/osv/index.yaml... 170 B / 170 B [====================] 100.00 % Downloading cloudius/osv/osv.qemu.gz... 21.78 MB / 21.78 MB [==============] 100.00 % Created instance: cloudius-osv OSv v0.20 eth0: 192.168.122.15 pthread_setcancelstate() stubbed /#
  • 37.
  • 38. on
  • 39. Containers add new layers vs Unikernels remove layers "All problems in computer science can be solved by another level of indirection“ –David Wheeler "...except for the problem of too many layers of indirection.“ –Kevlin Henney
  • 40. Hardware Traditional OS BEAM Erlang on Physical Machine OSprocess* OTP Erlang / Elixir application + config
  • 41. Hardware Hypervisor Traditional OS BEAM Erlang in VM OSprocess* OTP Erlang / Elixir application + config VM
  • 42. Hardware Hypervisor Traditional OS BEAM Container in VM Container OSprocess* OTP Erlang / Elixir application + config Guest Container OS Container VM
  • 43. Hardware Hypervisor Traditional OS BEAM Multitenancy - VM in Container in VM Container OSprocess* OTP Erlang / Elixir application + config Guest Container OS Container VM KVM
  • 44. Hardware Traditional OS BEAM Container on Physical Machine Container OSprocess* OTP Erlang / Elixir application + config Guest Container OS Container
  • 45. Hardware Traditional OS BEAM VM in Container on Physical Machine for Multitenancy Container OSprocess* OTP Erlang / Elixir application + config Guest Container OS Container KVM
  • 46. Hardware Hypervisor OSv + BEAM Erlang on OSv OSprocess OTP Erlang / Elixir application + config VM
  • 47. Hardware Hypervisor LING VM LING VM (Erlang-on-Xen) OSprocess OTP Erlang / Elixir application + config VM
  • 48. Hardware LING VM LING VM on Bare Metal Singleapp OTP Erlang / Elixir application + config
  • 49. Erjang – Erlang for JVM
  • 50. OSv has built-in JVM support, so Erjang runs w/o porting on OSv on
  • 51. $ git clone https://github.com/cloudius- systems/osv-apps $ cd osv-apps/erjang/ $ cat Capstanfile base: cloudius/osv-openjdk cmdline: > /java.so -jar erjang.jar build: ./GET files: /erjang.jar: erjang.jar
  • 52. Build OSv+JVM+Erjang image $ cd osv-apps/erjang $ capstan build Building erjang... Downloading cloudius/osv- openjdk/index.yaml... 169 B / 169 B [==================] 100.00 % Downloading cloudius/osv-openjdk/osv- openjdk.qemu.gz... 74.26 MB / 74.26 MB [============] 100.00 % Uploading files... 1 / 1 [==========================] 100.00 %
  • 53. $ capstan run Created instance: erjang OSv v0.20 eth0: 192.168.122.15 ** Erjang R16B01 ** [root:/~resource] [erts:5.10.2] [smp S:1 A:10] [java:1.7.0_55] [unicode] WARNING: fcntl(F_SETLK) stubbed Eshell V5.10.2 (abort with ^G) 1> lists:reverse("Hello, World!"). "!dlroW ,olleH“ 2> q(). ok
  • 54. Porting a C/C++ application to OSv • A single-process application –may not fork() or exec() • Position Independent Code –recompile with –fPIC flag • Need to rebuild as a shared object (.so) –link with –shared flag • or as Position Independent Exec. (– fpie) – can run the same executable in Linux and OSv
  • 55. Build OSv image with native code
  • 57. $ git clone https://github.com/cloudius- systems/capstan-example $ cd capstan-example $ cat Capstanfile base: cloudius/osv-base cmdline: /tools/hello.so build: make files: /tools/hello.so: hello.so
  • 58. Build OSv + Hello World image $ capstan build Building capstan-example... Downloading cloudius/osv-base/index.yaml... 154 B / 154 B [==================] 100.00 % Downloading cloudius/osv-base/osv- base.qemu.gz... 20.13 MB / 20.13 MB [============] 100.00 % Uploading files... 1 / 1 [==========================] 100.00 %
  • 59. Run OSv + Hello World image $ capstan run Created instance: capstan-example OSv v0.20 eth0: 192.168.122.15 Hello, world! $
  • 61. No fork() or exec() in OSv
  • 64. How Erlang Port Works Port Source: Ulf Wiger, Erlang Open Telecom Platform
  • 65. fork/exec the Port executable Port External process • Erlang Port is a middleman/proxy • allow External Process to pretend to be another Erlang process • allow communication using regular Erlang message passing Source: Ulf Wiger, Erlang Open Telecom Platform
  • 66. Erlang process sends msg to Port Port External process Port ! {self(), {command, [1,2,3]}} Source: Ulf Wiger, Erlang Open Telecom Platform
  • 67. Port send msg to External Process Port External process Port ! {self(), {command, [1,2,3]}} A port can use a TCP, UDP, SSL socket, UNIX pipe, stdin/stdout or a custom transport Source: Ulf Wiger, Erlang Open Telecom Platform
  • 68. Port rcv msg from External Process Port External process A port can use a TCP, UDP, SSL socket, UNIX pipe, stdin/stdout or a custom transport receive {Port, {data, Info}} -> ... end Source: Ulf Wiger, Erlang Open Telecom Platform
  • 69. Port send msg to Erlang Process Port External process receive {Port, {data, Info}} -> ... end A port can use a TCP, UDP, SSL socket, UNIX pipe, stdin/stdout or a custom transport Source: Ulf Wiger, Erlang Open Telecom Platform
  • 70. Communicating with External world In-proc Out-of-proc Custom Protocol Linked-in Drivers (.so) Ports (executable) Generic Protocol NIF (.so) C-Node
  • 71. How to adapt existing Ports to OSv? • the solution was to rewrite ports using OS processes as linked-in drivers using POSIX threads • With some exceptions
  • 72. Community Port of Erlang/OTP to OSv • I “ported” Erjang a year ago • I tried to port official Erlang/OTP – but quickly lost myself in the Erlang build system • Also reliance on lots of ports and shell scripts made me less optimistic • Cloudius is focused on POSIX & JVM, Erlang is not a priority • OSv mailing list discussed porting Erlang, but there was no progress
  • 73. Community Port of Erlang/OTP to OSv • People who helped to port Erlang to OSv: – Yao Zheng (https://github.com/bhuztez) – Bas Wegh – Zika L'Etrange • Yao Zheng also ported following projects: – Elixir – LFE – yaws
  • 74. The most important executables • erl – wrapper to erlexec • epmd – Erlang Port Mapping Daemon • heart – watchdog for BEAM (Erlang VM) • inet_gethost – native DNS resolver • osmon – mem_sup, disk_sup, cpu_sup • odbserver – ODBC connectivity Not everything ported yet.
  • 75. erl • erlang.so – OSv shared object executable wrapper to erlexec • pass vm.args and other CLI parameters to erlexec
  • 76. base: cloudius/osv-base cmdline: > /usr/lib64/erlang.so -env HOME / /etc/erlang/vm.args /etc/default/erlang/vm.args build: make files: /usr/lib64/erlang/: ROOTFS/usr/lib64/erlang/ /usr/lib64/erlang.so: erlang.so /etc/default/erlang/: default/ /etc/erlang/vm.args: default/vm.args
  • 77. $ git clone git@github.com:cloudius- systems/osv-apps.git $ cd osv-apps/erlang $ capstan run Created instance: erlang OSv v0.20 eth0: 192.168.122.15 sched_getaffinity() stubbed Eshell V6.2 (abort with ^G) 1> lists:reverse("Hello, World!"). "!dlroW ,olleH“ 2>
  • 78. epmd – Erlang Port Mapper Daemon • Option #1: use pure Erlang implementation of epmd: – https://github.com/bhuztez/noepmd – https://github.com/lemenkov/erlpmd • Option #2: run unmodified epmd as a POSIX thread, instead of a separate OS process • Option #2 was selected • Q: How epmd implemented in Erlang on RTOS like VxWorks or OSE?
  • 79. inet_gethost 1> httpc:request("http://google.com"). =ERROR REPORT==== 6-May-2015::13:43:58 === Error in process <0.79.0> with exit value: {unknown,[{erlang,open_port,[ {spawn,"inet_gethost 4"}, ...
  • 80. inet_gethost • Currently DNS resolving doesn’t work yet • Force to use pure-Erlang inet DNS resolver • It’s a default in Erlang on VxWorks & ENEA OSE RTOS erl -sname mynode -kernel inetrc "'./erl_inetrc'“ {edns, 0} http://www.erlang.org/doc/apps/erts/inet_cfg.html
  • 81. osmon • osmon ports where modified from standalone OS processes to linked-in drivers on POSIX thread – disk_sup – mem_sup – cpu_sup is disabled since OSv lacks required API
  • 82. OTP apps + BEAM + Unikernel OS • Erlang releases already may include Erlang VM • Adding a Unikernel OS to releases will make them truly self-contained!
  • 83. Development process • Currently Erlang OSv port is developed as a set of patch files in Osv apps repo: – https://github.com/cloudius-systems/osv-apps • Better way would be, to make it part of Erlang/OTP official repository (just like other OSes): – https://github.com/erlang/otp
  • 84. HIGH PERFORMANCE NETWORKING & I/O Why Use Unikernels?
  • 85. Long time before “Erlang The Movie”. Telephone Switches worked like … Source: Erlang The Movie
  • 86.
  • 87.
  • 88.
  • 89. Worker processes Supervisors Sockets / Ports mic - send msgs headphones – rcv msgs Supervisors
  • 90. Data Plane was handled by specialized HW or RTOS Source: Erlang The Movie
  • 91. Erlang for both Control Plane + Data Plane • In traditional OSes like Linux, IO & TCP/IP implemented via system calls, which has kernel overhead • Many unikernels have user-space TCP/IP stack • OSv implements Van Jacobsen’s Net Channels optimization • Optimized for NFV & SDN applications • It’s already possible with LING VM • And with non-POSIX APIs in OSv
  • 92. LING VM (ERLANG-ON-XEN) & ERLANG/OTP ON OSV Comparing LING VM vs Erlang on OSv
  • 93. LING VM Erlang/OTP on OSv Erlang VM Custom VM (latest update from OTP – Dec 2014) Open-source Ericsson’s Erlang/OTP 17.3 State Production-grade (3.5 years) Experimental (6 months) License Proprietary (Sleepycat) BSD 3-clause SMP (threads) - + Ports - - NIFs - + (possible) HiPE - - (possible) Disable GC + -
  • 94. LING VM Erlang/OTP on OSv Hypervisors Xen only KVM, Xen, VMware, VirtualBox Bare Metal Bare Metal RPi - Cloud support AWS AWS, Google Cloud Machine arch X86-64,ARM-32,MIPS X86-64, ARM-64 Min img size 9 MB 21 MB Boot time < 100 ms < 1 sec “Dockerfiles” railing Capstan Filesystem goofs (Plan9) ZFS Data Plane, NFV/SDN + possible via non- POSIX API?
  • 95. Takeaways • It seems that after Docker, Unikernels are going to be “The Next Big Thing” in the Cloud • Erlang community now has 2 options to choose from - try both • Try to port your Erlang app • Try to port your favorite open-source Erlang app • But only when it makes sense! • Download OSv and help porting standard Ericsson’s Erlang/OTP to Osv • https://github.com/erlang-on-osv
  • 96. Thank You! Now Q&A All images are taken from Google Image search and various other places on the Internet © Copyright of corresponding owners
  • 97. Thanks! • Thanks to everybody who gave me the feedback on this presentation: – Dor Laor – Tzach Livyatan – Yao Zheng – Dave Cottlehuber
  • 100. Old-style VMs peaked in 2010 Containers on the rise since 2013