$30 off During Our Annual Pro Sale. View Details »

Cloud-Native vNext: WebAssembly in Azure and AKS

Cloud-Native vNext: WebAssembly in Azure and AKS

WebAssembly is the next big thing on the server and in the cloud. With WebAssembly we can drive hardware utilization and reduce cloud spendings dramatically. In Azure we can run WebAssembly workloads in Azure Kubernetes Service (AKS) and combine both: Containers and WebAssembly. Join this talk by Azure MVP and cloud-native enthusiast Thorsten Hans to get those questions answered. It’s time to embrace the platform of the future.

Thorsten Hans

December 13, 2022
Tweet

More Decks by Thorsten Hans

Other Decks in Technology

Transcript

  1. Cloud-Native vNext
    WebAssembly in Azure & AKS
    Thorsten Hans
    @ThorstenHans
    Cloud-Native Consultant

    View Slide

  2. Consultant @ Thinktecture
    #Azure #Kubernetes
    #CloudNative #Docker
    [email protected]
    thinktecture.com
    thorsten-hans.com
    @ThorstenHans
    Microsoft MVP | Docker Captain
    Thorsten Hans

    View Slide

  3. • Introduction
    • Let’s meet Fermyon Spin
    • WebAssembly in Azure with AKS
    • Conclusion
    Agenda

    View Slide

  4. • Introduction
    • Let’s meet Fermyon Spin
    • WebAssembly in Azure with AKS
    • Conclusion
    Agenda

    View Slide

  5. Key Concepts
    • WebAssembly (Wasm)
    • WebAssembly System Interface (WASI)
    • WebAssembly Gateway Interface (WAGI)
    Introduction

    View Slide

  6. WebAssembly (Wasm)
    WebAssembly (abbreviated Wasm) is a binary instruction format for a
    stack-based virtual machine. Wasm is designed as a portable
    compilation target for programming languages, enabling deployment on
    the web for client and server applications.
    Introduction
    https://webassembly.org/

    View Slide

  7. WebAssembly (Wasm)
    Introduction
    fast
    Near native execution performance, leveraging
    available hardware capabilities
    safe
    Wasm is a memory-safe and sandboxed execution
    environment
    portable
    All major browsers support Wasm & multiple server
    runtimes are available
    open
    WebAssembly Text Format .wat can be used to
    learn, read ,debug Wasm

    View Slide

  8. WebAssembly System Interface (WASI)
    • A standard engine-independent non-web system-oriented API for WebAssembly
    • WASI is here to standardize how Wasm is executed outside of the browser
    • Wasm uses platform agnostic APIs provided by WASI
    • WASI interacts with platform specific APIs
    • WASI aligns with the Wasm promise of being a secure sandbox
    • As developer, WASI is your compilation target cargo build --target wasm32-wasi
    Introduction

    View Slide

  9. Portability
    Introduction
    https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

    View Slide

  10. Security – Before WASI
    Introduction
    https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

    View Slide

  11. Security – Before WASI
    Introduction
    https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

    View Slide

  12. Security – Before WASI
    Introduction
    https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

    View Slide

  13. Security – With WASI
    Introduction
    https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

    View Slide

  14. WebAssembly Gateway Interface (WAGI)
    • Use WebAssembly modules as HTTP handlers
    • Think of a hyper-focused microservices runtime
    • Comman Gateway Interface (CGI) implementation
    • HTTP headers become environment variables
    • HTTP payloads are piped to stdin
    • HTTP responses must be written to stdout
    Introduction

    View Slide

  15. • Introduction
    • Let’s meet Fermyon Spin
    • WebAssembly in Azure with AKS
    • Conclusion
    Agenda

    View Slide

  16. • Introduction
    • Let’s meet Fermyon Spin
    • WebAssembly in Azure with AKS
    • Conclusion
    Agenda

    View Slide

  17. • Fermyon Technologies (founded in November 2021)
    • https://www.fermyon.com/
    • ”Pioneering the next wave of cloud computing”
    • Many familiar faces that you may know from Deis Labs (aquired by Microsoft in April 2017)
    • Fermyon is all about WebAssembly on the server and in the cloud
    Who is Fermyon

    View Slide

  18. • Spin is a runtime that hosts and instantiates Wasm modules when triggers are invoked
    • It leverages the WebAsssembly Component Model
    • Spin is an SDK
    • That provides APIs for common scenarios like outbound HTTP, Redis, PostgreSQL
    • Spin is a developer toolchain
    • For crafting, running, and deploying your applications
    • Spin is language agnostic
    • You can use any language that compiles to wasm32_wasi
    What is Spin

    View Slide

  19. Hands-On Fermyon Spin
    - Let’s get started with Spin
    Demo

    View Slide

  20. • Introduction
    • Let’s meet Fermyon Spin
    • WebAssembly in Azure with AKS
    • Conclusion
    Agenda

    View Slide

  21. • Introduction
    • Let’s meet Fermyon Spin
    • WebAssembly in Azure with AKS
    • Conclusion
    Agenda

    View Slide

  22. • Microsoft (especially the OSS team in the Azure Division) is already adopting it in AKS
    • https://www.infoworld.com/article/3681853/azure-kubernetes-doubles-down-on-webassembly.html
    • Previously Krustlet (Kubelet written in Rust 🦀) was used to run WebAssembly workloads
    • Microsoft announced the preview of their new WASM story at Ignite 2022
    • Dedicated AKS Node Pools support wasm32_wasi leveraging runwasi
    • runwasi is used in conjunction with containerd-shims for SpiderLightning (slight) and Spin 🎉
    WebAssembly in Azure and AKS

    View Slide

  23. • TBH: its still early
    • Plain Container Image is used for distribution
    • As of today, only simple workloads are supported
    WebAssembly in Azure and AKS

    View Slide

  24. WebAssembly in AKS with Spin
    - Distributing your Spin applications
    - Run a Spin application in AKS
    Demo

    View Slide

  25. • Introduction
    • Let’s meet Fermyon Spin
    • WebAssembly in Azure with AKS
    • Conclusion
    Agenda

    View Slide

  26. • Introduction
    • Let’s meet Fermyon Spin
    • WebAssembly in Azure with AKS
    • Conclusion
    Agenda

    View Slide

  27. • The combination of Containers & WASM will become the default
    • The imapact of Wasm will be way bigger for backend devs compared to frontend devs
    • Running Wasm workloads in the cloud will allow better resource utilization
    • Strict sandboxing (WASI) will enahnce overall platform security and robustness
    • It’s still early – especially in managed Kubernetes (where we’ve limited control)
    • Spin and Fermyon Cloud (or Platform) currently drive developer adoption
    Conclusion

    View Slide

  28. Thanks for your attention
    @ThorstenHans

    View Slide