Skip to content

Latest commit

 

History

History
85 lines (70 loc) · 2.59 KB

File metadata and controls

85 lines (70 loc) · 2.59 KB

Obelisk fibonacci benchmark suite

Running

Assuming Obelisk and just are installed. Launch Obelisk with Rust components downloaded from an OCI registry.

just serve-rs-oci

Compute fibo(10) sequentially 100 times:

obelisk execution submit -f .../fibow.fiboa -- 10 100

Compute fibo(10) in parallel 200 times:

obelisk execution submit -f .../fibow.fiboa-concurrent -- 10 200

Running with native JavaScript (no build step)

Launch Obelisk with native JS activity and workflow (no compilation required):

just serve-js-native

The activity/js-native/fibo.js and workflow/js-native/ files are loaded directly by Obelisk's built-in JS runtime.

Building WASM Components from source

If direnv and Nix are available:

cp .envrc-example .envrc
direnv allow

Otherwise install the following versions of dependencies used for development as described in dev-deps.txt.

Build all components:

just build

Then run Obelisk with one of the provided TOML files. List all available targets:

just --list
just serve-???

Note on fiboa-rs-spawn activity

This activity is configured as an exec activity that calls the native fibo binary. Build the binary first and set FIBO_EXE_PATH:

just build-fibo-binary
export FIBO_EXE_PATH="$(pwd)/target/x86_64-unknown-linux-musl/release_bin/fibo"

Running on Amazon Linux

sudo dnf update -y
sudo dnf install -y docker git
sudo systemctl start docker
sudo usermod -aG docker $USER

git clone https://github.com/obeli-sk/benchmark-fibo.git
cd benchmark-fibo

# If testing the `fiboa-rs-spawn` activity, the `fibo` native binary must be built.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo build -p fibo --profile=release_bin --target x86_64-unknown-linux-musl
export FIBO_DIR=/home/ec2-user/benchmark-fibo/target/x86_64-unknown-linux-musl/release_bin
export FIBO_EXE_PATH=$FIBO_DIR/fibo # only needed if running Obelisk directly without Docker

# Run Obelisk server
docker run --net=host --rm -it \
  -u $(id -u):$(id -g) \
  -v $(pwd):/config \
  -e 'OBELISK__WASM__CACHE_DIRECTORY=/cache/obelisk/wasm' \
  -v ~/.cache/obelisk/wasm:/cache/obelisk/wasm \
  -v $FIBO_DIR:/fibodir \
  -e 'FIBO_EXE_PATH=/fibodir/fibo' \
  getobelisk/obelisk \
  server run --deployment /config/obelisk-rs-oci.toml

# From within the container (docker exec..) run fibo(10) with a single iteration
obelisk execution submit -f .../fibow.fiboa -- 10 1