1 of 48

Supercharge Your Deployments with WASM

Rishit Dagli

OTC Catchup

@rishit_dagli

2 of 48

WebAssembly

rishit_dagli

3 of 48

Binary instruction format for a virtual machine

A format to define instructions that an appropriate interpreter can efficiently execute.

rishit_dagli

4 of 48

Designed as a compilation target

rishit_dagli

5 of 48

rishit_dagli

6 of 48

rishit_dagli

7 of 48

rishit_dagli

8 of 48

rishit_dagli

9 of 48

rishit_dagli

10 of 48

rishit_dagli

11 of 48

rishit_dagli

12 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines

rishit_dagli

13 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines

rishit_dagli

14 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable

rishit_dagli

15 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do

rishit_dagli

16 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do
    • do not create problems for other users and programs

rishit_dagli

17 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do
    • do not create problems for other users and programs

standard, platform-independent methods

to declare and apply

rishit_dagli

18 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do
    • do not create problems for other users and programs
    • standard, platform-independent methods to declare and apply
  • Binary compatibility

rishit_dagli

19 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do
    • do not create problems for other users and programs
    • standard, platform-independent methods to declare and apply
  • Binary compatibility

rishit_dagli

20 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do
    • do not create problems for other users and programs
    • standard, platform-independent methods to declare and apply
  • Binary compatibility
  • Aside: Some Nostalgia

rishit_dagli

21 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do
    • do not create problems for other users and programs
    • standard, platform-independent methods to declare and apply
  • Binary compatibility
  • Aside: System Interface
  • Aside: Some Nostalgia

rishit_dagli

22 of 48

System Interface

rishit_dagli

23 of 48

System Interface

rishit_dagli

24 of 48

System Interface

rishit_dagli

25 of 48

System Interface

rishit_dagli

26 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do
    • do not create problems for other users and programs
    • standard, platform-independent methods to declare and apply
  • Binary compatibility
  • Aside: System Interface
  • Aside: Some Nostalgia

rishit_dagli

27 of 48

Some Nostalgia

  • Emscripten was already emulating a system interface, POSIX, on the web
  • Implementation of libc had to be used with JS glue code which would be called in the browser and would talk to the kernel
  • Runtimes re-implement the JS glue code and emulate a browser
  • Not great

rishit_dagli

28 of 48

Wasm beyond the web

  • fast, scalable, secure way to run the same code across all machines
  • safe and portable, we want:
    • users and programs can do what they have the right to do
    • do not create problems for other users and programs
    • standard, platform-independent methods to declare and apply
  • Binary compatibility
  • Enter WebAssembly System interface (WASI)🎉

rishit_dagli

29 of 48

rishit_dagli

30 of 48

System interface

  • C gives you direct access to system resources
  • far too important for stability and security

rishit_dagli

31 of 48

Source: Lin Clark

rishit_dagli

32 of 48

WASI

  • modular set of standardized system interfaces
  • wasi-core, file-oriented approach, where you have system calls such as open, close, read, and write and everything else basically provides augmentations on top
  • host can choose what all system calls are allowed on a program-by-program basis
  • openat-like system call, needs file descriptors

rishit_dagli

33 of 48

WASI

rishit_dagli

34 of 48

Source: Lin Clark

rishit_dagli

35 of 48

rishit_dagli

36 of 48

Source: Lin Clark

rishit_dagli

37 of 48

Can you run Wasm workloads in Kubernetes?

@rishit_dagli

38 of 48

Slight

rishit_dagli

39 of 48

Slight

Containerd Wasm Shims

rishit_dagli

40 of 48

rishit_dagli

41 of 48

rishit_dagli

42 of 48

rishit_dagli

43 of 48

rishit_dagli

44 of 48

Linux and Wasm containers

  • Linux and Wasm Containers side-by-side
  • Not replace

rishit_dagli

45 of 48

rishit_dagli

46 of 48

Already out of time, if anyone is interested to explore further

bit.ly/otcdemo

rishit_dagli

47 of 48

Summary

Why WASM needs Kubernetes

  • All cloud providers have Kubernetes offerings
  • Good adoption in enterprises
  • Vibrant community
  • A huge ecosystem that can be used
  • Proven scaling solution

Why Kubernetes needs WASM

  • Tiny containers
  • Faster startup
  • Lower network traffic
  • Platform independent

rishit_dagli

48 of 48

Different areas for a model to optimize

Reach out to me!

Rishit Dagli

Twitter: @rishit_dagli

These slides: bit.ly/otcslides