-
Notifications
You must be signed in to change notification settings - Fork 25
119 lines (100 loc) · 4.71 KB
/
main.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
name: main
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'info'
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install apt-get packages
run: |
echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
sudo ACCEPT_EULA=Y apt-get update
sudo ACCEPT_EULA=Y apt-get upgrade
sudo apt-get install wget git curl software-properties-common build-essential libjpeg-dev libpng-dev cmake
- name: Install and run MySQL
run: |
sudo apt-get update
sudo apt-get -y install mysql-server libmysqlclient-dev curl
sudo service mysql start
mysql -e "SET GLOBAL max_allowed_packet = 36700160;" -uroot -proot
mysql -e "SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = WARN;" -uroot -proot
mysql -e "SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = ON;" -uroot -proot
mysql -e "SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;" -uroot -proot
mysql -e "SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;" -uroot -proot
mysql -e "SET @@GLOBAL.GTID_MODE = ON;" -uroot -proot
mysql -e "PURGE BINARY LOGS BEFORE now();" -uroot -proot
- name: Install Rust target for wasm
run: |
rustup target add wasm32-wasi
- name: Install WasmEdge
run: |
VERSION=0.13.5
TFVERSION=2.12.0
curl -s -L -O --remote-name-all https://github.com/second-state/WasmEdge-tensorflow-deps/releases/download/TF-2.12.0-CC/WasmEdge-tensorflow-deps-TFLite-TF-$TFVERSION-CC-manylinux2014_x86_64.tar.gz
tar -zxf WasmEdge-tensorflow-deps-TFLite-TF-$TFVERSION-CC-manylinux2014_x86_64.tar.gz
rm -f WasmEdge-tensorflow-deps-TFLite-TF-$TFVERSION-CC-manylinux2014_x86_64.tar.gz
sudo mv libtensorflowlite_c.so /usr/local/lib
sudo mv libtensorflowlite_flex.so /usr/local/lib
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -v $VERSION --plugins wasi_nn-tensorflowlite wasmedge_rustls -p /usr/local
- name: Install and init dapr
run: |
wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash
dapr init
- name: Start dapr sentry service
run: |
mkdir -p .dapr/certs
wget https://github.com/dapr/dapr/releases/download/v1.8.4/sentry_linux_amd64.tar.gz
tar -zxvf sentry_linux_amd64.tar.gz
nohup ./sentry --issuer-credentials .dapr/certs --trust-domain cluster.local &
- name: Run grayscale
run: |
cd image-api-grayscale
cargo build --target wasm32-wasi --release
wasmedgec target/wasm32-wasi/release/image-api-grayscale.wasm image-api-grayscale.wasm
nohup dapr run --app-id image-api-grayscale --app-protocol http --app-port 9005 --dapr-http-port 3503 --resources-path ../config --log-level debug wasmedge image-api-grayscale.wasm > server.log 2>&1 &
- name: Run classify
run: |
cd image-api-classify
cargo build --target wasm32-wasi --release
wasmedgec target/wasm32-wasi/release/wasmedge_hyper_server_tflite.wasm wasmedge_hyper_server_tflite.wasm
nohup dapr run --app-id image-api-classify --app-protocol http --app-port 9006 --dapr-http-port 3504 --resources-path ../config --log-level debug wasmedge wasmedge_hyper_server_tflite.wasm > server.log 2>&1 &
- name: Run events service
run: |
cd events-service
cargo build --target wasm32-wasi --release
wasmedgec target/wasm32-wasi/release/events_service.wasm events_service.wasm
nohup dapr run --app-id events-service --app-protocol http --app-port 9007 --dapr-http-port 3505 --resources-path ../config --log-level debug wasmedge events_service.wasm > server.log 2>&1 &
sleep 10
- name: Run tests
continue-on-error: true
run: |
cat events-service/server.log
cd docs
curl http://localhost:9007/init
curl http://localhost:9007/events
curl http://localhost:9005/grayscale -X POST --data-binary '@food.jpg'
# curl -o /dev/null http://localhost:9005/grayscale -X POST --data-binary '@food.jpg'
curl http://localhost:9006/classify -X POST --data-binary '@food.jpg'
curl http://localhost:9007/events
- name: Dump the grayscale server log
run: |
cd image-api-grayscale
cat server.log
- name: Dump the classify server log
run: |
cd image-api-classify
cat server.log
- name: Dump the events server log
run: |
cd events-service
cat server.log