Skip to content

WIP ci: build plugins #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/scripts/wasi_nn-ggml/ubuntu2004.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARCH=$(uname -m)
ARTIFACT="WasmEdge-plugin-wasi_nn-ggml-${WASMEDGE_GGML_BUILD}-${WASMEDGE_VERSION}-ubuntu20.04-${ARCH}.tar.gz"
IS_NATIVE=OFF

if [[ "${ARCH}" == "x86_64" ]; then
IS_NATIVE=ON
fi

cmake -B${OUTPUT_DIR} -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DWASMEDGE_BUILD_AOT_RUNTIME=OFF \
-DWASMEDGE_BUILD_TOOLS=OFF \
-DWASMEDGE_PLUGIN_WASI_NN_BACKEND=GGML \
-DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_BLAS=OFF \
-DWASMEDGE_PLUGIN_WASI_NN_GGML_LLAMA_NATIVE=${IS_NATIVE} \
-DWASMEDGE_USE_LLVM=OFF
cmake --build ${OUTPUT_DIR}

cp -f "${OUTPUT_DIR}/${OUTPUT_BIN}" "${OUTPUT_BIN}"
tar zcvf "${ARTIFACT}" "${OUTPUT_BIN}"

echo "artifact=${ARTIFACT}" >> "${GITHUB_OUTPUT}"
65 changes: 65 additions & 0 deletions .github/workflows/build-wasi_nn-ggml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: WASI-NN GGML

on:
pull_request:
branches: [main]
paths:
- '.github/workflows/build-wasi_nn-ggml.yml'
- 'plugins/wasi_nn/**'
- 'test/plugins/wasi_nn/**'

permissions: {}

jobs:
build:
permissions:
contents: write

strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu20.04
arch: x86_64
runner: ubuntu-latest
image: wasmedge/wasmedge:ubuntu-20.04-build-gcc-plugins-deps
script: ubuntu2004.sh

runs-on: ${{ matrix.runner }}
container: ${{ matrix.image }}

name: ${{ matrix.platform }} (${{ matrix.arch }})

env:
OUTPUT_DIR: build
OUTPUT_BIN: libwasmedgePluginWasiNN.so
WASMEDGE_GGML_BUILD: b5640
WASMEDGE_VERSION: 0.14.1_plugin_lts

steps:
- name: Checkout WasmEdge
uses: actions/checkout@v4
with:
repository: WasmEdge/WasmEdge
ref: ${{ env.WASMEDGE_VERSION }}
fetch-depth: 0

- name: Checkout this repository
uses: actions/checkout@v4
with:
path: this

- id: build
name: Build
run: |
git config --global --add safe.directory "$(pwd)"
rm -rf "${OUTPUT_DIR}"
bash -e "this/.github/scripts/wasi_nn-ggml/${{ matrix.script }}"
shell: bash

- name: Upload ${{ steps.build.outputs.artifact }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build.outputs.artifact }}
path: ${{ steps.build.outputs.artifact }}
Loading