@@ -30,53 +30,58 @@ RUN apt-get update \
30
30
&& apt-get upgrade -y \
31
31
&& apt-get install --no-install-recommends -y openvino-2023.2.0
32
32
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
33
41
#
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,
48
50
49
51
#
50
52
# wasmedge
51
53
WORKDIR /tmp
52
54
RUN wget -q https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh \
53
55
&& chmod a+x ./install.sh
54
56
# 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 \
56
58
&& /opt/wasmedge/bin/wasmedge --version
57
59
ENV PATH=/opt/wasmedge/bin:${PATH}
58
60
# ENV WASMEDGE_LIB_DIR=/opt/wasmedge/lib
59
61
60
62
#
61
63
# wasmedge-wasinn-examples
64
+ # based on wasi-nn 0.6.0
62
65
WORKDIR /workspaces/wasmedge-wasinn-examples
63
66
RUN 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
66
67
67
- # recompile with wasi-nn 0.6.0
68
+ # recompile with debug info
69
+ ARG FIXTURE=https://download.01.org/openvinotoolkit/fixtures/mobilenet
68
70
WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-mobilenet-image/
69
71
RUN pushd rust \
70
72
&& cargo build --target=wasm32-wasip1 \
71
73
&& popd \
72
- && ./download_mobilenet.sh . \
74
+ && wget -q --no-clobber $FIXTURE/mobilenet.xml \
75
+ && wget -q --no-clobber $FIXTURE/mobilenet.bin \
73
76
&& ls -l mobilenet.xml mobilenet.bin
74
77
75
78
WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-mobilenet-raw/
76
79
RUN pushd rust \
77
80
&& cargo build --target=wasm32-wasip1 \
78
81
&& 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 \
80
85
&& ls -l mobilenet.xml mobilenet.bin tensor-1x224x224x3-f32.bgr
81
86
82
87
WORKDIR /workspaces/wasmedge-wasinn-examples/openvino-road-segmentation-adas/
@@ -91,7 +96,7 @@ RUN pushd rust \
91
96
WORKDIR /workspaces/wasmedge-wasinn-examples/wasmedge-ggml/qwen
92
97
RUN 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
93
98
RUN cargo build --target=wasm32-wasip1
94
-
99
+ #
95
100
#
96
101
# iwasm. build from source
97
102
WORKDIR /workspaces/wamr
@@ -110,6 +115,7 @@ RUN OpenVINO_DIR=/usr/lib/openvino-2023.2.0 \
110
115
111
116
ENV LD_LIBRARY_PATH=/usr/local/lib
112
117
118
+
113
119
# add smoke test script
114
120
COPY core/iwasm/libraries/wasi-nn/test/run_smoke_test.py /
115
121
0 commit comments