### Setting up WasmEdge Docs Locally Source: https://github.com/wasmedge/docs/blob/main/README.md Guides users through cloning the WasmEdge documentation repository, installing project dependencies using npm, and starting the local development server. ```bash git clone https://github.com/WasmEdge/docs.git ``` ```bash npm install ``` ```bash npm start ``` -------------------------------- ### Install WasmEdge Runtime (Bash) Source: https://github.com/wasmedge/docs/blob/main/docs/start/getting-started/quick_start.md Installs the WasmEdge Runtime using a one-liner script. Requires `curl` and `sudo` privileges for system-wide installation, or installs to `$HOME/.wasmedge` if no root access is available. ```bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -p /usr/local ``` ```bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash ``` -------------------------------- ### Build and Run WASM Application (Bash) Source: https://github.com/wasmedge/docs/blob/main/docs/embed/go/reference/0.10.x.md Provides the commands to install the WasmEdge Go SDK, build the Go application, and execute it. This follows the setup and Go code example, demonstrating how to compile and run the WASM-interacting program. ```bash $ go get github.com/second-state/WasmEdge-go/wasmedge@v0.10.1 $ go build $ ./wasmedge_test ``` -------------------------------- ### Install GCC for Building Source: https://github.com/wasmedge/docs/blob/main/docs/develop/javascript/hello_world.md Installs the GCC compiler and essential build tools on Debian/Ubuntu-based systems. This is a prerequisite for building the WasmEdge QuickJS runtime from source. ```bash # Install GCC sudo apt update sudo apt install build-essential ``` -------------------------------- ### Install WasmEdge Runtime Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/start/getting-started/quick_start.md Installs the WasmEdge runtime using a one-line command. Requires root or sudo privileges and pre-installed git and curl. An alternative installation path is provided for users without root access. ```bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -p /usr/local ``` ```bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash ``` -------------------------------- ### Install GCC for Building Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/develop/javascript/hello_world.md Installs the GCC compiler and essential build tools on Debian/Ubuntu-based systems. This is a prerequisite for building the WasmEdge QuickJS runtime from source. ```bash # Install GCC sudo apt update sudo apt install build-essential ``` -------------------------------- ### Setup and Run WasmEdge Go Project Source: https://github.com/wasmedge/docs/blob/main/docs/embed/go/reference/0.10.x.md Provides the necessary bash commands to initialize a Go project, download the WasmEdge Go SDK, build the application, and execute it. This covers the end-to-end workflow for running WASM examples. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test # Assume fibonacci.wasm is in the current directory # Install WasmEdge Go SDK go get github.com/second-state/WasmEdge-go/wasmedge@v0.10.1 # Build the Go application go build # Run the application ./wasmedge_test ``` -------------------------------- ### Clone WasmEdge WASINN Examples Repository Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/whisper.md Clones the WasmEdge WASINN examples repository to access the whisper-basic project. This step is crucial for following the quick start guide and running the AI inference example. ```bash git clone https://github.com/second-state/WasmEdge-WASINN-examples.git cd WasmEdge-WASINN-examples/whisper-basic/ ``` -------------------------------- ### Clone WasmEdge WASINN Examples Repository Source: https://github.com/wasmedge/docs/blob/main/docs/develop/rust/wasinn/whisper.md Clones the WasmEdge WASINN examples repository to access the whisper-basic project. This step is crucial for following the quick start guide and running the AI inference example. ```bash git clone https://github.com/second-state/WasmEdge-WASINN-examples.git cd WasmEdge-WASINN-examples/whisper-basic/ ``` -------------------------------- ### Project Setup with Go Source: https://github.com/wasmedge/docs/blob/main/docs/embed/go/reference/latest.md Commands to initialize a new Go project and install the WasmEdge Go SDK. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test go get github.com/second-state/WasmEdge-go/wasmedge@v{{ wasmedge_go_version }} go build ./wasmedge_test ``` -------------------------------- ### Download Wasm eBPF Example Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md Download a pre-compiled wasm-bpf program example from a GitHub repository. This is a convenient way to get started with testing the eBPF plug-in. ```bash wget https://eunomia-bpf.github.io/wasm-bpf/examples/runqlat/runqlat.wasm ``` -------------------------------- ### Setup and Run WasmEdge Go Project Source: https://github.com/wasmedge/docs/blob/main/docs/embed/go/reference/0.9.x.md Provides essential bash commands for setting up a new Go project, initializing it with Go modules, fetching the WasmEdge-go SDK, building the project, and executing the compiled binary. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test # Then you can build and run: $ go get github.com/second-state/WasmEdge-go/wasmedge@v0.9.2 $ go build $ ./wasmedge_test ``` -------------------------------- ### Download Wasm eBPF Example Source: https://github.com/wasmedge/docs/blob/main/docs/contribute/source/plugin/ebpf.md Download a pre-compiled wasm-bpf program example from a GitHub repository. This is a convenient way to get started with testing the eBPF plug-in. ```bash wget https://eunomia-bpf.github.io/wasm-bpf/examples/runqlat/runqlat.wasm ``` -------------------------------- ### Project Setup and Execution Source: https://github.com/wasmedge/docs/blob/main/docs/embed/go/reference/0.13.x.md Commands to initialize a Go project, download the WasmEdge-go SDK, build the application, and run the WASM execution example. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test go get github.com/second-state/WasmEdge-go/wasmedge@v0.13.5 go build ./wasmedge_test ``` -------------------------------- ### Clone WasmEdge WASINN Examples Repository Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/piper.md Clones the WasmEdge WASINN examples repository from GitHub. This repository contains the project files needed to run AI inference with Piper models, as described in the quick start guide. ```bash git clone https://github.com/second-state/WasmEdge-WASINN-examples.git cd WasmEdge-WASINN-examples/wasmedge-piper/ ``` -------------------------------- ### Project Setup and Execution Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/embed/go/reference/0.13.x.md Commands to initialize a Go project, download the WasmEdge-go SDK, build the application, and run the WASM execution example. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test go get github.com/second-state/WasmEdge-go/wasmedge@v0.13.5 go build ./wasmedge_test ``` -------------------------------- ### Clone WasmEdge WASINN Examples Repository Source: https://github.com/wasmedge/docs/blob/main/docs/develop/rust/wasinn/piper.md Clones the WasmEdge WASINN examples repository from GitHub. This repository contains the project files needed to run AI inference with Piper models, as described in the quick start guide. ```bash git clone https://github.com/second-state/WasmEdge-WASINN-examples.git cd WasmEdge-WASINN-examples/wasmedge-piper/ ``` -------------------------------- ### Bash: WasmEdge Go Project Setup and Execution Source: https://github.com/wasmedge/docs/blob/main/docs/embed/go/reference/0.9.x.md Commands to set up a new Go project, initialize it, download the WasmEdge Go SDK, build the project, and run the WASM execution example. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test $ go get github.com/second-state/WasmEdge-go/wasmedge@v0.9.2 $ go build $ ./wasmedge_test ``` -------------------------------- ### Go Project Setup Source: https://github.com/wasmedge/docs/blob/main/docs/embed/go/reference/0.11.x.md Commands to initialize a new Go project and set up the environment for using the WasmEdge Go SDK. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test ``` -------------------------------- ### Run Standalone WASM App with Docker (Rust) Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/start/getting-started/quick_start_docker.md Executes a standalone Rust WasmEdge application packaged as a Docker container. This example demonstrates the basic setup for running a simple 'Hello WasmEdge!' program. ```bash $ docker run --rm --runtime=io.containerd.wasmedge.v1 --platform=wasi/wasm secondstate/rust-example-hello:latest Hello WasmEdge! ``` -------------------------------- ### Setup and Run WasmEdge Go Project Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/embed/go/reference/0.10.x.md Provides the necessary bash commands to initialize a Go project, download the WasmEdge Go SDK, build the application, and execute it. This covers the end-to-end workflow for running WASM examples. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test # Assume fibonacci.wasm is in the current directory # Install WasmEdge Go SDK go get github.com/second-state/WasmEdge-go/wasmedge@v0.10.1 # Build the Go application go build # Run the application ./wasmedge_test ``` -------------------------------- ### Bash: Setup and Run WasmEdge Go Example Source: https://github.com/wasmedge/docs/blob/main/docs/embed/go/reference/0.13.x.md Provides the necessary bash commands to set up a Go project for WasmEdge, download the required Go module, build the application, and run it. This is a prerequisite for executing the Go code snippet that interacts with WasmEdge. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test # Then you can build and run: $ go get github.com/second-state/WasmEdge-go/wasmedge@v0.13.5 $ go build $ ./wasmedge_test ``` -------------------------------- ### Build and Run Local Kubernetes Cluster Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/develop/deploy/kubernetes/kubernetes-containerd-crun.md Commands to build and start a local Kubernetes cluster using containerd. This process involves installing build essentials and executing the local cluster setup script. ```bash sudo apt-get install -y build-essential sudo CGROUP_DRIVER=systemd CONTAINER_RUNTIME=remote CONTAINER_RUNTIME_ENDPOINT='unix:///var/run/containerd/containerd.sock' ./hack/local-up-cluster.sh ... ... Local Kubernetes cluster is running. Press Ctrl-C to shut it down. ``` -------------------------------- ### Project Setup with Go Source: https://github.com/wasmedge/docs/blob/main/i18n/zh/docusaurus-plugin-content-docs/current/embed/go/reference/latest.md Commands to initialize a new Go project and install the WasmEdge Go SDK. ```bash mkdir wasmedge_test && cd wasmedge_test go mod init wasmedge_test go get github.com/second-state/WasmEdge-go/wasmedge@v{{ wasmedge_go_version }} go build ./wasmedge_test ``` -------------------------------- ### Build and Run Local Kubernetes Cluster Source: https://github.com/wasmedge/docs/blob/main/docs/develop/deploy/kubernetes/kubernetes-containerd-crun.md Commands to build and start a local Kubernetes cluster using containerd. This process involves installing build essentials and executing the local cluster setup script. ```bash sudo apt-get install -y build-essential sudo CGROUP_DRIVER=systemd CONTAINER_RUNTIME=remote CONTAINER_RUNTIME_ENDPOINT='unix:///var/run/containerd/containerd.sock' ./hack/local-up-cluster.sh ... ... Local Kubernetes cluster is running. Press Ctrl-C to shut it down. ``` -------------------------------- ### Download Server Script Source: https://github.com/wasmedge/docs/blob/main/docs/start/getting-started/quick_start.md Downloads the main server.js file, which contains the JavaScript code for the HTTP server. This script defines the server's behavior and how it responds to requests. ```bash wget https://raw.githubusercontent.com/second-state/wasmedge-quickjs/main/example_js/docker_wasm/server/server.js ``` -------------------------------- ### Kubernetes Cluster Setup with kubeadm and crun Source: https://github.com/wasmedge/docs/blob/main/docs/develop/deploy/kubernetes/knative.md Provides a comprehensive guide to setting up a Kubernetes cluster using kubeadm. It covers installing kubeadm, kubectl, and kubelet, initializing the cluster with containerd's CRI socket, installing the Flannel CNI, untainting the master node, and finally adding the crun runtime class to Kubernetes. ```bash # install kubeadm $ sudo apt-get update $ sudo apt-get install -y apt-transport-https ca-certificates curl $ sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg $ echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list $ sudo apt-get update $ sudo apt-get install -y kubelet kubeadm kubectl $ sudo apt-mark hold kubelet kubeadm kubectl # create kubernetes cluster $ swapoff -a $ kubeadm init --pod-network-cidr=10.244.0.0/16 --cri-socket unix:///var/run/containerd/containerd.sock $ export KUBECONFIG=/etc/kubernetes/admin.conf # install cni $ kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml # untaint master node $ kubectl taint nodes --all node-role.kubernetes.io/control-plane- # add crun runtimeClass $ cat > runtime.yaml <