Skip to content

Commit

Permalink
preview: build installable image enable preview feature
Browse files Browse the repository at this point in the history
Enable nn_preload for running the ggml demo

Signed-off-by: vincent <[email protected]>
  • Loading branch information
CaptainVincent committed Nov 5, 2023
1 parent bac484a commit eae3a60
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/build-installable-img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
default: 'info'
push:
branches:
- "main"
- "preview"
tags:
- "v*.*.*"
paths:
Expand All @@ -33,15 +33,15 @@ jobs:
id: generate-plugins
run: |
plugins=()
plugins+=("wasi_nn-openvino")
plugins+=("wasi_crypto")
plugins+=("wasi_nn-pytorch")
plugins+=("wasi_nn-tensorflowlite")
# plugins+=("wasi_nn-openvino")
# plugins+=("wasi_crypto")
# plugins+=("wasi_nn-pytorch")
# plugins+=("wasi_nn-tensorflowlite")
plugins+=("wasi_nn-ggml")
plugins+=("wasmedge_tensorflow")
plugins+=("wasmedge_tensorflowlite")
plugins+=("wasmedge_image")
plugins+=("wasm_bpf")
# plugins+=("wasmedge_tensorflow")
# plugins+=("wasmedge_tensorflowlite")
# plugins+=("wasmedge_image")
# plugins+=("wasm_bpf")
plugins=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${plugins[@]}")
echo "Updated environments list: $plugins"
echo "plugins=$plugins" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
images: ghcr.io/second-state/runwasi-wasmedge-plugin
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=lib.${{ matrix.plugin }}
type=raw,value=lib.${{ matrix.plugin }}-preview
# type=raw,value=lib.${{ matrix.plugin }}.${{ github.sha }}
bake-target: meta-helper
labels: |
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
uses: docker/bake-action@v4
env:
plugin: ${{ matrix.plugin }}
platforms: ${{ matrix.plugin == 'wasi_nn-pytorch' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
platforms: ${{ matrix.plugin == 'wasi_nn-pytorch' || matrix.plugin == 'wasi_nn-ggml' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
with:
files: |
release/docker-bake.hcl
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
images: ghcr.io/second-state/runwasi-wasmedge
# generate Docker tags based on the following events/attributes
tags: |
latest
preview
# type=raw,value=bin.${{ github.sha }}
bake-target: meta-helper
labels: |
Expand All @@ -152,6 +152,8 @@ jobs:

- name: Build and push
uses: docker/bake-action@v4
env:
platforms: 'linux/amd64'
with:
files: |
release/docker-bake.hcl
Expand Down Expand Up @@ -184,7 +186,7 @@ jobs:
images: ghcr.io/second-state/runwasi-wasmedge-plugin
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=allinone.${{ matrix.plugin }}
type=raw,value=allinone.${{ matrix.plugin }}-preview
# type=raw,value=allinone.${{ matrix.plugin }}.${{ github.sha }}
bake-target: meta-helper
labels: |
Expand Down Expand Up @@ -212,7 +214,7 @@ jobs:
uses: docker/bake-action@v4
env:
plugin: ${{ matrix.plugin }}
platforms: ${{ matrix.plugin == 'wasi_nn-pytorch' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
platforms: ${{ matrix.plugin == 'wasi_nn-pytorch' || matrix.plugin == 'wasi_nn-ggml' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
with:
files: |
release/docker-bake.hcl
Expand Down
2 changes: 1 addition & 1 deletion release/DockerfileBin
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN <<EOT
os=$(xx-info os)
march=$(xx-info march)
mkdir -p /dynlib
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --version=0.13.4 --platform=${os^} --machine=$(xx-info march)
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --version=0.13.5 --platform=${os^} --machine=$(xx-info march)
EOT

RUN --mount=type=bind,target=/src,rw,source=. \
Expand Down
2 changes: 1 addition & 1 deletion release/DockerfileLib
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN <<EOT
set -ex
os=$(xx-info os)
plugins=$( [ -n "$PLUGIN" ] && echo "--plugin $PLUGIN" || echo "" )
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --version=0.13.4 --platform=${os^} --machine=$(xx-info march) $plugins
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --version=0.13.5 --platform=${os^} --machine=$(xx-info march) $plugins
mkdir -p /dynlib
./install_dependencies.sh $PLUGIN /dynlib
for file in /root/.wasmedge/plugin/*.so; do
Expand Down

0 comments on commit eae3a60

Please sign in to comment.