Skip to content

Shark/wasm-workflows-plugin

Repository files navigation

Issues MIT License


wasm-workflows-plugin

Runs WebAssembly in your Argo Workflows! 🚀
Find out why that's awesome »

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

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:

  • ✈️ Portability

    You 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.

    Read more about the benefits here.

Even though Wasm is a new technology in Cloud Native, incorporating Wasm into your workflow is seamless:

Built with

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:

Getting Started

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  \ (/
          '_   -   _'
          / '-----' \

Module Development

Creating a new Wasm module for use with Argo Workflows is described in the Module Development Guide.

Advanced Features

  • 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.

    Read more in the Distributed Execution Guide.

Roadmap

We manage our roadmap on the Developing wasm-workflows-plugin GitHub project board.

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Felix Seidel – @sh4rkfelix@seidel.me

Project Link: https://github.com/Shark/wasm-workflows-plugin

Acknowledgements

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!