Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ env:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Install OpenVINO
- name: Install OpenVINO
uses: abrown/install-openvino-action@v8
uses: abrown/install-openvino-action@v9

- name: Build Wasmtime + wasi-nn
run: |
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
rustup target add wasm32-unknown-unknown
git clone https://github.com/bytecodealliance/wasmtime --branch v16.0.0 --depth 1 --recursive
cd wasmtime
Expand Down Expand Up @@ -52,13 +52,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup target add wasm32-wasi
- run: rustup target add wasm32-wasip1
- name: Run tests on native architecture
working-directory: rust
run: cargo test
- name: Build on wasm32-wasi
- name: Build on wasm32-wasip1
working-directory: rust
run: cargo build --target=wasm32-wasi
run: cargo build --target=wasm32-wasip1
- name: Check dry-run publish to crates.io
working-directory: rust
run: cargo publish --dry-run
Expand All @@ -68,10 +68,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup target add wasm32-wasi
- name: Build for wasm32-wasi
- run: rustup target add wasm32-wasip1
- name: Build for wasm32-wasip1
working-directory: image2tensor
run: cargo build --target=wasm32-wasi
run: cargo build --target=wasm32-wasip1
- name: Check dry-run publish to crates.io
working-directory: image2tensor
run: cargo publish --dry-run
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ else
echo "The first argument: $1"
FIXTURE=https://github.com/intel/openvino-rs/raw/main/crates/openvino/tests/fixtures/mobilenet
pushd $WASI_NN_DIR/rust/
cargo build --release --target=wasm32-wasi
cargo build --release --target=wasm32-wasip1
mkdir -p $WASI_NN_DIR/rust/examples/classification-example/build
RUST_BUILD_DIR=$(realpath $WASI_NN_DIR/rust/examples/classification-example/build/)
cp -rn examples/images $RUST_BUILD_DIR
pushd examples/classification-example
cargo build --release --target=wasm32-wasi
cp target/wasm32-wasi/release/wasi-nn-example.wasm $RUST_BUILD_DIR
cargo build --release --target=wasm32-wasip1
cp target/wasm32-wasip1/release/wasi-nn-example.wasm $RUST_BUILD_DIR
pushd build
wget --no-clobber --directory-prefix=$RUST_BUILD_DIR $FIXTURE/mobilenet.bin
wget --no-clobber --directory-prefix=$RUST_BUILD_DIR $FIXTURE/mobilenet.xml
Expand Down
2 changes: 1 addition & 1 deletion image2tensor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ image = { version = "0.24", default-features = false, features = [
] }

[package.metadata.docs.rs]
targets = ["wasm32-wasi"]
targets = ["wasm32-wasip1"]
2 changes: 1 addition & 1 deletion image2tensor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ primarily for the `wasm32-wasi` target.
### Build

```console
$ cargo build --target wasm32-wasi
$ cargo build --target wasm32-wasip1
```

### Examples
Expand Down
4 changes: 2 additions & 2 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish = true
exclude = ["examples", "scripts", "Cargo.lock"]

[package.metadata.docs.rs]
targets = ["wasm32-wasi"]
targets = ["wasm32-wasip1"]

[dependencies]
wit-bindgen = "0.22"
Expand Down
15 changes: 2 additions & 13 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ functionality from WebAssembly.

3. Compile the application to WebAssembly:
```shell script
cargo build --target=wasm32-wasi
cargo build --target=wasm32-wasip1
```

4. Run the generated WebAssembly in a runtime supporting [wasi-nn], e.g., [Wasmtime].
Expand All @@ -42,18 +42,7 @@ functionality from WebAssembly.

### Build

To build this crate from source, use: `cargo build --target wasm32-wasi`.


### Generation

This crate contains code ([`src/generated.rs`](src/generated.rs)) generated by
[`witx-bindgen`](https://github.com/bytecodealliance/wasi/tree/main/crates/witx-bindgen). To
regenerate this code, run the following script:

```console
$ scripts/regenerate-bindings-from-witx.sh
```
To build this crate from source, use: `cargo build --target wasm32-wasip1`.


### Examples
Expand Down
50 changes: 0 additions & 50 deletions rust/scripts/regenerate-bindings-from-witx.sh

This file was deleted.