-
Notifications
You must be signed in to change notification settings - Fork 6
159 lines (135 loc) · 5.52 KB
/
latest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Continuous integration
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
push:
paths-ignore:
- ".github/workflows/release.yml"
- "**/*.md"
- "install_zh.sh"
pull_request:
paths-ignore:
- ".github/workflows/release.yml"
- "**/*.md"
- "install_zh.sh"
jobs:
build_ubuntu:
name: Ubuntu
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
rust: [1.78, 1.77, 1.76]
container:
image: wasmedge/wasmedge:ubuntu-build-clang
steps:
- name: Checkout WasmEdge RustSDK Examples
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout WasmEdge Runtime
uses: actions/checkout@v3
with:
repository: WasmEdge/WasmEdge
path: WasmEdge
- name: Build WasmEdge with Release mode
working-directory: WasmEdge
run: |
apt update
apt install -y software-properties-common libboost-all-dev llvm-15-dev liblld-15-dev ninja-build curl wget unzip
# deploy libtorch
export PYTORCH_VERSION="1.8.2"
curl -s -L -O --remote-name-all https://download.pytorch.org/libtorch/lts/1.8/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip
unzip -q "libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/libtorch/lib
export Torch_DIR=$(pwd)/libtorch
# build and deploy wasmedge
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_PROCESS=On -DWASMEDGE_PLUGIN_WASI_NN_BACKEND="PyTorch" .
cmake --build build
cmake --install build
ldconfig
- name: Install Rust-stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
targets: wasm32-wasi
- name: async-wasi
working-directory: async-wasi
run: |
cargo build -p wasm-app --target wasm32-wasi --release
cargo run -p run-wasm-app -- ../target/wasm32-wasi/release/wasm-app.wasm
- name: async-wasi-socket
working-directory: async-wasi-socket-addr
run: |
cargo build -p socket-addr --target wasm32-wasi --release
cargo run -p main-app -- ../target/wasm32-wasi/release/socket-addr.wasm
- name: call-wasm-lib-from-host example
working-directory: call-wasm-lib-from-host
run: |
cargo build -p wasm-lib --target wasm32-wasi --release
cargo run -p call-wasm-lib -- ../target/wasm32-wasi/release/wasm_lib.wasm 5
- name: call-wasm-lib-with-external-deps
working-directory: call-wasm-lib-with-external-deps
run: |
cargo build -p call-host --target wasm32-wasi --release
cargo run -p host-app -- ../target/wasm32-wasi/release/call_host.wasm 2 3
- name: define-async-host-func
working-directory: define-async-host-func
run: |
cargo run
- name: define-host-func
working-directory: define-host-func
run: |
cargo run
- name: load-module-in-module
working-directory: load-module-in-module
run: |
cargo build -p alice-wasm-lib --target wasm32-wasi --release
cargo build -p bob-wasm-lib --target wasm32-wasi --release
cargo run -p multi-module-host-app -- 2 3
- name: manipulate-linear-memory
working-directory: manipulate-linear-memory
run: |
cargo run
- name: multi-threaded-parallel
if: false
working-directory: multi-threaded-parallel
run: |
cd mandelbrot-c
wget https://ziglang.org/download/0.10.1/zig-linux-x86_64-0.10.1.tar.xz
tar -xf zig-linux-x86_64-0.10.1.tar.xz
./zig-linux-x86_64-0.10.1/zig build-obj -O ReleaseSmall -target wasm32-wasi mandelbrot.c
wasm-ld-15 --no-entry mandelbrot.o -o mandelbrot.wasm --import-memory --export-all --shared-memory --features=mutable-globals,atomics,bulk-memory
cd ..
cargo run -p run-mandelbrot-in-parallel -- ./mandelbrot-c/mandelbrot.wasm
- name: object-detection-via-wasinn
working-directory: object-detection-via-wasinn
run: |
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(pwd)/../WasmEdge/libtorch/lib
export Torch_DIR=$(pwd)/../WasmEdge/libtorch
cargo run -- .:. wasmedge-wasinn-example-mobilenet-image.wasm mobilenet.pt input.jpg
- name: run-wasm-app-from-host
working-directory: run-wasm-app-from-host
run: |
cargo build -p sync-wasm-app --target wasm32-wasi --release
cargo run -p sync-run-wasm-app -- ../target/wasm32-wasi/release/sync-wasm-app.wasm
- name: run-wasm-func-in-aot-mode
working-directory: run-wasm-func-in-aot-mode
run: |
cargo run
- name: say_hello
working-directory: say_hello
run: |
cargo run
- name: set-env-vars-via-wasi
working-directory: set-env-vars-via-wasi
run: |
cargo build -p print-env-vars --target wasm32-wasi --release
cargo run -p set-env-vars-via-wasi -- ../target/wasm32-wasi/release/print_env_vars.wasm
- name: wasmedge-bindgen
if: false
working-directory: wasmedge-bindgen
run: |
cargo build -p wasm-lib --target wasm32-wasi --release
cargo run -p call-wasm-lib -- ./target/wasm32-wasi/release/wasm_lib.wasm 5