@@ -30,53 +30,58 @@ RUN apt-get update \
3030 && apt-get upgrade -y \
3131 && apt-get install --no-install-recommends -y openvino-2023.2.0
3232
33+ # Activate after upgrading to wasi-nn 0.7.0
34+ # #
35+ # # wasi-nn
36+ # # compilation requirements
37+ # WORKDIR /workspaces/wasi-nn
38+ # RUN git clone https://github.com/bytecodealliance/wasi-nn.git . \
39+ # # update new wasmtime's cli (#100). Apr 27, 2024
40+ # && git checkout 556890b121dd1171665d835aba4d04a7e29e37dc
3341#
34- # wasi-nn
35- # compilation requirements
36- WORKDIR /workspaces/wasi-nn
37- RUN git clone --depth 1 https://github.com/bytecodealliance/wasi-nn.git .
38-
39- WORKDIR /workspaces/wasi-nn/rust/examples/classification-example/
40- RUN cargo build --target=wasm32-wasip1
41-
42- WORKDIR /workspaces/wasi-nn/rust/examples/classification-example/build
43- RUN cp ../target/wasm32-wasip1/debug/wasi-nn-example.wasm . \
44- && wget -q --no-clobber https://github.com/intel/openvino-rs/raw/main/crates/openvino/tests/fixtures/mobilenet/mobilenet.xml \
45- && wget -q --no-clobber https://github.com/intel/openvino-rs/raw/main/crates/openvino/tests/fixtures/mobilenet/mobilenet.bin
46- # There are model files(mobilenet*) and wasm files(wasi-nn-example.wasm) in the directory,
47- # /workspaces/wasi-nn/rust/examples/classification-example/build
42+ # WORKDIR /workspaces/wasi-nn/rust/examples/classification-example/
43+ # RUN cargo build --target=wasm32-wasip1
44+ #
45+ # ARG FIXTURE=https://download.01.org/openvinotoolkit/fixtures/mobilenet
46+ # RUN cp target/wasm32-wasip1/debug/wasi-nn-example.wasm . \
47+ # && wget -q --no-clobber $FIXTURE/mobilenet.xml \
48+ # && wget -q --no-clobber $FIXTURE/mobilenet.bin
49+ # # There are model files(mobilenet*) and wasm files(wasi-nn-example.wasm) in the directory,
4850
4951#
5052# wasmedge
5153WORKDIR /tmp
5254RUN wget -q https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh \
5355 && chmod a+x ./install.sh
5456# RUN ./install.sh -p /opt/wasmedge --plugins wasi_nn-tensorflowlite wasi_nn-openvino
55- RUN ./install.sh -r yes -D -p /opt/wasmedge --plugins wasi_nn-openvino --dist ubuntu20.04 \
57+ RUN ./install.sh -r yes -D -p /opt/wasmedge --plugins wasi_nn-openvino --dist ubuntu20.04 -v 0.14.0 \
5658 && /opt/wasmedge/bin/wasmedge --version
5759ENV PATH=/opt/wasmedge/bin:${PATH}
5860# ENV WASMEDGE_LIB_DIR=/opt/wasmedge/lib
5961
6062#
6163# wasmedge-wasinn-examples
64+ # based on wasi-nn 0.6.0
6265WORKDIR /workspaces/wasmedge-wasinn-examples
6366RUN git clone --depth 1 https://github.com/second-state/WasmEdge-WASINN-examples.git .
64- COPY core/iwasm/libraries/wasi-nn/test/bump_wasi_nn_to_0_6_0.patch .
65- RUN git apply ./bump_wasi_nn_to_0_6_0.patch
6667
67- # recompile with wasi-nn 0.6.0
68+ # recompile with debug info
69+ ARG FIXTURE=https://download.01.org/openvinotoolkit/fixtures/mobilenet
6870WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-mobilenet-image/
6971RUN pushd rust \
7072 && cargo build --target=wasm32-wasip1 \
7173 && popd \
72- && ./download_mobilenet.sh . \
74+ && wget -q --no-clobber $FIXTURE/mobilenet.xml \
75+ && wget -q --no-clobber $FIXTURE/mobilenet.bin \
7376 && ls -l mobilenet.xml mobilenet.bin
7477
7578WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-mobilenet-raw/
7679RUN pushd rust \
7780 && cargo build --target=wasm32-wasip1 \
7881 && popd \
79- && ./download_mobilenet.sh . \
82+ && wget -q --no-clobber $FIXTURE/mobilenet.xml \
83+ && wget -q --no-clobber $FIXTURE/mobilenet.bin \
84+ && wget -q --no-clobber $FIXTURE/tensor-1x224x224x3-f32.bgr \
8085 && ls -l mobilenet.xml mobilenet.bin tensor-1x224x224x3-f32.bgr
8186
8287WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-road-segmentation-adas/
@@ -91,7 +96,7 @@ RUN pushd rust \
9196WORKDIR /workspaces/wasmedge-wasinn-examples/wasmedge-ggml/qwen
9297RUN wget --progress=dot:giga https://www.modelscope.cn/models/qwen/Qwen1.5-0.5B-Chat-GGUF/resolve/master/qwen1_5-0_5b-chat-q2_k.gguf
9398RUN cargo build --target=wasm32-wasip1
94-
99+ #
95100#
96101# iwasm. build from source
97102WORKDIR /workspaces/wamr
@@ -110,6 +115,7 @@ RUN OpenVINO_DIR=/usr/lib/openvino-2023.2.0 \
110115
111116ENV LD_LIBRARY_PATH=/usr/local/lib
112117
118+
113119# add smoke test script
114120COPY core/iwasm/libraries/wasi-nn/test/run_smoke_test.py /
115121
0 commit comments