Skip to content

Commit

Permalink
fix: installation of onnx runtime in x86 plaforms
Browse files Browse the repository at this point in the history
  • Loading branch information
laktek committed Feb 15, 2024
1 parent e373fb7 commit 858ce40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry,id=${TARGETPLATFORM} --m
GIT_V_TAG=${GIT_V_VERSION} cargo build --release && \
cargo strip && \
mv /usr/src/edge-runtime/target/release/edge-runtime /root
RUN curl -O https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-${ONNXRUNTIME_VERSION}.tgz && tar zxvf onnxruntime-node-${ONNXRUNTIME_VERSION}.tgz && \
mv ./package/bin/napi-v3/$TARGETPLATFORM/libonnxruntime.so.${ONNXRUNTIME_VERSION} /root/libonnxruntime.so
RUN ./scripts/install_onnx.sh $ONNXRUNTIME_VERSION $TARGETPLATFORM /root/libonnxruntime.so


FROM debian:bookworm-slim
Expand Down
9 changes: 9 additions & 0 deletions scripts/install_onnx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

curl -O https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-$1.tgz && tar zxvf onnxruntime-node-$1.tgz

if [ "$2" == "linux/arm64" ]; then
mv ./package/bin/napi-v3/linux/arm64/libonnxruntime.so.$1 $3
else
mv ./package/bin/napi-v3/linux/x64/libonnxruntime.so.$1 $3
fi

0 comments on commit 858ce40

Please sign in to comment.