The author of this article: Michael Yuan, WasmEdge Maintainer

In July 2021, the Computer Association Programming Language Special Interest Group Programming Language Software Award ) to WebAssembly, highly affirming WebAssembly as "the first web browser since JavaScript A new language widely adopted in China”. This year also marked the explosive growth of WebAssembly outside of web browsers, especially in server-side and cloud-native environments.

Until 2021, cloud native computing Foundation has officially received at least three WebAssembly projects, including WasmEdge Runtime , a cloud native WebAssembly Runtime; wasmCloud , a WebAssembly application framework; Krustlet , a pods in Kubernetes Tools for running WebAssembly programs in. At the same time, many existing CNCF projects began to adopt WebAssembly.

Due to the growing interest of the cloud native community in WebAssembly, KubeCon+CloudNativeCon Cloud Native Wasm Day in Los Angeles in October. More than 300 developers registered and paid to participate in the one-day event. I (referring to the author) is a member of the planning committee of the event, and I personally participated in the event.

The event started with the keynote speech Ralph Squillace Microsoft Azure and Cosmonic of Liam Randall Squillace and Randall are both cloud computing veterans. Their keynote speech discussed the evolution of cloud computing architecture and provided a background introduction to the rise of WebAssembly as a cloud-native runtime.

WebAssembly is a lightweight, fast, safe and multilingual function "container". WebAssembly will introduce the cloud-native programming model developed by Kubernetes and Docker into the field of edge computing and microservices from large data centers.

From this conference, it can be clearly seen that cloud-native WebAssembly applications have been adopted by enterprises of all sizes. With the advent of applications, we have also seen a booming ecosystem of frameworks, tools, and runtime.

Kubernetes

Since Kubernetes has become the de facto "control panel" for all cloud-native applications, WebAssembly must be supported by Kubernetes to be truly adopted. The server-side cloud-native WebAssembly not only requires WASI to access operating system functions, but also needs to be integrated with Kubernetes. We need to run WebAssembly workloads side-by-side with other containers (such as containerd, Docker, and cri-o) in a Kubernetes cluster. At this conference, we saw two leading methods.

Krustlet project runs the WebAssembly project from the Kubernetes pod. At the Wasm day conference, we saw several demos using krustlet. At the same time, during the conference, Microsoft Azure AKS announced a WebAssembly service

WasmEdge 's crunw project is another way. It is a direct replacement for the Kubernetes container runtime (such as runc and crun). crunw runtime can automatically detect whether the container image is used for WasmEdge or containerd/Docker, and then start and manage the corresponding runtime/container. It makes WebAssembly programs a first-class citizen in the Kubernetes cluster.

WebAssembly programs are more than just workloads managed and controlled by Kubernetes. They can also extend Kubernetes itself. Rafael Fernández López of SUSE introduced us to the Kubewarden project, which provides a strategy engine based on WebAssembly for Kubernetes.

Application framework

The application framework is built on Kubernetes to provide common services for applications. A good example is Dapr , which was created by Microsoft and will soon become a CNCF incubation project (at the time of translation of this article, Dapr is already a CNCF incubation project). Dapr uses the sidecar model to provide common services for microservice applications attached to these sidecars, such as service discovery and invocation, elastic retry, logging and tracking, monitoring, secret storage, connection security, etc. These sidecar applications (microservices) can be managed by Kubernetes. Dapr now supports the WebAssembly-based sidecar application .

wasmCloud The project is an actor-based application framework designed specifically for WebAssembly. Stuart Harris and Aayush Attri from Red Badger explained how they used the wasmCloud cluster managed by Kubernetes to implement large-scale applications inside European banks.

The service grid is built on the application framework. They provide additional functions, such as traffic routing and splitting through proxies. early adopter based on WebAssembly's service mesh extension. Ant Financial's MOSN is a service grid that can manage a large cluster of more than 200,000 servers.

Jason Song of the MOSN team gave a lightning talk at the meeting, discussing running WebAssembly functions in the service grid to replace traditional containers. MOSN's proxy supports the proxy-wasm specification as an extension mechanism. MOSN's sidecar framework, called Layotto , supports microservices written in WebAssembly. Jason demonstrated live how to use Kubernetes to deploy and manage WebAssembly functions in MOSN and Layotto in e-commerce applications.

