Runs WebAssembly in your Argo Workflows! 🚀
Find out why that's awesome »
Table of Contents
This is an Executor Plugin for Argo Workflows that runs WebAssembly modules!
These are the benefits of using Wasm instead of Docker containers in your workflows:
-
✈️ PortabilityYou must build Docker containers individually for every CPU architecture. Working on a Mac with Apple Silicon, but your Kubernetes nodes run on Intel CPUs? You'll cross-compile your container images all day.
Wasm modules are architecture-independent by design. Build once, run everywhere.
-
🏃 Performance
It takes a while for Kubernetes to spin up a container and run your code. The process has quite a few steps: pulling a container image, often 100s of megabytes in size, creating namespaces and virtual network interfaces. Starting the runtime for interpreted languages takes a while, too.
Wasm does not emulate a complete operating system as containers do. They are a much simpler abstraction. This means that a module executes in a matter of milliseconds.
-
🔒 Security
Securing a container runtime is a challenge because containers are vulnerable in many ways. Containers are powerful by design.
Wasm is a minimal runtime that is just powerful enough to run a program. Rather than allowing everything by default, its security works more like on a smartphone, where you give apps permissions explicitly.
Even though Wasm is a new technology in Cloud Native, incorporating Wasm into your workflow is seamless:
-
Containers and Wasm modules co-exist in the same workflow. You can pass artifacts and parameters between them.
-
We have included ready-to-use templates, examples, and even some useful modules for running off-the-shelf.
Open Source software stands on the shoulders of giants. It wouldn't have been possible to build this tool without the authors of these projects:
- Rust is used to implement the Argo Executor Plugin API, pull and execute Wasm modules
- Axum is the Rust web framework to handle RPC calls
- Wasmtime is the WebAssembly Virtual Machine with WASI support
- oci-distribution allows the tool to pull Wasm modules from OCI registries
- Best README Template
You must install Argo Workflows (v3.3.0 or newer) and the argo
CLI. kubectl
needs access to your cluster.
Install the plugin:
Go to the Releases page and follow the descriptions for installing the plugin through the ConfigMap.
Submit your first Wasm workflow:
Run argo submit --watch https://raw.githubusercontent.com/Shark/wasm-workflows-plugin/main/wasm-modules/examples/ferris-says/workflow.yaml
.
Add --namespace XYZ
if your Argo installation is not running in the default namespace.
The workflow produces an output parameter text
with a cool message:
___________________
/ "Hello World from \
\ WebAssembly" /
-------------------
\
\
_~^~^~_
\) / o o \ (/
'_ - _'
/ '-----' \
Creating a new Wasm module for use with Argo Workflows is described in the Module Development Guide.
-
Distributed Execution
The plugin will run Wasm modules within the plugin process by default. This is the recommended mode because it's easy to set up and is powerful enough for most scenarios.
The distributed mode creates pods for Wasm modules in a workflow task, much like Argo does for Docker containers.
We manage our roadmap on the Developing wasm-workflows-plugin GitHub project board.
Contributions make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Felix Seidel – @sh4rk – felix@seidel.me
Project Link: https://github.com/Shark/wasm-workflows-plugin
This is a research project as part of my Master Thesis at the Chair of Prof. Dr. Holger Karl at Hasso Plattner Institute, the University of Potsdam (Germany). Thank you for the ongoing support of my thesis!