Crates.io | wasmio |
lib.rs | wasmio |
version | 0.0.13 |
source | src |
created_at | 2024-02-09 20:21:00.686298 |
updated_at | 2024-02-13 17:59:23.907897 |
description | WasmIO a S3 Implementation on steroid |
homepage | |
repository | https://github.com/miaxos/wasmio/ |
max_upload_size | |
id | 1134302 |
size | 167,608 |
S3 Backed Server for Wasmer
▄ ▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄▄ ▄▄▄▄▄▄▄
█ █ ▄ █ █ █ █ █▄█ █ █ █
█ ██ ██ █ ▄ █ ▄▄▄▄▄█ █ █ ▄ █
█ █ █▄█ █ █▄▄▄▄▄█ █ █ █ █ █
█ █ █▄▄▄▄▄ █ █ █ █▄█ █
█ ▄ █ ▄ █▄▄▄▄▄█ █ ██▄██ █ █ █
█▄▄█ █▄▄█▄█ █▄▄█▄▄▄▄▄▄▄█▄█ █▄█▄▄▄█▄▄▄▄▄▄▄█
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.
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 seemswasmer
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:
RUST_LOG=info CONFIG_FILE_LOCATION=./public/config.local.toml cargo run --package wasmio RUST_LOG=info
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
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).
(Integrate bencher here.)
(Integrate bencher here.)