Embedded functions in SaaS

So far, we have understood the application of WebAssembly in cloud native infrastructure. What about business logic applications? WebAssembly makes it easy for business applications to support third-party plug-ins or extensions. Centrally hosted cloud-native applications (such as SaaS) can use WebAssembly runtime to safely and effectively execute any user-submitted code function.

Suborbital clearly explains why responsive embedded functions are more suitable for extending and customizing SaaS than traditional webhooks or "local integration" (ie custom templates). Suborbital is an application framework that can easily embed WebAssembly functions into SaaS.

Shopify is a pioneer in using embedded WebAssembly functions to extend and customize related SaaS. Obviously, developers really want to use JavaScript instead of Rust or C/C++ to write these functions. Saúl Cabrera of Shopify gave a presentation on how to run and optimize JavaScript programs on WebAssembly.

In this category, we see WebAssembly runtimes such as WasmEdge, which support advanced JavaScript features , such as ES6 module , async network , and /JavaScript interaction.

Bailey Hayes and Carl Sverre talked about how SingleStore uses WebAssembly to execute user-defined functions embedded in cloud databases. It allows data storage and calculations to stay in close contact and improve efficiency. In their presentation, the team showed how to use AI models to perform real-time sentiment analysis on large data sets.

As an early adopter, the team also participated in standardization work and proposed the WASI-data specification to support the standard two-way communication protocol between the database and the WebAssembly runtime.

AI and the Internet of Things

As Liam Randall discussed in his keynote speech, the biggest application opportunity of WebAssembly may be at the edge, on the edge network and edge devices.

Dan Mihai Dumitriu introduced how Midokura, Sony's Internet of Things application division, deployed WebAssembly applications on sensor devices. WebAssembly has a small footprint and high performance, allowing it to run as a secure sandbox for user applications on small devices. Kate Goldenring from Microsoft and Rodrigo Farias Rodrigues Lemos from Federal University of Pernambuco showed Akri , a WebAssembly application running Krustlet to discover IoT devices and provide them as resources to a Kubernetes cluster.

In fact, CNCF now has at least 3 "K8s used on the edge" projects KubeEdge , SuperEdge and OpenYurt . Together with the K8s just mentioned, the future of WebAssembly on IoT devices can be expected.

An important application on today's edge networks is AI reasoning. Light and fast WebAssembly runtimes can make AI inference calculations closer to sensors and data sources on the edge. There are two speeches at the conference that are particularly related to AI reasoning.

Shivay Lamba from Layer5 and Mritunjay Sharma from Hackerrank talked about how to use WasmEdge's Tensorflow and Tensorflow Lite API extensions for image recognition, which can recognize each image in milliseconds. This API is available to Rust and JavaScript developers.

Radu Matei from Microsoft discussed the WASI-NN specification, which provides a standard API that can incorporate any AI inference library into WebAssembly. The WasmEdge Tensorflow extension is being adjusted to use WASI-NN.

Ecological innovation

With the increase in WebAssembly applications, developers have participated in improving WebAssembly itself and related tools. There were two noticeable WebAssembly ecological developments at the : 16184ac516a2f9 Bindle and Grain .

Bindle provides a package management system for WebAssembly modules and artifacts. As we have seen from the success of NPM, Docker Hub, Go, and Rust crate, package management can promote collaboration and enable developers to develop based on each other's work. Matt Butcher from Microsoft Azure and Taylor Thomas from Cosmonic gave talks on how Bindle was designed and how to use it. We look forward to more adoption of this important technology.

Grain is a WebAssembly-first programming language. Statically typed and compiled programming languages can make the most effective use of the lightweight runtime of WebAssembly. However, statically typed languages such as Rust and C/C++ are not easy for beginners. Oscar Spencer from the Grain project discussed how Grain is designed as an easy-to-use programming language that can be compiled into efficient WebAssembly bytecode. This project is still in its early stages, but it has great potential.

Look to the future

2021 is the first year of cloud-native Wasm applications taking off. With WebAssembly being included in almost all leading cloud-native projects, we can see that in the coming year, WebAssembly applications will generally be deployed on the cloud. What are you waiting for?


WASM中文社区
169 声望162 粉丝