Introduction


As a student/contributor of the 2024 Google Summer of Code (GSoC), I worked on the project,  Improving WebAssembly (WASM) support in Knative Functions. My journey began at the Open Source Summit, where I discovered GSoC and the exciting potential of Knative.

Before this experience, I had limited experience in WebAssembly, Knative, and the open-source community. However, through dedicated mentorship and hands-on development, I quickly built core knowledge of Knative and WebAssembly. By exploring the potential synergies of WebAssembly in Knative and identifying a few challenges, I was able to demonstrate how WebAssembly can be implemented within Knative Functions.

Journey: WebAssembly in Knative


Project Overview

In a single Knative Functions command, we want to abstract the entire process of building serverless functions using WebAssembly (WASM)— from compiling the source code into WASM, and containerization to deployment in Knative. This allows developers to focus solely on source code, while Knative Functions handles all underlying transformations, ensuring seamless execution across various platforms.

WebAssembly(WASM) has significant power for enhancing performance, security, and flexibility. By compiling the code written in various languages (C, C++, Rust, and Go) into a bytecode format, WebAssembly ensures consistent execution of applications across processor architectures (x86, ARM, RISC-V). Knative brings serverless capabilities into Kubernetes and Knative Functions simplifies source code management through automatic build and container deployment.

Integrating WASM into Knative is an exciting opportunity to enhance developers’ experience. WASM’s fast execution and platform-independent bytecode format expand Knative Functions’ capabilities, supporting a broader range of programming languages and processor architectures. However, as of today, there is no support for WASM in Knative Functions, which is why we focused on this project to push the boundaries of what’s currently possible.


Exploration 1: What is Knative?

Knative is an open-source project, incubated by the Cloud Native Computing Foundation (CNCF). It extends Kubernetes with serverless features for more dynamic and scalable applications.

What are the key Knative resources?