#s3 #amazon-s3 #wasi #wasm

bin+lib wasmio

WasmIO a S3 Implementation on steroid

13 releases

0.0.13 Feb 13, 2024
0.0.12 Feb 13, 2024

#1232 in Network programming

Download history 68/week @ 2024-02-08 34/week @ 2024-02-15 34/week @ 2024-02-22 26/week @ 2024-02-29 3/week @ 2024-03-07 23/week @ 2024-03-14 28/week @ 2024-03-28 13/week @ 2024-04-04 132/week @ 2024-04-18

173 downloads per month

MIT/Apache

160KB
3K SLoC

wasmio

S3 Backed Server for Wasmer

 ▄     ▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄   ▄▄ ▄▄▄ ▄▄▄▄▄▄▄ 
█ █ ▄ █ █      █       █  █▄█  █   █       █
█ ██ ██ █  ▄   █  ▄▄▄▄▄█       █   █   ▄   █
█       █ █▄█  █ █▄▄▄▄▄█       █   █  █ █  █
█       █      █▄▄▄▄▄  █       █   █  █▄█  █
█   ▄   █  ▄   █▄▄▄▄▄█ █ ██▄██ █   █       █
█▄▄█ █▄▄█▄█ █▄▄█▄▄▄▄▄▄▄█▄█   █▄█▄▄▄█▄▄▄▄▄▄▄█

release Crates.io version dependency status PRs Welcome

Idea

Wasmer allow file storage with mounted volumes, with this kind of backend we'll be able to implement applications based on a Storage.

We'll implement a S3 Server backed by a Volume from Wasmer.

Development

You'll need to install wasmer and also cargo-wasix.

Side note if you install wasmer on a Mac OS you'll need to add this to the .bash_profile as it seems wasmer add it in the .bashrc instead.

export WASMER_DIR="/Users/wizard/.wasmer"
[ -s "$WASMER_DIR/wasmer.sh" ] && source "$WASMER_DIR/wasmer.sh"

To run the solution locally, you can use this:

Standard

RUST_LOG=info CONFIG_FILE_LOCATION=./public/config.local.toml cargo run --package wasmio RUST_LOG=info

Wasmer

cargo wasix build --package wasmio
wasmer run . \
  --net \
  --enable-threads \
  --env CONFIG_FILE_LOCATION=/public/config.local.toml \
  --env RUST_LOG=info \
  --mapdir /public:$(pwd)/public

Performance

Right now, we are using a simple JSON to store the data, which is not efficient for files based storage. This is just an experiment on the whole storage and wasmer.

To have better performance, the storage layer should be reworked to better use Files APIs (with Seek for instance, a better format to store data, we don't need JSON).

Benchmarks

(Integrate bencher here.)

E2E Tests

(Integrate bencher here.)

Dependencies

~18–29MB
~428K SLoC