Skip to content

Commit

Permalink
[CI] Install libtensorflowlite_c.so in dockerfile and add instruction…
Browse files Browse the repository at this point in the history
…s on README
  • Loading branch information
hydai committed Dec 25, 2020
1 parent bf9a135 commit 95948fa
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/external-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,23 @@ jobs:

- name: Test functions ${{ matrix.ssvm-options }}
run: |
ssvmup build ${{ matrix.ssvm-options }}
sed -i "s/require('ssvm')/require('ssvm-extensions')/g" pkg/*.js
ssvmup build ${{ matrix.ssvm-options }} --enable-ext
cd pkg && npm i ${GITHUB_WORKSPACE} && cd ..
node node/app.js
ssvmup clean
working-directory: wasm-learning/nodejs/functions

- name: Test JSON IO ${{ matrix.ssvm-options }}
run: |
ssvmup build ${{ matrix.ssvm-options }}
sed -i "s/require('ssvm')/require('ssvm-extensions')/g" pkg/*.js
ssvmup build ${{ matrix.ssvm-options }} --enable-ext
cd pkg && npm i ${GITHUB_WORKSPACE} && cd ..
node node/app.js
ssvmup clean
working-directory: wasm-learning/nodejs/json_io

- name: Test WASI ${{ matrix.ssvm-options }}
run: |
ssvmup build ${{ matrix.ssvm-options }}
sed -i "s/require('ssvm')/require('ssvm-extensions')/g" pkg/*.js
ssvmup build ${{ matrix.ssvm-options }} --enable-ext
cd pkg && npm i ${GITHUB_WORKSPACE} && cd ..
node node/app.js
ssvmup clean
Expand All @@ -65,8 +62,7 @@ jobs:
- name: Test RSA ${{ matrix.ssvm-options }}
if: ${{ contains(matrix.ssvm-options, 'aot') }}
run: |
ssvmup build ${{ matrix.ssvm-options }}
sed -i "s/require('ssvm')/require('ssvm-extensions')/g" pkg/*.js
ssvmup build ${{ matrix.ssvm-options }} --enable-ext
cd pkg && npm i ${GITHUB_WORKSPACE} && cd ..
node node/app.js
ssvmup clean
Expand All @@ -75,8 +71,7 @@ jobs:
- name: Test KMeans ${{ matrix.ssvm-options }}
if: ${{ contains(matrix.ssvm-options, 'aot') }}
run: |
ssvmup build ${{ matrix.ssvm-options }}
sed -i "s/require('ssvm')/require('ssvm-extensions')/g" pkg/*.js
ssvmup build ${{ matrix.ssvm-options }} --enable-ext
cd pkg && npm i ${GITHUB_WORKSPACE} && cd ..
cd node && node app.js && cd ..
ssvmup clean
Expand All @@ -85,8 +80,7 @@ jobs:
- name: Test MobileNet ${{ matrix.ssvm-options }}
if: ${{ contains(matrix.ssvm-options, 'aot') }}
run: |
ssvmup build ${{ matrix.ssvm-options }}
sed -i "s/require('ssvm')/require('ssvm-extensions')/g" pkg/*.js
ssvmup build ${{ matrix.ssvm-options }} --enable-ext
cd pkg && npm i ${GITHUB_WORKSPACE} && cd ..
cd test && node test.js && cd ..
ssvmup clean
Expand All @@ -95,8 +89,7 @@ jobs:
- name: Test MTCNN ${{ matrix.ssvm-options }}
if: ${{ contains(matrix.ssvm-options, 'aot') }}
run: |
ssvmup build ${{ matrix.ssvm-options }}
sed -i "s/require('ssvm')/require('ssvm-extensions')/g" pkg/*.js
ssvmup build ${{ matrix.ssvm-options }} --enable-ext
cd pkg && npm i ${GITHUB_WORKSPACE} && cd ..
cd test && node test.js && cd ..
ssvmup clean
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ For the tensorflow extensions:

* libpng-dev
* libjpeg-dev
* libtensorflowlite\_c.so
* You can use the following commands to get libtensorflowlite\_c.so
```bash
# Download TensorFlow deps
wget https://github.com/second-state/ssvm-tensorflow-deps/releases/download/0.1.0/ssvm-tensorflow-deps-0.1.0-linux-x64.tar.gz
tar -zxvf ssvm-tensorflow-deps-0.1.0-linux-x64.tar.gz
rm -f ssvm-tensorflow-deps-0.1.0-linux-x64.tar.gz
cp ./libtensorflowlite_c.so /usr/local/lib
rm ./*.so
rm ./*.so.*
```

## Prepare environment

Expand Down
12 changes: 11 additions & 1 deletion utils/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM secondstate/ssvm:latest

ARG DEBIAN_FRONTEND=noninteractive
ARG TENSORFLOW_TARBALL=libtensorflow-cpu-linux-x86_64-2.3.0.tar.gz
ARG TENSORFLOW_TARBALL=libtensorflow-cpu-linux-x86_64-2.4.0.tar.gz
ARG TENSORFLOW_LITE_TARBALL=ssvm-tensorflow-deps-0.1.0-linux-x64.tar.gz
ARG SSVM_TENSORFLOW_DEPS_VERSION=0.1.0
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
Expand All @@ -19,6 +21,14 @@ RUN wget https://storage.googleapis.com/tensorflow/libtensorflow/${TENSORFLOW_TA
&& tar -C /usr/local -xzf ${TENSORFLOW_TARBALL} \
&& ldconfig

RUN wget https://github.com/second-state/ssvm-tensorflow-deps/releases/download/${SSVM_TENSORFLOW_DEPS_VERSION}/${TENSORFLOW_LITE_TARBALL} \
&& tar -zxvf ${TENSORFLOW_LITE_TARBALL} \
&& rm -f ${TENSORFLOW_LITE_TARBALL} \
&& cp ./libtensorflowlite_c.so /usr/local/lib \
&& rm ./*.so \
&& rm ./*.so.* \
&& ldconfig

RUN npm install -y -g --unsafe-perm \
node-pre-gyp \
ssvmup \
Expand Down

0 comments on commit 95948fa

Please sign in to comment.