Serverside WebAssembly hyped at Kubecon North America: tooling for Docker and Dapr integration introduced

Serverside WebAssembly hyped at Kubecon North America: tooling for Docker and Dapr integration introduced

Kubecon has kicked off, both virtual and in-person in Detroit, Michigan, including a Cloud Native Wasm (WebAssmbly) Day hosted by CNCF (Cloud Native Computing Foundation).

The tooling for WasmEdge has moved forward with the introduction of Docker integration. “Developers can build, run, and manage WasmEdge applications the same way they manage containers in the Docker toolchain,” according to today’s release.

There is also a new Wasm-based SDK for Dapr (Distributed Application Runtime), the Microsoft-sponsored “sidecar” API for microservices.

Why Wasm and Kubernetes? Wasm was created as a way to run native code in the browser in a safe manner, both for performance and to ease porting of code written in other languages – including C, C++, Rust and Go – to web applications. The notion of high performance, sandboxed code is not just applicable to web applications though, but also useful server-side.

Although this echoes in some ways what runtimes like the Java Virtual Machine (JVM) offer, a big difference is that Wasm comes with less overhead and more direct multi-language support.

WasmEdge is a CNCF sandbox project to create an extensible Wasm runtime for serverless applications, embedded and edge functions. The project presents itself as an alternative to containers in some scenarios, and its site observes that “a WasmEdge app could take 1/100 of the size of a similar Linux container app,” as well as starting up 100 times faster. Kubernetes is a container orchestration technology, and Wasm can support the OCI (Open Container Initiative) runtime via, for example, the crun project which both conforms to OCI and can be enabled to run WasmEdge.

“The goal is to load and run WebAssembly OCI images side by side with Linux OCI images (e.g., today’s Docker containers) across the entire Kubernetes stack,” explains the documentation.

Docker CTO Justin Cormack spoke at Wasm Day (via video) about the potential of Wasm for running applications “that don’t need a lot of runtime or operating system.” He also quoted Docker founder Solomon Hykes who said in 2019 that “if WASM+WASI existed in 2008 we wouldn’t have needed to create Docker … WebAssembly on the server is the future of computing.” He continued, saying, “imagine a future where Docker runs Linux containers, windows containers and wasm containers side by side,” a future which now seems close to reality.

Docker founder Solomon Hykes on Wasm, in 2019

At Kubecon, a small CNCF Wasm survey showed that serverless and edge are the top use case for Wasm among respondents, ahead of web development, however, this was too small a survey to represent the entirety of Wasm developers. Over 60% of respondents said that porting to Wasm improved performance, and there is enthusiasm for what Wasm can offer in sandboxing, write once run everywhere, native performance, and developer productivity.

That said, the survey also showed obstacles to Wasm development, including lack of tooling (the top complaint), lack of clear standards, and skills shortage. There is also scepticism, with 25% of respondents citing “lack of clear use cases” as a barrier to development.