forked from WasmEdge/WasmEdge
-
-
Notifications
You must be signed in to change notification settings - Fork 0
598 lines (585 loc) · 28 KB
/
build-extensions.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
name: Test WasmEdge extensions
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
paths:
- ".github/workflows/build-extensions.yml"
- "plugins/**"
- "test/**"
- "thirdparty/**"
- "tools/**"
- "CMakeLists.txt"
- "cmake/**"
- "utils/wasi-nn/**"
- "utils/wasi-crypto/**"
pull_request:
branches:
- master
- "proposal/**"
paths:
- ".github/workflows/build-extensions.yml"
- "plugins/**"
- "test/**"
- "thirdparty/**"
- "tools/**"
- "CMakeLists.txt"
- "cmake/**"
- "utils/wasi-nn/**"
- "utils/wasi-crypto/**"
jobs:
# TODO: Refactor `lint` with `on.workflow_run`
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow
lint:
uses: ./.github/workflows/reusable-call-linter.yml
get_version:
name: Retrieve version information
needs: lint
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prep.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Get version
id: prep
run: |
# Retrieve annotated tags. Details: https://github.com/actions/checkout/issues/290
git fetch --tags --force
echo "Set version: $(git describe --match "[0-9].[0-9]*" --tag)"
echo "version=$(git describe --match '[0-9].[0-9]*' --tag)" >> $GITHUB_OUTPUT
# Due to the dependencies and exclusions of WASI-NN, build them saperately.
build_ubuntu_wasi_nn:
strategy:
matrix:
include:
- name: Plugins_g++
compiler: g++
docker_tag: ubuntu-build-gcc
build_type: Release
- name: Plugins_clang++
compiler: clang++
docker_tag: ubuntu-build-clang
build_type: Release
name: WASI-NN (Ubuntu, ${{ matrix.compiler }}, ${{ matrix.build_type }})
runs-on: ubuntu-latest
env:
output_dir: build/plugins/wasi_nn
test_dir: build/test/plugins/wasi_nn
build_options: -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=PyTorch -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=OpenVINO -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=TensorFlowLite -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=GGML
tar_names: wasi_nn-pytorch wasi_nn-openvino wasi_nn-tensorflowlite wasi_nn-ggml
test_bin: wasiNNTests
output_bin: libwasmedgePluginWasiNN.so
OPENVINO_VERSION: "2023.0.2"
OPENVINO_YEAR: "2023"
PYTORCH_VERSION: "1.8.2"
PYTORCH_INSTALL_TO: "."
needs: [get_version]
container:
image: wasmedge/wasmedge:${{ matrix.docker_tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Install dependencies
shell: bash
run: |
apt update
apt install -y unzip libopenblas-dev pkg-config
bash utils/wasi-nn/install-openvino.sh
bash utils/wasi-nn/install-pytorch.sh
- name: Build and test WASI-NN using ${{ matrix.compiler }} with ${{ matrix.build_type }} mode
shell: bash
run: |
export Torch_DIR=$(pwd)/${PYTORCH_INSTALL_TO}/libtorch
ldconfig
plugin_array=(${tar_names})
option_array=(${build_options})
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DWASMEDGE_BUILD_TESTS=ON -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Building ${plugin_array[$i]} backend:"
cmake -Bbuild -GNinja ${option_array[$i]}
cmake --build build --target ${test_bin}
echo "Testing ${plugin_array[$i]} backend:"
cd ${test_dir}
./${test_bin}
cd -
echo "Copying ${plugin_array[$i]} backend:"
cp -f ${output_dir}/${output_bin} ${output_bin}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${output_bin}
done
- name: Upload artifact - wasi_nn-pytorch
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_nn-pytorch-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasi_nn-pytorch.tar.gz
- name: Upload artifact - wasi_nn-openvino
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_nn-openvino-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasi_nn-openvino.tar.gz
- name: Upload artifact - wasi_nn-tensorflowlite
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_nn-tensorflowlite-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasi_nn-tensorflowlite.tar.gz
- name: Upload artifact - wasi_nn-ggml
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_nn-ggml-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasi_nn-ggml.tar.gz
build_ubuntu:
strategy:
matrix:
include:
- name: Plugins_g++
compiler: g++
docker_tag: ubuntu-build-gcc-plugins-deps
build_type: Release
- name: Plugins_clang++
compiler: clang++
docker_tag: ubuntu-build-clang-plugins-deps
build_type: Release
name: Plugins (Ubuntu, ${{ matrix.compiler }}, ${{ matrix.build_type }})
runs-on: ubuntu-latest
env:
output_prefix: build/plugins
test_prefix: build/test/plugins
build_options: -DWASMEDGE_PLUGIN_WASI_CRYPTO=ON -DWASMEDGE_PLUGIN_WASI_LOGGING=ON -DWASMEDGE_PLUGIN_PROCESS=ON -DWASMEDGE_PLUGIN_TENSORFLOW=ON -DWASMEDGE_PLUGIN_TENSORFLOWLITE=ON -DWASMEDGE_PLUGIN_IMAGE=ON -DWASMEDGE_PLUGIN_WASM_BPF=ON -DWASMEDGE_PLUGIN_RUSTLS=ON -DWASMEDGE_PLUGIN_OPENCVMINI=ON -DWASMEDGE_PLUGIN_ZLIB=ON
tar_names: wasi_crypto wasi_logging wasmedge_process wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image wasm_bpf wasmedge_rustls wasmedge_opencvmini wasmedge_zlib
test_bins: wasiCryptoTests wasiLoggingTests wasmedgeProcessTests wasmedgeTensorflowTests wasmedgeTensorflowLiteTests wasmedgeImageTests wasmBpfTests wasmEdgeRUSTLSTests wasmedgeOpencvminiTests wasmedgeZlibTests
output_bins: libwasmedgePluginWasiCrypto.so libwasmedgePluginWasiLogging.so libwasmedgePluginWasmEdgeProcess.so libwasmedgePluginWasmEdgeTensorflow.so libwasmedgePluginWasmEdgeTensorflowLite.so libwasmedgePluginWasmEdgeImage.so libwasmedgePluginWasmBpf.so libwasmedge_rustls.so libwasmedgePluginWasmEdgeOpenCVMini.so libwasmedgePluginWasmEdgeZlib.so
needs: [get_version]
container:
image: wasmedge/wasmedge:${{ matrix.docker_tag }}
# Required for mounting debugfs
# Tests of wasm_bpf also require privileges
options: --privileged
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
apt update
apt install -y libssl-dev
apt install -y libelf-dev zlib1g-dev pkg-config
apt install -y clang llvm
apt install -y cargo
# Running tests of wasm_bpf requires proper ebpf running environment
mount -t debugfs none /sys/kernel/debug
- name: Build plugins using ${{ matrix.compiler }} with ${{ matrix.build_type }} mode
shell: bash
run: |
testbin_array=(${test_bins})
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DWASMEDGE_BUILD_TESTS=ON -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF ${build_options}
for (( i=0; i<${#testbin_array[@]}; i++ ));
do
echo "Building ${testbin_array[$i]} :"
cmake --build build --target ${testbin_array[$i]}
done
- name: Test plugins
shell: bash
run: |
plugin_array=(${tar_names})
testbin_array=(${test_bins})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Testing ${plugin_array[$i]} :"
cd ${test_prefix}/${plugin_array[$i]}
./${testbin_array[$i]}
cd -
done
- name: Prepare the plugins tar.gz package
shell: bash
run: |
plugin_array=(${tar_names})
outbin_array=(${output_bins})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Copying ${plugin_array[$i]} :"
cp ${output_prefix}/${plugin_array[$i]}/${outbin_array[$i]} ${outbin_array[$i]}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${outbin_array[$i]}
done
- name: Upload artifact - wasi_crypto
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_crypto-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasi_crypto.tar.gz
- name: Upload artifact - wasi_logging
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_logging-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasi_logging.tar.gz
- name: Upload artifact - wasmedge_process
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_process-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasmedge_process.tar.gz
- name: Upload artifact - wasmedge_tensorflow
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_tensorflow-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasmedge_tensorflow.tar.gz
- name: Upload artifact - wasmedge_tensorflowlite
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasmedge_tensorflowlite.tar.gz
- name: Upload artifact - wasmedge_image
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_image-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasmedge_image.tar.gz
- name: Upload artifact - wasm_bpf
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasm_bpf-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasm_bpf.tar.gz
- name: Upload artifact - wasmedge_rustls
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_rustls-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasmedge_rustls.tar.gz
- name: Upload artifact - wasmedge_opencvmini
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_opencvmini-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasmedge_opencvmini.tar.gz
- name: Upload artifact - wasmedge_zlib
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_zlib-${{ needs.get_version.outputs.version }}-ubuntu22.04-${{ matrix.compiler }}.tar.gz
path: plugin_wasmedge_zlib.tar.gz
# Due to the dependencies and exclusions of WASI-NN, build them saperately.
build_manylinux_wasi_nn:
strategy:
matrix:
include:
- name: Plugins_x86_64
host_runner: ubuntu-latest
docker_tag: manylinux2014_x86_64
build_type: Release
- name: Plugins_aarch64
host_runner: linux-arm64
docker_tag: manylinux2014_aarch64
build_type: Release
name: WASI-NN (${{ matrix.docker_tag }}, g++, ${{ matrix.build_type }})
runs-on: ${{ matrix.host_runner }}
env:
output_dir: build/plugins/wasi_nn
test_dir: build/test/plugins/wasi_nn
build_options_all_platforms: -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=TensorFlowLite -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=GGML
build_options_manylinux2014_x86_64: -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=PyTorch
build_options_manylinux2014_aarch64:
tar_names_all_platforms: wasi_nn-tensorflowlite wasi_nn-ggml
tar_names_manylinux2014_x86_64: wasi_nn-pytorch
tar_names_manylinux2014_aarch64:
test_bin: wasiNNTests
output_bin: libwasmedgePluginWasiNN.so
PYTORCH_VERSION: "1.8.2"
PYTORCH_INSTALL_TO: "."
needs: [get_version]
container:
image: wasmedge/wasmedge:${{ matrix.docker_tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
shell: bash
run: |
bash ./utils/wasi-nn/install-pytorch.sh --disable-cxx11-abi
- name: Build and test WASI-NN using g++ with ${{ matrix.build_type }} mode
shell: bash
run: |
export Torch_DIR=$(pwd)/${PYTORCH_INSTALL_TO}/libtorch
plugin_array=(${tar_names_all_platforms} ${tar_names_${{ matrix.docker_tag }}})
option_array=(${build_options_all_platforms} ${build_options_${{ matrix.docker_tag }}})
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DWASMEDGE_BUILD_TESTS=ON -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF -DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=OFF
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Building ${plugin_array[$i]} backend:"
cmake -Bbuild -GNinja ${option_array[$i]} -DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=OFF
cmake --build build --target ${test_bin}
echo "Testing ${plugin_array[$i]} backend:"
cd ${test_dir}
echo "Testing ${plugin_array[$i]} backend:"
./${test_bin}
cd -
echo "Copying ${plugin_array[$i]} backend:"
cp -f ${output_dir}/${output_bin} ${output_bin}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${output_bin}
done
- name: Upload artifact - wasi_nn-pytorch
if: contains(matrix.docker_tag, 'manylinux2014_x86_64')
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_nn-pytorch-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasi_nn-pytorch.tar.gz
- name: Upload artifact - wasi_nn-tensorflowlite
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_nn-tensorflowlite-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasi_nn-tensorflowlite.tar.gz
- name: Upload artifact - wasi_nn-ggml
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_nn-ggml-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasi_nn-ggml.tar.gz
build_manylinux:
strategy:
matrix:
include:
- name: Plugins_x86_64
host_runner: ubuntu-latest
docker_tag: manylinux2014_x86_64-plugins-deps
build_type: Release
- name: Plugins_aarch64
host_runner: linux-arm64
docker_tag: manylinux2014_aarch64-plugins-deps
build_type: Release
name: Plugins (${{ matrix.docker_tag }}, g++, ${{ matrix.build_type }})
runs-on: ${{ matrix.host_runner }}
env:
output_prefix: build/plugins
test_prefix: build/test/plugins
build_options_all_platforms: -DWASMEDGE_PLUGIN_WASI_CRYPTO=ON -DWASMEDGE_PLUGIN_WASI_LOGGING=ON -DWASMEDGE_PLUGIN_PROCESS=ON -DWASMEDGE_PLUGIN_TENSORFLOW=ON -DWASMEDGE_PLUGIN_TENSORFLOWLITE=ON -DWASMEDGE_PLUGIN_IMAGE=ON -DWASMEDGE_PLUGIN_OPENCVMINI=ON -DWASMEDGE_PLUGIN_ZLIB=ON
build_options_manylinux2014_x86_64: -DWASMEDGE_PLUGIN_WASM_BPF=ON -DWASMEDGE_PLUGIN_RUSTLS=ON -DWASMEDGE_PLUGIN_WASM_BPF_BUILD_LIBBPF_WITH_PKG_CONF=OFF
build_options_manylinux2014_aarch64:
tar_names_all_platforms: wasi_crypto wasi_logging wasmedge_process wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image wasmedge_opencvmini wasmedge_zlib
tar_names_manylinux2014_x86_64: wasm_bpf wasmedge_rustls
tar_names_manylinux2014_aarch64:
test_bins_all_platforms: wasiCryptoTests wasiLoggingTests wasmedgeProcessTests wasmedgeTensorflowTests wasmedgeTensorflowLiteTests wasmedgeImageTests wasmedgeOpencvminiTests wasmedgeZlibTests
test_bins_manylinux2014_x86_64: wasmBpfTests wasmEdgeRUSTLSTests
test_bins_manylinux2014_aarch64:
output_bins_all_platforms: libwasmedgePluginWasiCrypto.so libwasmedgePluginWasiLogging.so libwasmedgePluginWasmEdgeProcess.so libwasmedgePluginWasmEdgeTensorflow.so libwasmedgePluginWasmEdgeTensorflowLite.so libwasmedgePluginWasmEdgeImage.so libwasmedgePluginWasmEdgeOpenCVMini.so libwasmedgePluginWasmEdgeZlib.so
output_bins_manylinux2014_x86_64: libwasmedgePluginWasmBpf.so libwasmedge_rustls.so
output_bins_manylinux2014_aarch64:
needs: [get_version]
container:
image: wasmedge/wasmedge:${{ matrix.docker_tag }}
# Required for mounting debugfs
# Tests of wasm_bpf also require privileges
options: --privileged
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build and install dependencies
run: |
yum update -y
yum install -y zlib-devel zlib-static cmake curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
bash ./utils/wasi-crypto/build-openssl.sh
# Running tests of wasm_bpf requires proper ebpf running environment
mount -t debugfs none /sys/kernel/debug
- name: Build and test plugins using g++ with ${{ matrix.build_type }} mode
shell: bash
run: |
source "$HOME/.cargo/env"
testbin_array=(${test_bins_all_platforms} ${test_bins_${{ matrix.docker_tag }}})
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DWASMEDGE_BUILD_TESTS=ON -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF ${build_options_all_platforms} ${build_options_${{ matrix.docker_tag }}} -DOPENSSL_ROOT_DIR=$(pwd)/openssl-1.1.1n/openssl
for (( i=0; i<${#testbin_array[@]}; i++ ));
do
echo "Building ${testbin_array[$i]} :"
cmake --build build --target ${testbin_array[$i]}
done
- name: Test plugins
shell: bash
run: |
plugin_array=(${tar_names_all_platforms} ${tar_names_${{ matrix.docker_tag }}})
testbin_array=(${test_bins_all_platforms} ${test_bins_${{ matrix.docker_tag }}})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Testing ${plugin_array[$i]} :"
cd ${test_prefix}/${plugin_array[$i]}
./${testbin_array[$i]}
cd -
done
- name: Prepare the WasmEdge plugins tar.gz package
shell: bash
run: |
plugin_array=(${tar_names_all_platforms} ${tar_names_${{ matrix.docker_tag }}})
outbin_array=(${output_bins_all_platforms} ${output_bins_${{ matrix.docker_tag }}})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Copying ${plugin_array[$i]} :"
cp ${output_prefix}/${plugin_array[$i]}/${outbin_array[$i]} ${outbin_array[$i]}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${outbin_array[$i]}
done
- name: Upload artifact - wasi_crypto
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_crypto-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasi_crypto.tar.gz
- name: Upload artifact - wasi_logging
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_logging-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasi_logging.tar.gz
- name: Upload artifact - wasmedge_process
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_process-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasmedge_process.tar.gz
- name: Upload artifact - wasmedge_tensorflow
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_tensorflow-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasmedge_tensorflow.tar.gz
- name: Upload artifact - wasmedge_tensorflowlite
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasmedge_tensorflowlite.tar.gz
- name: Upload artifact - wasmedge_image
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_image-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasmedge_image.tar.gz
- name: Upload artifact - wasm_bpf
if: contains(matrix.docker_tag, 'manylinux2014_x86_64')
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasm_bpf-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasm_bpf.tar.gz
- name: Upload artifact - wasmedge_rustls
if: contains(matrix.docker_tag, 'manylinux2014_x86_64')
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_rustls-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasmedge_rustls.tar.gz
- name: Upload artifact - wasmedge_opencvmini
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_opencvmini-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasmedge_opencvmini.tar.gz
- name: Upload artifact - wasmedge_zlib
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_zlib-${{ needs.get_version.outputs.version }}-${{ matrix.docker_tag }}.tar.gz
path: plugin_wasmedge_zlib.tar.gz
build_macos:
strategy:
matrix:
include:
- name: Plugins_MacOS_12
system: MacOS 12
host_runner: macos-12
darwin_version: darwin_21
build_type: Release
arch: x86_64
- name: Plugins_MacOS_arm64
system: MacOS 13 (arm64)
host_runner: mac-arm64
darwin_version: darwin_22
build_type: Release
arch: arm64
name: Plugins (${{ matrix.system }}, clang++, ${{ matrix.build_type }})
runs-on: ${{ matrix.host_runner }}
env:
output_prefix: build/plugins
test_prefix: build/test/plugins
build_options: -DWASMEDGE_PLUGIN_WASI_CRYPTO=ON -DWASMEDGE_PLUGIN_RUSTLS=ON -DWASMEDGE_PLUGIN_WASI_LOGGING=ON -DWASMEDGE_PLUGIN_TENSORFLOW=ON -DWASMEDGE_PLUGIN_TENSORFLOWLITE=ON -DWASMEDGE_PLUGIN_IMAGE=ON -DWASMEDGE_PLUGIN_OPENCVMINI=ON
tar_names: wasi_crypto wasi_logging wasmedge_rustls wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image wasmedge_opencvmini
test_bins: wasiCryptoTests wasiLoggingTests wasmEdgeRUSTLSTests wasmedgeTensorflowTests wasmedgeTensorflowLiteTests wasmedgeImageTests wasmedgeOpencvminiTests
output_bins: libwasmedgePluginWasiCrypto.dylib libwasmedgePluginWasiLogging.dylib libwasmedge_rustls.dylib libwasmedgePluginWasmEdgeTensorflow.dylib libwasmedgePluginWasmEdgeTensorflowLite.dylib libwasmedgePluginWasmEdgeImage.dylib libwasmedgePluginWasmEdgeOpenCVMini.dylib
needs: [get_version]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build and install dependencies
run: |
eval $(/opt/homebrew/bin/brew shellenv)
brew install llvm@16 ninja cmake openssl opencv rust
- name: Build WasmEdge plugins using clang++ with ${{ matrix.build_type }} mode
shell: bash
run: |
eval $(/opt/homebrew/bin/brew shellenv)
testbin_array=(${test_bins})
export LLVM_DIR="$(brew --prefix)/opt/llvm@16/lib/cmake"
export CC=clang
export CXX=clang++
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DWASMEDGE_BUILD_TESTS=ON -DWASMEDGE_BUILD_AOT_RUNTIME=OFF -DWASMEDGE_BUILD_TOOLS=OFF ${build_options} -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl
for (( i=0; i<${#testbin_array[@]}; i++ ));
do
echo "Building ${testbin_array[$i]} :"
cmake --build build --target ${testbin_array[$i]}
done
- name: Test WasmEdge plugins
shell: bash
run: |
eval $(/opt/homebrew/bin/brew shellenv)
plugin_array=(${tar_names})
testbin_array=(${test_bins})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
if [[ ${plugin_array[$i]} == "wasmedge_opencvmini" ]]; then
echo "Temporary disable ${plugin_array[$i]} testing"
continue
fi
echo "Testing ${plugin_array[$i]} :"
cd ${test_prefix}/${plugin_array[$i]}
./${testbin_array[$i]}
cd -
done
- name: Prepare the WasmEdge plugins tar.gz package
shell: bash
run: |
eval $(/opt/homebrew/bin/brew shellenv)
plugin_array=(${tar_names})
outbin_array=(${output_bins})
for (( i=0; i<${#plugin_array[@]}; i++ ));
do
echo "Copying ${plugin_array[$i]} :"
cp ${output_prefix}/${plugin_array[$i]}/${outbin_array[$i]} ${outbin_array[$i]}
tar -zcvf plugin_${plugin_array[$i]}.tar.gz ${outbin_array[$i]}
done
- name: Upload artifact - wasi_crypto
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_crypto-${{ needs.get_version.outputs.version }}-${{ matrix.darwin_version }}_${{ matrix.arch }}.tar.gz
path: plugin_wasi_crypto.tar.gz
- name: Upload artifact - wasi_logging
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasi_logging-${{ needs.get_version.outputs.version }}-${{ matrix.darwin_version }}_${{ matrix.arch }}.tar.gz
path: plugin_wasi_logging.tar.gz
- name: Upload artifact - wasmedge_rustls
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_rustls-${{ needs.get_version.outputs.version }}-${{ matrix.darwin_version }}_${{ matrix.arch }}.tar.gz
path: plugin_wasmedge_rustls.tar.gz
- name: Upload artifact - wasmedge_tensorflow
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_tensorflow-${{ needs.get_version.outputs.version }}-${{ matrix.darwin_version }}_${{ matrix.arch }}.tar.gz
path: plugin_wasmedge_tensorflow.tar.gz
- name: Upload artifact - wasmedge_tensorflowlite
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_tensorflowlite-${{ needs.get_version.outputs.version }}-${{ matrix.darwin_version }}_${{ matrix.arch }}.tar.gz
path: plugin_wasmedge_tensorflowlite.tar.gz
- name: Upload artifact - wasmedge_image
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_image-${{ needs.get_version.outputs.version }}-${{ matrix.darwin_version }}_${{ matrix.arch }}.tar.gz
path: plugin_wasmedge_image.tar.gz
- name: Upload artifact - wasmedge_opencvmini
uses: actions/upload-artifact@v3
with:
name: WasmEdge-plugin-wasmedge_opencvmini-${{ needs.get_version.outputs.version }}-${{ matrix.darwin_version }}_${{ matrix.arch }}.tar.gz
path: plugin_wasmedge_opencvmini.tar.gz