-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsimple_wasi_application.sh
32 lines (30 loc) · 1.13 KB
/
simple_wasi_application.sh
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
#!/bin/bash
export KUBERNETES_PROVIDER=local
export WASM_IMAGE=docker.io/wasmedge/example-wasi
export WASM_IMAGE_TAG=latest
export VARIANT=compat-smart
for opt in "$@"; do
case $opt in
--tag=*)
export WASM_IMAGE_TAG="${opt#*=}"
shift
;;
--variant=*)
export VARIANT="${opt#*=}"
shift
;;
*)
;;
esac
done
sudo ./kubernetes/cluster/kubectl.sh config set-cluster local --server=https://localhost:6443 --certificate-authority=/var/run/kubernetes/server-ca.crt
sudo ./kubernetes/cluster/kubectl.sh config set-credentials myself --client-key=/var/run/kubernetes/client-admin.key --client-certificate=/var/run/kubernetes/client-admin.crt
sudo ./kubernetes/cluster/kubectl.sh config set-context local --cluster=local --user=myself
sudo ./kubernetes/cluster/kubectl.sh config use-context local
sudo ./kubernetes/cluster/kubectl.sh
# Check
sudo crictl pods
sudo ./kubernetes/cluster/kubectl.sh cluster-info
sudo ./kubernetes/cluster/kubectl.sh run -it --rm --restart=Never wasi-demo \
--image=$WASM_IMAGE:$WASM_IMAGE_TAG \
--annotations="module.wasm.image/variant=$VARIANT" /wasi_example_main.wasm 50000000