Skip to content

Latest commit

 

History

History
93 lines (69 loc) · 3.08 KB

README.md

File metadata and controls

93 lines (69 loc) · 3.08 KB

Example Applications for Faasm

This repository contains a list of applications and libraries that have been cross-compiled to WebAssembly for their use with Faasm.

WARNING: examples listed here have worked at some point in time. The fact that they are listed here does not mean that they still run, or that they are supported in any way.

Quick Start

To cross-compile any of the supported applications for its usage with Faasm, you must first start the build client:

source ./bin/workon.sh
inv cli build

Inside the build client, you can list the available tasks, and cross-compile any of the supported libraries/applications:

inv -l
inv lammps [--clean]

You can access the generated WASM file both from inside and outside the build client container.

# Outside the container
ls ./dev/faasm-local/wasm

# For LAMMPS
file ./dev/faasm-local/wasm/lammps/main/function.wasm

This WASM file is ready to be uploaded to a Faasm cluster using the HTTP API.

List of examples

Project Name WAVM WAMR WAMR + SGX
FFmpeg
Kernels
LAMMPS
libpng
ImageMagick
LULESH
PolyBench/C
Tensorflow

Bumping C++, Python, or Faasm's version

This repository depends on Faasm's toolchain repos (C++, and Python) and the Faasm runtime. As a consequence, it is versioned with the versions of the previous.

If you want to upgrade the Python or C++ tag, you must update the submodule and the files that track either version. You can do:

cd cpp
git pull origin main
cd ..
inv git.bump cpp

Similarly, for Faasm you can just do:

inv git.bump faasm [--ver=<specific_version>]

Then, tag the new version and re-build the docker images:

inv git.tag
inv docker.build -c build -c run --nocache --push

Adding a new application

To add a new application, you first need to cross-compile it to WebAssembly. You can check the tasks/ folder for examples of how we do it for existing applications. Most importantly, you will have to inidicate the right sysroot, and pass the environment variables that we read from faasmtools.

Once the application is cross-compiled, you must make it run with Faasm. The tests in GHA only test integration with the WAVM runtime in Faasm, but if you need to pick another one for a very specific reason, it can also be tested.