From 6a5c4a884bae8bb4e4587aca8bbe3bdb44d1e2c3 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Thu, 9 Nov 2023 06:03:13 +0600 Subject: [PATCH 1/6] add faq page Signed-off-by: Mahfuza Humayra Mohona --- docs/develop/getting-started/faq.md | 41 +++++++++++++++++++ .../current/develop/getting-started/faq.md | 41 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 docs/develop/getting-started/faq.md create mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/develop/getting-started/faq.md diff --git a/docs/develop/getting-started/faq.md b/docs/develop/getting-started/faq.md new file mode 100644 index 00000000..11d03a7a --- /dev/null +++ b/docs/develop/getting-started/faq.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 4 +--- + +# Frequently Asked Questions + +This FAQ page is designed to address the most common technical inquiries about WasmEdge. If your question is not directly answered here, please refer to the comprehensive WasmEdge documentation or engage with the active WasmEdge community. + +## 1. How does WasmEdge handle memory sharing between modules? + +WasmEdge follows the WebAssembly specification, which currently does not support shared memory between different modules. Each module has its own linear memory space. + +## 2. Can WasmEdge support model training? + +Currently, WasmEdge supports model inference. It uses the WASI-NN API to make predictions using pre-trained models. However, model training is not yet supported. + +## 3. What is the internal flow of WasmEdge? + +The WasmEdge runtime follows a general flow: parsing the Wasm file, validating the parsed Wasm file, compiling the validated Wasm file into native code, and then executing the compiled code. For more detailed information, please refer to the WasmEdge runtime architecture documentation. + +## 4. Why is my plugin crashing? + +If your plugin crashes, it might be due to several reasons. It could be related to incorrect use of the WasmEdge API, or the plugin may be incompatible with the WasmEdge version you're using. It's recommended to debug the plugin using a debugger tool to get more detailed error information. + +## 5. How to create a VM to call `infer()` in a Wasm library? + +You can use the WASI-NN API to call the `infer()` function in a Wasm library. First, you need to prepare the model, inputs, and outputs. Then, you can call the `infer()` function with these parameters. + +## 6. Can WasmEdge support Tensorflow as its inference backend using WASI-NN? + +Yes, WasmEdge can use Tensorflow as its inference backend through the WASI-NN API. + +## 7. How to read a host file in WasmEdge runtime? + +WasmEdge provides the WASI (WebAssembly System Interface) API for interacting with the host system, including file operations. You can use the WASI API to open and read files from the host system. + +## 8. Does WasmEdge only support one backend at the same time? + +WasmEdge can support multiple backends at the same time. For example, it can use both the interpreter and the AOT compiler as backends. However, only one backend can be active for a given Wasm module. + +Remember, this FAQ page is not exhaustive, and the WasmEdge community is always ready to help with any questions or issues you may have. Don't hesitate to reach out if you need assistance in our [Discord server](https://discord.gg/h4KDyB8XTt). diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/getting-started/faq.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/getting-started/faq.md new file mode 100644 index 00000000..11d03a7a --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/getting-started/faq.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 4 +--- + +# Frequently Asked Questions + +This FAQ page is designed to address the most common technical inquiries about WasmEdge. If your question is not directly answered here, please refer to the comprehensive WasmEdge documentation or engage with the active WasmEdge community. + +## 1. How does WasmEdge handle memory sharing between modules? + +WasmEdge follows the WebAssembly specification, which currently does not support shared memory between different modules. Each module has its own linear memory space. + +## 2. Can WasmEdge support model training? + +Currently, WasmEdge supports model inference. It uses the WASI-NN API to make predictions using pre-trained models. However, model training is not yet supported. + +## 3. What is the internal flow of WasmEdge? + +The WasmEdge runtime follows a general flow: parsing the Wasm file, validating the parsed Wasm file, compiling the validated Wasm file into native code, and then executing the compiled code. For more detailed information, please refer to the WasmEdge runtime architecture documentation. + +## 4. Why is my plugin crashing? + +If your plugin crashes, it might be due to several reasons. It could be related to incorrect use of the WasmEdge API, or the plugin may be incompatible with the WasmEdge version you're using. It's recommended to debug the plugin using a debugger tool to get more detailed error information. + +## 5. How to create a VM to call `infer()` in a Wasm library? + +You can use the WASI-NN API to call the `infer()` function in a Wasm library. First, you need to prepare the model, inputs, and outputs. Then, you can call the `infer()` function with these parameters. + +## 6. Can WasmEdge support Tensorflow as its inference backend using WASI-NN? + +Yes, WasmEdge can use Tensorflow as its inference backend through the WASI-NN API. + +## 7. How to read a host file in WasmEdge runtime? + +WasmEdge provides the WASI (WebAssembly System Interface) API for interacting with the host system, including file operations. You can use the WASI API to open and read files from the host system. + +## 8. Does WasmEdge only support one backend at the same time? + +WasmEdge can support multiple backends at the same time. For example, it can use both the interpreter and the AOT compiler as backends. However, only one backend can be active for a given Wasm module. + +Remember, this FAQ page is not exhaustive, and the WasmEdge community is always ready to help with any questions or issues you may have. Don't hesitate to reach out if you need assistance in our [Discord server](https://discord.gg/h4KDyB8XTt). From 9b1027f2b4cf2d2c846106a7538744e00de7a954 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Thu, 23 Nov 2023 12:43:20 +0600 Subject: [PATCH 2/6] plugin Signed-off-by: Mahfuza Humayra Mohona --- docs/contribute/source/plugin/ebpf.md | 99 ++++++++++++++++++- docs/contribute/source/plugin/process.md | 21 +++- docs/contribute/source/plugin/rusttls.md | 67 ++++++++++++- docs/contribute/source/plugin/wasi_crypto.md | 4 + docs/contribute/source/plugin/wasi_logging.md | 13 +++ 5 files changed, 199 insertions(+), 5 deletions(-) diff --git a/docs/contribute/source/plugin/ebpf.md b/docs/contribute/source/plugin/ebpf.md index c6fd54cf..d8275ec0 100644 --- a/docs/contribute/source/plugin/ebpf.md +++ b/docs/contribute/source/plugin/ebpf.md @@ -4,4 +4,101 @@ sidebar_position: 7 # Build with eBPF Plugin -WIP +The eBPF (extended Berkeley Packet Filter) plugin provides an interface to execute eBPF programs in WasmEdge. It allows WasmEdge to execute eBPF code that is compiled into WebAssembly format. This guide will walk you through the steps to build WasmEdge with the eBPF plugin. + +## Build the eBPF Plugin + +### Prerequisites + +Before building the eBPF plugin, ensure that you have the following installed: + +* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](../source/os/linux.md). +* libbpf - This plugin requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. + +### Build steps + +To build the eBPF plugin, run the following commands at the root of the WasmEdge project: + +```bash +cmake -DWASMEDGE_PLUGIN_WASM_BPF:BOOL=TRUE -B ./build -G "Unix Makefiles" +cmake --build ./build +``` + +Make sure to set `WASMEDGE_PLUGIN_WASM_BPF` to `TRUE` in the command line. This toggle controls the build of the `wasm_bpf` plugin. + +## Use the eBPF Plugin + +### Download Examples + +You can download examples of wasm-bpf programs from here: + +```bash +wget https://eunomia-bpf.github.io/wasm-bpf/examples/runqlat/runqlat.wasm +``` + +### Build Examples +You can also build examples of wasm-bpf programs from the `wasm-bpf` repository: + +1. Install the wasi-sdk if you don't have it: + +```bash +wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-17/wasi-sdk-17.0-linux.tar.gz +tar -zxf wasi-sdk-17.0-linux.tar.gz +sudo mkdir -p /opt/wasi-sdk/ && sudo mv wasi-sdk-17.0/* /opt/wasi-sdk/ +``` + +2. Build the examples: +```bash +git clone https://github.com/eunomia-bpf/wasm-bpf +cd wasm-bpf/examples +git submodule update --init --recursive +``` + +3. For example, to build the execve example: +```bash +cd execve && make +``` + +The available examples are: + +```bash +bootstrap execve go-execve go-lsm lsm opensnoop runqlat rust-bootstrap sockfilter sockops +``` + +### Run Examples + +After building, you can find the plugin at `./build/plugins/wasm_bpf/libwasmedgePluginWasmBpf.so` and the WasmEdge CLI tool at `./build/tools/wasmedge/wasmedge`. + +To run the examples, set `WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/` and run wasmedge: + +```bash +WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/ ./build/tools/wasmedge/wasmedge execve.wasm +``` + +Adjust `WASMEDGE_PLUGIN_PATH` according to your build directory of the plugin. + +## Host Functions + +This plugin adds six host functions that give your Wasm application access to eBPF. All of these functions are in the module `wasm_bpf`, if you loaded this plugin: + +```c +/// lookup a bpf map fd by name. +i32 wasm_bpf_map_fd_by_name(u64 obj, u32 name); +/// detach and close a bpf program. +i32 wasm_close_bpf_object(u64 obj); +/// CO-RE load a bpf object into the kernel. +u64 wasm_load_bpf_object(u32 obj_buf, u32 obj_buf_sz); +/// attach a bpf program to a kernel hook. +i32 wasm_attach_bpf_program(u64 obj, u32 name, + u32 attach_target); +/// poll a bpf buffer, and call a wasm callback indicated by sample_func. +/// the first time to call this function will open and create a bpf buffer. +i32 wasm_bpf_buffer_poll(u64 program, i32 fd, u32 sample_func, + u32 ctx, u32 data, i32 max_size, + i32 timeout_ms); +/// lookup, update, delete, and get_next_key operations on a bpf map. +i32 wasm_bpf_map_operate(u64 fd, i32 cmd, u32 key, u32 value, + u32 next_key, u64 flags); +``` + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_bpf). \ No newline at end of file diff --git a/docs/contribute/source/plugin/process.md b/docs/contribute/source/plugin/process.md index a43dae3b..5df7fbae 100644 --- a/docs/contribute/source/plugin/process.md +++ b/docs/contribute/source/plugin/process.md @@ -2,11 +2,13 @@ sidebar_position: 3 --- -# Build WasmEdge With WasmEdge-Process Plug-in +# Build WasmEdge With WasmEdge-Process Plugin + +The WasmEdge Process plugin provides a sandboxed environment to execute system processes in a secured manner. This guide will walk you through the steps to build the WasmEdge Process plugin. ## Prerequisites -The prerequisites of the WasmEdge-Process plug-in is the same as the [WasmEdge building environment on the Linux platforms](../os/linux.md). +The prerequisites of the WasmEdge-Process plugin is the same as the [WasmEdge building environment on the Linux platforms](../os/linux.md). ## Build WasmEdge with WasmEdge-Process Plug-in @@ -22,7 +24,20 @@ cmake --install build :::note -If the built `wasmedge` CLI tool cannot find the WasmEdge-Process plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (such as `/usr/local/lib/wasmedge/`, or the built plug-in path `build/plugins/wasmedge_process/`) to try to fix this issue. +If the built `wasmedge` CLI tool cannot find the WasmEdge-Process plugin, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasmedge_process/`) to try to fix this issue. ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WasmEdge-Process plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasmEdgeProcess.so` after installation. + +## Usage +To use the plugin with WasmEdge, you need to specify it when starting the WasmEdge runtime: + +```bash +wasmedge --dir .:. --reactor --process_plugin target/release/libwasmedge_process.so your_wasm_file.wasm +``` + +Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--process_plugin `flag specifies the path to the Process plugin. + +That's it! You have successfully built and installed the WasmEdge Process plugin. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_process). \ No newline at end of file diff --git a/docs/contribute/source/plugin/rusttls.md b/docs/contribute/source/plugin/rusttls.md index 53691199..af0afdd4 100644 --- a/docs/contribute/source/plugin/rusttls.md +++ b/docs/contribute/source/plugin/rusttls.md @@ -4,4 +4,69 @@ sidebar_position: 8 # Build with Rusttls Plugin -WIP +The WasmEdge Rustls plugin is a replacement for the OpenSSL plugin in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. + +Here's a step-by-step guide on how to build the WasmEdge Rustls plugin: + +# Building the WasmEdge Rustls Plugin + +The WasmEdge Rustls plugin is a replacement for the OpenSSL plugin in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. + +Here's a step-by-step guide on how to build the WasmEdge Rustls plugin: + +## Prerequisites + +Ensure the following dependencies are installed on your system: + +- Rust: You can install it from the [official website](https://www.rust-lang.org/tools/install). +- CMake: Minimum version 3.12. Install it from the [official website](https://cmake.org/download/). + +## Clone the WasmEdge Repository + +First, clone the WasmEdge repository from GitHub: + +```bash +git clone https://github.com/WasmEdge/WasmEdge.git +``` + +## Navigate to the Rustls Plugin Directory + +Navigate to the `wasmedge_rustls` directory within the cloned repository: + +```bash +cd WasmEdge/plugins/wasmedge_rustls +``` + +## Build the Plugin + +Now you can build the Rustls plugin. Run the following command: + +```bash +cargo build --release +``` + +This command builds the plugin in release mode. The compiled binary will be located in the `target/release` directory. + +## Install the Plugin + +To install the plugin, you can use the `cargo install` command: + +```bash +cargo install --path . +``` + +This command will install the built plugin into your Rust binary directory. + +## Usage + +To use the plugin with WasmEdge, you need to specify it when starting the WasmEdge runtime: + +```bash +wasmedge --dir .:. --reactor --rustls_plugin target/release/libwasmedge_rustls.so your_wasm_file.wasm +``` + +Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--rustls_plugin` flag specifies the path to the Rustls plugin. + +That's it! You have successfully built and installed the WasmEdge Rustls plugin. Please ensure to replace the OpenSSL plugin with the Rustls plugin in your WasmEdge runtime configuration if you were previously using OpenSSL. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_crypto). \ No newline at end of file diff --git a/docs/contribute/source/plugin/wasi_crypto.md b/docs/contribute/source/plugin/wasi_crypto.md index 3ca21117..502b0d9c 100644 --- a/docs/contribute/source/plugin/wasi_crypto.md +++ b/docs/contribute/source/plugin/wasi_crypto.md @@ -4,6 +4,8 @@ sidebar_position: 1 # Build with WASI-Crypto Plugin +WebAssembly System Interface (WASI) Crypto is a proposal for a set of APIs that provide cryptographic operations for WebAssembly modules. It aims to provide a consistent, portable, and secure interface for cryptographic operations across different platforms. The WasmEdge WASI-Crypto plugin is an implementation of this proposal, providing cryptographic functionalities to WebAssembly applications running on the WasmEdge runtime. + ## Prerequisites Currently, WasmEdge used `OpenSSL 1.1` or `3.0` for the WASI-Crypto implementation. @@ -75,3 +77,5 @@ If the built `wasmedge` CLI tool cannot find the WASI-Crypto plug-in, you can se ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Crypto plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiCrypto.so` after installation. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_process). diff --git a/docs/contribute/source/plugin/wasi_logging.md b/docs/contribute/source/plugin/wasi_logging.md index a1e6447f..2452e0cd 100644 --- a/docs/contribute/source/plugin/wasi_logging.md +++ b/docs/contribute/source/plugin/wasi_logging.md @@ -4,6 +4,8 @@ sidebar_position: 1 # Build WasmEdge With WASI-Logging Plug-in +WASI-Logging allows WebAssembly applications to log messages in a standardized way. This becomes particularly helpful when debugging applications or understanding the flow of execution within them. The WASI-Logging plugin is designed to be straightforward to use, enabling developers to focus more on their application logic and less on logging mechanics. + ## Prerequisites The prerequisite of the Wasi-Logging plug-in is the same as the WasmEdge building environment on the [Linux](../os/linux.md) and [MacOS](../os/macos.md) platforms. @@ -26,3 +28,14 @@ If the built `wasmedge` CLI tool cannot find the WASI-Logging plug-in, you can s ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Logging plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so` after installation. + +## Loading WASI-Logging Plugin +If the built `wasmedge` CLI tool cannot find the WASI-Logging plugin, set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasi_logging/`) to resolve this issue 1. + +After installation, the `wasmedge` runtime will be located under `/usr/local/bin` and the WASI-Logging plugin under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so`. + +## Using WASI-Logging in Your Applications +You can use the WASI-Logging plugin in your WebAssembly applications to log messages in a standardized way. + + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_logging). \ No newline at end of file From de9ceb8b9239ebe72b143ebacd4fcf5b73028f4b Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Thu, 23 Nov 2023 12:45:05 +0600 Subject: [PATCH 3/6] update existing plugin Signed-off-by: Mahfuza Humayra Mohona --- .../current/contribute/source/plugin/ebpf.md | 99 ++++++++++++++++++- .../contribute/source/plugin/process.md | 21 +++- .../contribute/source/plugin/rusttls.md | 67 ++++++++++++- .../contribute/source/plugin/wasi_crypto.md | 4 + .../contribute/source/plugin/wasi_logging.md | 13 +++ 5 files changed, 199 insertions(+), 5 deletions(-) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md index c6fd54cf..d8275ec0 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md @@ -4,4 +4,101 @@ sidebar_position: 7 # Build with eBPF Plugin -WIP +The eBPF (extended Berkeley Packet Filter) plugin provides an interface to execute eBPF programs in WasmEdge. It allows WasmEdge to execute eBPF code that is compiled into WebAssembly format. This guide will walk you through the steps to build WasmEdge with the eBPF plugin. + +## Build the eBPF Plugin + +### Prerequisites + +Before building the eBPF plugin, ensure that you have the following installed: + +* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](../source/os/linux.md). +* libbpf - This plugin requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. + +### Build steps + +To build the eBPF plugin, run the following commands at the root of the WasmEdge project: + +```bash +cmake -DWASMEDGE_PLUGIN_WASM_BPF:BOOL=TRUE -B ./build -G "Unix Makefiles" +cmake --build ./build +``` + +Make sure to set `WASMEDGE_PLUGIN_WASM_BPF` to `TRUE` in the command line. This toggle controls the build of the `wasm_bpf` plugin. + +## Use the eBPF Plugin + +### Download Examples + +You can download examples of wasm-bpf programs from here: + +```bash +wget https://eunomia-bpf.github.io/wasm-bpf/examples/runqlat/runqlat.wasm +``` + +### Build Examples +You can also build examples of wasm-bpf programs from the `wasm-bpf` repository: + +1. Install the wasi-sdk if you don't have it: + +```bash +wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-17/wasi-sdk-17.0-linux.tar.gz +tar -zxf wasi-sdk-17.0-linux.tar.gz +sudo mkdir -p /opt/wasi-sdk/ && sudo mv wasi-sdk-17.0/* /opt/wasi-sdk/ +``` + +2. Build the examples: +```bash +git clone https://github.com/eunomia-bpf/wasm-bpf +cd wasm-bpf/examples +git submodule update --init --recursive +``` + +3. For example, to build the execve example: +```bash +cd execve && make +``` + +The available examples are: + +```bash +bootstrap execve go-execve go-lsm lsm opensnoop runqlat rust-bootstrap sockfilter sockops +``` + +### Run Examples + +After building, you can find the plugin at `./build/plugins/wasm_bpf/libwasmedgePluginWasmBpf.so` and the WasmEdge CLI tool at `./build/tools/wasmedge/wasmedge`. + +To run the examples, set `WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/` and run wasmedge: + +```bash +WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/ ./build/tools/wasmedge/wasmedge execve.wasm +``` + +Adjust `WASMEDGE_PLUGIN_PATH` according to your build directory of the plugin. + +## Host Functions + +This plugin adds six host functions that give your Wasm application access to eBPF. All of these functions are in the module `wasm_bpf`, if you loaded this plugin: + +```c +/// lookup a bpf map fd by name. +i32 wasm_bpf_map_fd_by_name(u64 obj, u32 name); +/// detach and close a bpf program. +i32 wasm_close_bpf_object(u64 obj); +/// CO-RE load a bpf object into the kernel. +u64 wasm_load_bpf_object(u32 obj_buf, u32 obj_buf_sz); +/// attach a bpf program to a kernel hook. +i32 wasm_attach_bpf_program(u64 obj, u32 name, + u32 attach_target); +/// poll a bpf buffer, and call a wasm callback indicated by sample_func. +/// the first time to call this function will open and create a bpf buffer. +i32 wasm_bpf_buffer_poll(u64 program, i32 fd, u32 sample_func, + u32 ctx, u32 data, i32 max_size, + i32 timeout_ms); +/// lookup, update, delete, and get_next_key operations on a bpf map. +i32 wasm_bpf_map_operate(u64 fd, i32 cmd, u32 key, u32 value, + u32 next_key, u64 flags); +``` + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_bpf). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/process.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/process.md index a43dae3b..5df7fbae 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/process.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/process.md @@ -2,11 +2,13 @@ sidebar_position: 3 --- -# Build WasmEdge With WasmEdge-Process Plug-in +# Build WasmEdge With WasmEdge-Process Plugin + +The WasmEdge Process plugin provides a sandboxed environment to execute system processes in a secured manner. This guide will walk you through the steps to build the WasmEdge Process plugin. ## Prerequisites -The prerequisites of the WasmEdge-Process plug-in is the same as the [WasmEdge building environment on the Linux platforms](../os/linux.md). +The prerequisites of the WasmEdge-Process plugin is the same as the [WasmEdge building environment on the Linux platforms](../os/linux.md). ## Build WasmEdge with WasmEdge-Process Plug-in @@ -22,7 +24,20 @@ cmake --install build :::note -If the built `wasmedge` CLI tool cannot find the WasmEdge-Process plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (such as `/usr/local/lib/wasmedge/`, or the built plug-in path `build/plugins/wasmedge_process/`) to try to fix this issue. +If the built `wasmedge` CLI tool cannot find the WasmEdge-Process plugin, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasmedge_process/`) to try to fix this issue. ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WasmEdge-Process plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasmEdgeProcess.so` after installation. + +## Usage +To use the plugin with WasmEdge, you need to specify it when starting the WasmEdge runtime: + +```bash +wasmedge --dir .:. --reactor --process_plugin target/release/libwasmedge_process.so your_wasm_file.wasm +``` + +Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--process_plugin `flag specifies the path to the Process plugin. + +That's it! You have successfully built and installed the WasmEdge Process plugin. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_process). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/rusttls.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/rusttls.md index 53691199..af0afdd4 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/rusttls.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/rusttls.md @@ -4,4 +4,69 @@ sidebar_position: 8 # Build with Rusttls Plugin -WIP +The WasmEdge Rustls plugin is a replacement for the OpenSSL plugin in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. + +Here's a step-by-step guide on how to build the WasmEdge Rustls plugin: + +# Building the WasmEdge Rustls Plugin + +The WasmEdge Rustls plugin is a replacement for the OpenSSL plugin in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. + +Here's a step-by-step guide on how to build the WasmEdge Rustls plugin: + +## Prerequisites + +Ensure the following dependencies are installed on your system: + +- Rust: You can install it from the [official website](https://www.rust-lang.org/tools/install). +- CMake: Minimum version 3.12. Install it from the [official website](https://cmake.org/download/). + +## Clone the WasmEdge Repository + +First, clone the WasmEdge repository from GitHub: + +```bash +git clone https://github.com/WasmEdge/WasmEdge.git +``` + +## Navigate to the Rustls Plugin Directory + +Navigate to the `wasmedge_rustls` directory within the cloned repository: + +```bash +cd WasmEdge/plugins/wasmedge_rustls +``` + +## Build the Plugin + +Now you can build the Rustls plugin. Run the following command: + +```bash +cargo build --release +``` + +This command builds the plugin in release mode. The compiled binary will be located in the `target/release` directory. + +## Install the Plugin + +To install the plugin, you can use the `cargo install` command: + +```bash +cargo install --path . +``` + +This command will install the built plugin into your Rust binary directory. + +## Usage + +To use the plugin with WasmEdge, you need to specify it when starting the WasmEdge runtime: + +```bash +wasmedge --dir .:. --reactor --rustls_plugin target/release/libwasmedge_rustls.so your_wasm_file.wasm +``` + +Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--rustls_plugin` flag specifies the path to the Rustls plugin. + +That's it! You have successfully built and installed the WasmEdge Rustls plugin. Please ensure to replace the OpenSSL plugin with the Rustls plugin in your WasmEdge runtime configuration if you were previously using OpenSSL. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_crypto). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_crypto.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_crypto.md index 3ca21117..502b0d9c 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_crypto.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_crypto.md @@ -4,6 +4,8 @@ sidebar_position: 1 # Build with WASI-Crypto Plugin +WebAssembly System Interface (WASI) Crypto is a proposal for a set of APIs that provide cryptographic operations for WebAssembly modules. It aims to provide a consistent, portable, and secure interface for cryptographic operations across different platforms. The WasmEdge WASI-Crypto plugin is an implementation of this proposal, providing cryptographic functionalities to WebAssembly applications running on the WasmEdge runtime. + ## Prerequisites Currently, WasmEdge used `OpenSSL 1.1` or `3.0` for the WASI-Crypto implementation. @@ -75,3 +77,5 @@ If the built `wasmedge` CLI tool cannot find the WASI-Crypto plug-in, you can se ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Crypto plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiCrypto.so` after installation. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_process). diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_logging.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_logging.md index a1e6447f..2452e0cd 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_logging.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_logging.md @@ -4,6 +4,8 @@ sidebar_position: 1 # Build WasmEdge With WASI-Logging Plug-in +WASI-Logging allows WebAssembly applications to log messages in a standardized way. This becomes particularly helpful when debugging applications or understanding the flow of execution within them. The WASI-Logging plugin is designed to be straightforward to use, enabling developers to focus more on their application logic and less on logging mechanics. + ## Prerequisites The prerequisite of the Wasi-Logging plug-in is the same as the WasmEdge building environment on the [Linux](../os/linux.md) and [MacOS](../os/macos.md) platforms. @@ -26,3 +28,14 @@ If the built `wasmedge` CLI tool cannot find the WASI-Logging plug-in, you can s ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Logging plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so` after installation. + +## Loading WASI-Logging Plugin +If the built `wasmedge` CLI tool cannot find the WASI-Logging plugin, set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasi_logging/`) to resolve this issue 1. + +After installation, the `wasmedge` runtime will be located under `/usr/local/bin` and the WASI-Logging plugin under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so`. + +## Using WASI-Logging in Your Applications +You can use the WASI-Logging plugin in your WebAssembly applications to log messages in a standardized way. + + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_logging). \ No newline at end of file From 0204599191b12fd6a81343120a27f4b03503826e Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Fri, 24 Nov 2023 18:26:55 +0600 Subject: [PATCH 4/6] add github link Signed-off-by: Mahfuza Humayra Mohona --- docs/contribute/source/plugin/ebpf.md | 24 +++++------ docs/contribute/source/plugin/image.md | 6 ++- docs/contribute/source/plugin/process.md | 16 ++++---- docs/contribute/source/plugin/rusttls.md | 32 +++++++-------- docs/contribute/source/plugin/tensorflow.md | 6 ++- .../source/plugin/tensorflowlite.md | 6 ++- docs/contribute/source/plugin/wasi_crypto.md | 6 +-- docs/contribute/source/plugin/wasi_logging.md | 12 +++--- docs/contribute/source/plugin/wasi_nn.md | 12 ++++-- docs/develop/getting-started/faq.md | 41 ------------------- .../current/develop/getting-started/faq.md | 41 ------------------- 11 files changed, 68 insertions(+), 134 deletions(-) delete mode 100644 docs/develop/getting-started/faq.md delete mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/develop/getting-started/faq.md diff --git a/docs/contribute/source/plugin/ebpf.md b/docs/contribute/source/plugin/ebpf.md index d8275ec0..c177ff61 100644 --- a/docs/contribute/source/plugin/ebpf.md +++ b/docs/contribute/source/plugin/ebpf.md @@ -2,31 +2,31 @@ sidebar_position: 7 --- -# Build with eBPF Plugin +# Build with eBPF Plug-in -The eBPF (extended Berkeley Packet Filter) plugin provides an interface to execute eBPF programs in WasmEdge. It allows WasmEdge to execute eBPF code that is compiled into WebAssembly format. This guide will walk you through the steps to build WasmEdge with the eBPF plugin. +The eBPF (extended Berkeley Packet Filter) plug-in provides an interface to execute eBPF programs in WasmEdge. It allows WasmEdge to execute eBPF code that is compiled into WebAssembly format. This guide will walk you through the steps to build WasmEdge with the eBPF plug-in. -## Build the eBPF Plugin +## Build the eBPF Plug-in ### Prerequisites -Before building the eBPF plugin, ensure that you have the following installed: +Before building the eBPF plug-in, ensure that you have the following installed: -* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](../source/os/linux.md). -* libbpf - This plugin requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. +* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](../os/linux.md). +* libbpf - This plug-in requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. ### Build steps -To build the eBPF plugin, run the following commands at the root of the WasmEdge project: +To build the eBPF plug-in, run the following commands at the root of the WasmEdge project: ```bash cmake -DWASMEDGE_PLUGIN_WASM_BPF:BOOL=TRUE -B ./build -G "Unix Makefiles" cmake --build ./build ``` -Make sure to set `WASMEDGE_PLUGIN_WASM_BPF` to `TRUE` in the command line. This toggle controls the build of the `wasm_bpf` plugin. +Make sure to set `WASMEDGE_PLUGIN_WASM_BPF` to `TRUE` in the command line. This toggle controls the build of the `wasm_bpf` plug-in. -## Use the eBPF Plugin +## Use the eBPF Plug-in ### Download Examples @@ -67,7 +67,7 @@ bootstrap execve go-execve go-lsm lsm opensnoop runqlat rust-bootstrap s ### Run Examples -After building, you can find the plugin at `./build/plugins/wasm_bpf/libwasmedgePluginWasmBpf.so` and the WasmEdge CLI tool at `./build/tools/wasmedge/wasmedge`. +After building, you can find the plug-in at `./build/plugins/wasm_bpf/libwasmedgePluginWasmBpf.so` and the WasmEdge CLI tool at `./build/tools/wasmedge/wasmedge`. To run the examples, set `WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/` and run wasmedge: @@ -75,11 +75,11 @@ To run the examples, set `WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/` and ru WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/ ./build/tools/wasmedge/wasmedge execve.wasm ``` -Adjust `WASMEDGE_PLUGIN_PATH` according to your build directory of the plugin. +Adjust `WASMEDGE_PLUGIN_PATH` according to your build directory of the plug-in. ## Host Functions -This plugin adds six host functions that give your Wasm application access to eBPF. All of these functions are in the module `wasm_bpf`, if you loaded this plugin: +This plug-in adds six host functions that give your Wasm application access to eBPF. All of these functions are in the module `wasm_bpf`, if you loaded this plug-in: ```c /// lookup a bpf map fd by name. diff --git a/docs/contribute/source/plugin/image.md b/docs/contribute/source/plugin/image.md index d7087021..fa2001cc 100644 --- a/docs/contribute/source/plugin/image.md +++ b/docs/contribute/source/plugin/image.md @@ -4,6 +4,8 @@ sidebar_position: 4 # Build WasmEdge With WasmEdge-Image Plug-in +The WasmEdge Image plug-in is a software component that extends the functionality of the WasmEdge runtime, enabling it to load and decode JPEG and PNG images and convert them into tensors. This plug-in is useful for developers who need to process image data within their WebAssembly applications. + ## Prerequisites The prerequisites of the WasmEdge-Image plug-in is the same as the WasmEdge building environment on the [Linux platforms](../os/linux.md) or [MacOS platforms](../os/macos.md). @@ -29,7 +31,7 @@ To enable the WasmEdge WasmEdge-Image, developers need to [building the WasmEdge cd cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_IMAGE=On cmake --build build -# For the WasmEdge-Image plugin, you should install this project. +# For the WasmEdge-Image plug-in, you should install this project. cmake --install build ``` @@ -39,3 +41,5 @@ If the built `wasmedge` CLI tool cannot find the WasmEdge-Image plug-in, you can ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WasmEdge-Image plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasmEdgeImage.so` after installation. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_image). \ No newline at end of file diff --git a/docs/contribute/source/plugin/process.md b/docs/contribute/source/plugin/process.md index 5df7fbae..16d11145 100644 --- a/docs/contribute/source/plugin/process.md +++ b/docs/contribute/source/plugin/process.md @@ -2,13 +2,13 @@ sidebar_position: 3 --- -# Build WasmEdge With WasmEdge-Process Plugin +# Build WasmEdge With WasmEdge-Process Plug-in -The WasmEdge Process plugin provides a sandboxed environment to execute system processes in a secured manner. This guide will walk you through the steps to build the WasmEdge Process plugin. +The WasmEdge Process plug-in provides a sandboxed environment to execute system processes in a secured manner. This guide will walk you through the steps to build the WasmEdge Process plug-in. ## Prerequisites -The prerequisites of the WasmEdge-Process plugin is the same as the [WasmEdge building environment on the Linux platforms](../os/linux.md). +The prerequisites of the WasmEdge-Process plug-in is the same as the [WasmEdge building environment on the Linux platforms](../os/linux.md). ## Build WasmEdge with WasmEdge-Process Plug-in @@ -18,26 +18,26 @@ To enable the WasmEdge WasmEdge-Process, developers need to [building the WasmEd cd cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_PROCESS=On cmake --build build -# For the WasmEdge-Process plugin, you should install this project. +# For the WasmEdge-Process plug-in, you should install this project. cmake --install build ``` :::note -If the built `wasmedge` CLI tool cannot find the WasmEdge-Process plugin, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasmedge_process/`) to try to fix this issue. +If the built `wasmedge` CLI tool cannot find the WasmEdge-Process plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (such as `/usr/local/lib/wasmedge/`, or the built plug-in path `build/plugins/wasmedge_process/`) to try to fix this issue. ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WasmEdge-Process plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasmEdgeProcess.so` after installation. ## Usage -To use the plugin with WasmEdge, you need to specify it when starting the WasmEdge runtime: +To use the plug-in with WasmEdge, you need to specify it when starting the WasmEdge runtime: ```bash wasmedge --dir .:. --reactor --process_plugin target/release/libwasmedge_process.so your_wasm_file.wasm ``` -Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--process_plugin `flag specifies the path to the Process plugin. +Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--process_plugin `flag specifies the path to the Process plug-in. -That's it! You have successfully built and installed the WasmEdge Process plugin. +That's it! You have successfully built and installed the WasmEdge Process plug-in. For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_process). \ No newline at end of file diff --git a/docs/contribute/source/plugin/rusttls.md b/docs/contribute/source/plugin/rusttls.md index af0afdd4..25140d05 100644 --- a/docs/contribute/source/plugin/rusttls.md +++ b/docs/contribute/source/plugin/rusttls.md @@ -2,17 +2,17 @@ sidebar_position: 8 --- -# Build with Rusttls Plugin +# Build with Rusttls Plug-in -The WasmEdge Rustls plugin is a replacement for the OpenSSL plugin in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. +The WasmEdge Rustls plug-in is a replacement for the OpenSSL plug-in in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. -Here's a step-by-step guide on how to build the WasmEdge Rustls plugin: +Here's a step-by-step guide on how to build the WasmEdge Rustls plug-in: -# Building the WasmEdge Rustls Plugin +# Building the WasmEdge Rustls Plug-in -The WasmEdge Rustls plugin is a replacement for the OpenSSL plugin in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. +The WasmEdge Rustls plug-in is a replacement for the OpenSSL plug-in in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. -Here's a step-by-step guide on how to build the WasmEdge Rustls plugin: +Here's a step-by-step guide on how to build the WasmEdge Rustls plug-in: ## Prerequisites @@ -29,7 +29,7 @@ First, clone the WasmEdge repository from GitHub: git clone https://github.com/WasmEdge/WasmEdge.git ``` -## Navigate to the Rustls Plugin Directory +## Navigate to the Rustls Plug-in Directory Navigate to the `wasmedge_rustls` directory within the cloned repository: @@ -37,36 +37,36 @@ Navigate to the `wasmedge_rustls` directory within the cloned repository: cd WasmEdge/plugins/wasmedge_rustls ``` -## Build the Plugin +## Build the Plug-in -Now you can build the Rustls plugin. Run the following command: +Now you can build the Rustls plug-in. Run the following command: ```bash cargo build --release ``` -This command builds the plugin in release mode. The compiled binary will be located in the `target/release` directory. +This command builds the plug-in in release mode. The compiled binary will be located in the `target/release` directory. -## Install the Plugin +## Install the Plug-in -To install the plugin, you can use the `cargo install` command: +To install the plug-in, you can use the `cargo install` command: ```bash cargo install --path . ``` -This command will install the built plugin into your Rust binary directory. +This command will install the built plug-in into your Rust binary directory. ## Usage -To use the plugin with WasmEdge, you need to specify it when starting the WasmEdge runtime: +To use the plug-in with WasmEdge, you need to specify it when starting the WasmEdge runtime: ```bash wasmedge --dir .:. --reactor --rustls_plugin target/release/libwasmedge_rustls.so your_wasm_file.wasm ``` -Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--rustls_plugin` flag specifies the path to the Rustls plugin. +Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--rustls_plugin` flag specifies the path to the Rustls plug-in. -That's it! You have successfully built and installed the WasmEdge Rustls plugin. Please ensure to replace the OpenSSL plugin with the Rustls plugin in your WasmEdge runtime configuration if you were previously using OpenSSL. +That's it! You have successfully built and installed the WasmEdge Rustls plug-in. Please ensure to replace the OpenSSL plug-in with the Rustls plug-in in your WasmEdge runtime configuration if you were previously using OpenSSL. For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_crypto). \ No newline at end of file diff --git a/docs/contribute/source/plugin/tensorflow.md b/docs/contribute/source/plugin/tensorflow.md index e2a974d1..135f8089 100644 --- a/docs/contribute/source/plugin/tensorflow.md +++ b/docs/contribute/source/plugin/tensorflow.md @@ -4,6 +4,8 @@ sidebar_position: 5 # Build WasmEdge With WasmEdge-Tensorflow Plug-in +The WasmEdge-TensorFlow plug-in is a software component that extends the functionality of the WasmEdge runtime. It allows developers to perform TensorFlow model inference with similar APIs to Python. The plug-in is designed for Rust to WebAssembly applications and depends on the TensorFlow C library for its operations. + ## Prerequisites The prerequisites of the WasmEdge-Tensorflow plug-in is the same as the WasmEdge building environment on the [Linux platforms](../os/linux.md) or [MacOS platforms](../os/macos.md). @@ -16,7 +18,7 @@ To enable the WasmEdge WasmEdge-Tensorflow, developers need to [building the Was cd cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_TENSORFLOW=On cmake --build build -# For the WasmEdge-Tensorflow plugin, you should install this project. +# For the WasmEdge-Tensorflow plug-in, you should install this project. cmake --install build ``` @@ -70,3 +72,5 @@ ln -s libtensorflow_framework.2.dylib /usr/local/lib/libtensorflow_framework.dyl ``` Or create the symbolic link in the current directory and set the environment variable `export LD_LIBRARY_PATH=$(pwd):${LD_LIBRARY_PATH}`. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_tensorflow). \ No newline at end of file diff --git a/docs/contribute/source/plugin/tensorflowlite.md b/docs/contribute/source/plugin/tensorflowlite.md index cffa86aa..773c9eee 100644 --- a/docs/contribute/source/plugin/tensorflowlite.md +++ b/docs/contribute/source/plugin/tensorflowlite.md @@ -4,6 +4,8 @@ sidebar_position: 6 # Build WasmEdge With WasmEdge-TensorflowLite Plug-in +The WasmEdge-TensorflowLite plug-in is a software component that extends the functionality of the WasmEdge runtime to perform TensorFlow-Lite model inference. It allows WebAssembly applications to access TensorFlow-Lite functionality when executed on the WasmEdge runtime. The plugin provides a bridge between the WasmEdge runtime and the TensorFlow-Lite backend, allowing developers to execute machine learning models within WebAssembly applications. + ## Prerequisites The prerequisites of the WasmEdge-TensorflowLite plug-in is the same as the WasmEdge building environment on the [Linux platforms](../os/linux.md) or [MacOS platforms](../os/macos.md). @@ -16,7 +18,7 @@ To enable the WasmEdge WasmEdge-TensorflowLite, developers need to [building the cd cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_TENSORFLOWLITE=On cmake --build build -# For the WasmEdge-TensorflowLite plugin, you should install this project. +# For the WasmEdge-TensorflowLite plug-in, you should install this project. cmake --install build ``` @@ -62,3 +64,5 @@ mv libtensorflowlite_flex.dylib /usr/local/lib ``` Or set the environment variable `export LD_LIBRARY_PATH=$(pwd):${LD_LIBRARY_PATH}`. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_tensorflowlite). diff --git a/docs/contribute/source/plugin/wasi_crypto.md b/docs/contribute/source/plugin/wasi_crypto.md index 502b0d9c..4f83efa8 100644 --- a/docs/contribute/source/plugin/wasi_crypto.md +++ b/docs/contribute/source/plugin/wasi_crypto.md @@ -2,9 +2,9 @@ sidebar_position: 1 --- -# Build with WASI-Crypto Plugin +# Build with WASI-Crypto Plug-in -WebAssembly System Interface (WASI) Crypto is a proposal for a set of APIs that provide cryptographic operations for WebAssembly modules. It aims to provide a consistent, portable, and secure interface for cryptographic operations across different platforms. The WasmEdge WASI-Crypto plugin is an implementation of this proposal, providing cryptographic functionalities to WebAssembly applications running on the WasmEdge runtime. +WebAssembly System Interface (WASI) Crypto is a proposal for a set of APIs that provide cryptographic operations for WebAssembly modules. It aims to provide a consistent, portable, and secure interface for cryptographic operations across different platforms. The WasmEdge WASI-Crypto plug-in is an implementation of this proposal, providing cryptographic functionalities to WebAssembly applications running on the WasmEdge runtime. ## Prerequisites @@ -67,7 +67,7 @@ cd # On MacOS, it may be: `-DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl` cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_WASI_CRYPTO=On cmake --build build -# For the WASI-Crypto plugin, you should install this project. +# For the WASI-Crypto plug-in, you should install this project. cmake --install build ``` diff --git a/docs/contribute/source/plugin/wasi_logging.md b/docs/contribute/source/plugin/wasi_logging.md index 2452e0cd..0bf20a01 100644 --- a/docs/contribute/source/plugin/wasi_logging.md +++ b/docs/contribute/source/plugin/wasi_logging.md @@ -4,7 +4,7 @@ sidebar_position: 1 # Build WasmEdge With WASI-Logging Plug-in -WASI-Logging allows WebAssembly applications to log messages in a standardized way. This becomes particularly helpful when debugging applications or understanding the flow of execution within them. The WASI-Logging plugin is designed to be straightforward to use, enabling developers to focus more on their application logic and less on logging mechanics. +WASI-Logging allows WebAssembly applications to log messages in a standardized way. This becomes particularly helpful when debugging applications or understanding the flow of execution within them. The WASI-Logging plug-in is designed to be straightforward to use, enabling developers to focus more on their application logic and less on logging mechanics. ## Prerequisites @@ -27,15 +27,15 @@ cmake --install . If the built `wasmedge` CLI tool cannot find the WASI-Logging plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (`/usr/local/lib/wasmedge`, or the built plug-in path `build/plugins/wasi_logging`) to try to fix this issue. You should find `libwasmedgePluginWasiLogging.so` in your `WASMEDGE_PLUGIN_PATH` ::: -Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Logging plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so` after installation. +Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Logging plugin under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so` after installation. -## Loading WASI-Logging Plugin -If the built `wasmedge` CLI tool cannot find the WASI-Logging plugin, set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasi_logging/`) to resolve this issue 1. +## Loading WASI-Logging Plug-in +If the built `wasmedge` CLI tool cannot find the WASI-Logging plug-in, set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (such as `/usr/local/lib/wasmedge/`, or the built plug-in path `build/plugins/wasi_logging/`) to resolve this issue 1. -After installation, the `wasmedge` runtime will be located under `/usr/local/bin` and the WASI-Logging plugin under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so`. +After installation, the `wasmedge` runtime will be located under `/usr/local/bin` and the WASI-Logging plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so`. ## Using WASI-Logging in Your Applications -You can use the WASI-Logging plugin in your WebAssembly applications to log messages in a standardized way. +You can use the WASI-Logging plug-in in your WebAssembly applications to log messages in a standardized way. For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_logging). \ No newline at end of file diff --git a/docs/contribute/source/plugin/wasi_nn.md b/docs/contribute/source/plugin/wasi_nn.md index 6c06c8d4..0f069fca 100644 --- a/docs/contribute/source/plugin/wasi_nn.md +++ b/docs/contribute/source/plugin/wasi_nn.md @@ -2,7 +2,9 @@ sidebar_position: 2 --- -# Build with WASI-nn Plugin +# Build with WASI-nn Plug-in + +The WASI-NN plug-in is a proposed WebAssembly System Interface (WASI) API for machine learning. It allows WebAssembly programs to access host-provided machine learning functions. ## Prerequisites @@ -31,7 +33,7 @@ Then build and install WasmEdge from source: cd cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_WASI_NN_BACKEND="OpenVINO" cmake --build build -# For the WASI-NN plugin, you should install this project. +# For the WASI-NN plug-in, you should install this project. cmake --install build ``` @@ -99,10 +101,10 @@ cmake --install build :::note -If the built `wasmedge` CLI tool cannot find the WASI-NN plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (such as `/usr/local/lib/wasmedge/`, or the built plug-in path `build/plugins/wasi_nn/`) to try to fix this issue. +If the built `wasmedge` CLI tool cannot find the WASI-NN plugin, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasi_nn/`) to try to fix this issue. ::: -Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-NN with OpenVINO backend plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiNN.so` after installation. +Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-NN with OpenVINO backend plugin under `/usr/local/lib/wasmedge/libwasmedgePluginWasiNN.so` after installation. Installing the necessary `libtensorflowlite_c.so` and `libtensorflowlite_flex.so` on both `Ubuntu 20.04` and `manylinux2014` for the backend, we recommend the following commands: @@ -127,3 +129,5 @@ Or set the environment variable `export LD_LIBRARY_PATH=$(pwd):${LD_LIBRARY_PATH :::note We also provided the `darwin_x86_64`, `darwin_arm64`, and `manylinux_aarch64` versions of the TensorFlow-Lite pre-built shared libraries. ::: + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_nn). \ No newline at end of file diff --git a/docs/develop/getting-started/faq.md b/docs/develop/getting-started/faq.md deleted file mode 100644 index 11d03a7a..00000000 --- a/docs/develop/getting-started/faq.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -sidebar_position: 4 ---- - -# Frequently Asked Questions - -This FAQ page is designed to address the most common technical inquiries about WasmEdge. If your question is not directly answered here, please refer to the comprehensive WasmEdge documentation or engage with the active WasmEdge community. - -## 1. How does WasmEdge handle memory sharing between modules? - -WasmEdge follows the WebAssembly specification, which currently does not support shared memory between different modules. Each module has its own linear memory space. - -## 2. Can WasmEdge support model training? - -Currently, WasmEdge supports model inference. It uses the WASI-NN API to make predictions using pre-trained models. However, model training is not yet supported. - -## 3. What is the internal flow of WasmEdge? - -The WasmEdge runtime follows a general flow: parsing the Wasm file, validating the parsed Wasm file, compiling the validated Wasm file into native code, and then executing the compiled code. For more detailed information, please refer to the WasmEdge runtime architecture documentation. - -## 4. Why is my plugin crashing? - -If your plugin crashes, it might be due to several reasons. It could be related to incorrect use of the WasmEdge API, or the plugin may be incompatible with the WasmEdge version you're using. It's recommended to debug the plugin using a debugger tool to get more detailed error information. - -## 5. How to create a VM to call `infer()` in a Wasm library? - -You can use the WASI-NN API to call the `infer()` function in a Wasm library. First, you need to prepare the model, inputs, and outputs. Then, you can call the `infer()` function with these parameters. - -## 6. Can WasmEdge support Tensorflow as its inference backend using WASI-NN? - -Yes, WasmEdge can use Tensorflow as its inference backend through the WASI-NN API. - -## 7. How to read a host file in WasmEdge runtime? - -WasmEdge provides the WASI (WebAssembly System Interface) API for interacting with the host system, including file operations. You can use the WASI API to open and read files from the host system. - -## 8. Does WasmEdge only support one backend at the same time? - -WasmEdge can support multiple backends at the same time. For example, it can use both the interpreter and the AOT compiler as backends. However, only one backend can be active for a given Wasm module. - -Remember, this FAQ page is not exhaustive, and the WasmEdge community is always ready to help with any questions or issues you may have. Don't hesitate to reach out if you need assistance in our [Discord server](https://discord.gg/h4KDyB8XTt). diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/getting-started/faq.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/getting-started/faq.md deleted file mode 100644 index 11d03a7a..00000000 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/getting-started/faq.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -sidebar_position: 4 ---- - -# Frequently Asked Questions - -This FAQ page is designed to address the most common technical inquiries about WasmEdge. If your question is not directly answered here, please refer to the comprehensive WasmEdge documentation or engage with the active WasmEdge community. - -## 1. How does WasmEdge handle memory sharing between modules? - -WasmEdge follows the WebAssembly specification, which currently does not support shared memory between different modules. Each module has its own linear memory space. - -## 2. Can WasmEdge support model training? - -Currently, WasmEdge supports model inference. It uses the WASI-NN API to make predictions using pre-trained models. However, model training is not yet supported. - -## 3. What is the internal flow of WasmEdge? - -The WasmEdge runtime follows a general flow: parsing the Wasm file, validating the parsed Wasm file, compiling the validated Wasm file into native code, and then executing the compiled code. For more detailed information, please refer to the WasmEdge runtime architecture documentation. - -## 4. Why is my plugin crashing? - -If your plugin crashes, it might be due to several reasons. It could be related to incorrect use of the WasmEdge API, or the plugin may be incompatible with the WasmEdge version you're using. It's recommended to debug the plugin using a debugger tool to get more detailed error information. - -## 5. How to create a VM to call `infer()` in a Wasm library? - -You can use the WASI-NN API to call the `infer()` function in a Wasm library. First, you need to prepare the model, inputs, and outputs. Then, you can call the `infer()` function with these parameters. - -## 6. Can WasmEdge support Tensorflow as its inference backend using WASI-NN? - -Yes, WasmEdge can use Tensorflow as its inference backend through the WASI-NN API. - -## 7. How to read a host file in WasmEdge runtime? - -WasmEdge provides the WASI (WebAssembly System Interface) API for interacting with the host system, including file operations. You can use the WASI API to open and read files from the host system. - -## 8. Does WasmEdge only support one backend at the same time? - -WasmEdge can support multiple backends at the same time. For example, it can use both the interpreter and the AOT compiler as backends. However, only one backend can be active for a given Wasm module. - -Remember, this FAQ page is not exhaustive, and the WasmEdge community is always ready to help with any questions or issues you may have. Don't hesitate to reach out if you need assistance in our [Discord server](https://discord.gg/h4KDyB8XTt). From b2fa3538cd000fab6c43200e96b8318872a90c90 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Fri, 24 Nov 2023 19:39:21 +0600 Subject: [PATCH 5/6] fix hyperlink Signed-off-by: Mahfuza Humayra Mohona --- docs/contribute/source/plugin/ebpf.md | 2 +- .../current/contribute/source/plugin/ebpf.md | 22 ++++++------- .../current/contribute/source/plugin/image.md | 4 +++ .../contribute/source/plugin/process.md | 16 +++++----- .../contribute/source/plugin/rusttls.md | 32 +++++++++---------- .../contribute/source/plugin/tensorflow.md | 4 +++ .../source/plugin/tensorflowlite.md | 4 +++ .../contribute/source/plugin/wasi_crypto.md | 2 +- .../contribute/source/plugin/wasi_logging.md | 12 +++---- .../contribute/source/plugin/wasi_nn.md | 4 +++ 10 files changed, 59 insertions(+), 43 deletions(-) diff --git a/docs/contribute/source/plugin/ebpf.md b/docs/contribute/source/plugin/ebpf.md index 514d8015..acbee0cb 100644 --- a/docs/contribute/source/plugin/ebpf.md +++ b/docs/contribute/source/plugin/ebpf.md @@ -12,7 +12,7 @@ The eBPF (extended Berkeley Packet Filter) plug-in provides an interface to exec Before building the eBPF plug-in, ensure that you have the following installed: -* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](../os/linux.md). +* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](./os/linux.md). * libbpf - This plug-in requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. ### Build steps diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md index 60e341e9..acbee0cb 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md @@ -4,29 +4,29 @@ sidebar_position: 7 # Build with eBPF Plug-in -The eBPF (extended Berkeley Packet Filter) plugin provides an interface to execute eBPF programs in WasmEdge. It allows WasmEdge to execute eBPF code that is compiled into WebAssembly format. This guide will walk you through the steps to build WasmEdge with the eBPF plugin. +The eBPF (extended Berkeley Packet Filter) plug-in provides an interface to execute eBPF programs in WasmEdge. It allows WasmEdge to execute eBPF code that is compiled into WebAssembly format. This guide will walk you through the steps to build WasmEdge with the eBPF plug-in. -## Build the eBPF Plugin +## Build the eBPF Plug-in ### Prerequisites -Before building the eBPF plugin, ensure that you have the following installed: +Before building the eBPF plug-in, ensure that you have the following installed: -* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](../source/os/linux.md). -* libbpf - This plugin requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. +* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](./os/linux.md). +* libbpf - This plug-in requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. ### Build steps -To build the eBPF plugin, run the following commands at the root of the WasmEdge project: +To build the eBPF plug-in, run the following commands at the root of the WasmEdge project: ```bash cmake -DWASMEDGE_PLUGIN_WASM_BPF:BOOL=TRUE -B ./build -G "Unix Makefiles" cmake --build ./build ``` -Make sure to set `WASMEDGE_PLUGIN_WASM_BPF` to `TRUE` in the command line. This toggle controls the build of the `wasm_bpf` plugin. +Make sure to set `WASMEDGE_PLUGIN_WASM_BPF` to `TRUE` in the command line. This toggle controls the build of the `wasm_bpf` plug-in. -## Use the eBPF Plugin +## Use the eBPF Plug-in ### Download Examples @@ -67,7 +67,7 @@ bootstrap execve go-execve go-lsm lsm opensnoop runqlat rust-bootstrap s ### Run Examples -After building, you can find the plugin at `./build/plugins/wasm_bpf/libwasmedgePluginWasmBpf.so` and the WasmEdge CLI tool at `./build/tools/wasmedge/wasmedge`. +After building, you can find the plug-in at `./build/plugins/wasm_bpf/libwasmedgePluginWasmBpf.so` and the WasmEdge CLI tool at `./build/tools/wasmedge/wasmedge`. To run the examples, set `WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/` and run wasmedge: @@ -75,11 +75,11 @@ To run the examples, set `WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/` and ru WASMEDGE_PLUGIN_PATH=./build/plugins/wasm_bpf/ ./build/tools/wasmedge/wasmedge execve.wasm ``` -Adjust `WASMEDGE_PLUGIN_PATH` according to your build directory of the plugin. +Adjust `WASMEDGE_PLUGIN_PATH` according to your build directory of the plug-in. ## Host Functions -This plugin adds six host functions that give your Wasm application access to eBPF. All of these functions are in the module `wasm_bpf`, if you loaded this plugin: +This plug-in adds six host functions that give your Wasm application access to eBPF. All of these functions are in the module `wasm_bpf`, if you loaded this plug-in: ```c /// lookup a bpf map fd by name. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/image.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/image.md index 42c685c5..fa2001cc 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/image.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/image.md @@ -4,6 +4,8 @@ sidebar_position: 4 # Build WasmEdge With WasmEdge-Image Plug-in +The WasmEdge Image plug-in is a software component that extends the functionality of the WasmEdge runtime, enabling it to load and decode JPEG and PNG images and convert them into tensors. This plug-in is useful for developers who need to process image data within their WebAssembly applications. + ## Prerequisites The prerequisites of the WasmEdge-Image plug-in is the same as the WasmEdge building environment on the [Linux platforms](../os/linux.md) or [MacOS platforms](../os/macos.md). @@ -39,3 +41,5 @@ If the built `wasmedge` CLI tool cannot find the WasmEdge-Image plug-in, you can ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WasmEdge-Image plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasmEdgeImage.so` after installation. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_image). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/process.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/process.md index 5df7fbae..16d11145 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/process.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/process.md @@ -2,13 +2,13 @@ sidebar_position: 3 --- -# Build WasmEdge With WasmEdge-Process Plugin +# Build WasmEdge With WasmEdge-Process Plug-in -The WasmEdge Process plugin provides a sandboxed environment to execute system processes in a secured manner. This guide will walk you through the steps to build the WasmEdge Process plugin. +The WasmEdge Process plug-in provides a sandboxed environment to execute system processes in a secured manner. This guide will walk you through the steps to build the WasmEdge Process plug-in. ## Prerequisites -The prerequisites of the WasmEdge-Process plugin is the same as the [WasmEdge building environment on the Linux platforms](../os/linux.md). +The prerequisites of the WasmEdge-Process plug-in is the same as the [WasmEdge building environment on the Linux platforms](../os/linux.md). ## Build WasmEdge with WasmEdge-Process Plug-in @@ -18,26 +18,26 @@ To enable the WasmEdge WasmEdge-Process, developers need to [building the WasmEd cd cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_PLUGIN_PROCESS=On cmake --build build -# For the WasmEdge-Process plugin, you should install this project. +# For the WasmEdge-Process plug-in, you should install this project. cmake --install build ``` :::note -If the built `wasmedge` CLI tool cannot find the WasmEdge-Process plugin, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasmedge_process/`) to try to fix this issue. +If the built `wasmedge` CLI tool cannot find the WasmEdge-Process plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (such as `/usr/local/lib/wasmedge/`, or the built plug-in path `build/plugins/wasmedge_process/`) to try to fix this issue. ::: Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WasmEdge-Process plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasmEdgeProcess.so` after installation. ## Usage -To use the plugin with WasmEdge, you need to specify it when starting the WasmEdge runtime: +To use the plug-in with WasmEdge, you need to specify it when starting the WasmEdge runtime: ```bash wasmedge --dir .:. --reactor --process_plugin target/release/libwasmedge_process.so your_wasm_file.wasm ``` -Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--process_plugin `flag specifies the path to the Process plugin. +Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--process_plugin `flag specifies the path to the Process plug-in. -That's it! You have successfully built and installed the WasmEdge Process plugin. +That's it! You have successfully built and installed the WasmEdge Process plug-in. For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_process). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/rusttls.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/rusttls.md index fe133929..c357484c 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/rusttls.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/rusttls.md @@ -2,17 +2,17 @@ sidebar_position: 8 --- -# Build with Rusttls Plugin +# Build with Rusttls Plug-in -The WasmEdge Rustls plugin is a replacement for the OpenSSL plugin in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. +The WasmEdge Rustls plug-in is a replacement for the OpenSSL plug-in in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. -Here's a step-by-step guide on how to build the WasmEdge Rustls plugin: +Here's a step-by-step guide on how to build the WasmEdge Rustls plug-in: -# Building the WasmEdge Rustls Plugin +# Building the WasmEdge Rustls Plug-in -The WasmEdge Rustls plugin is a replacement for the OpenSSL plugin in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. +The WasmEdge Rustls plug-in is a replacement for the OpenSSL plug-in in WasmEdge. It provides a Rust-friendly interface to the Rustls library, which is a modern, fast, and more secure alternative to OpenSSL. -Here's a step-by-step guide on how to build the WasmEdge Rustls plugin: +Here's a step-by-step guide on how to build the WasmEdge Rustls plug-in: ## Prerequisites @@ -29,7 +29,7 @@ First, clone the WasmEdge repository from GitHub: git clone https://github.com/WasmEdge/WasmEdge.git ``` -## Navigate to the Rustls Plugin Directory +## Navigate to the Rustls Plug-in Directory Navigate to the `wasmedge_rustls` directory within the cloned repository: @@ -37,36 +37,36 @@ Navigate to the `wasmedge_rustls` directory within the cloned repository: cd WasmEdge/plugins/wasmedge_rustls ``` -## Build the Plugin +## Build the Plug-in -Now you can build the Rustls plugin. Run the following command: +Now you can build the Rustls plug-in. Run the following command: ```bash cargo build --release ``` -This command builds the plugin in release mode. The compiled binary will be located in the `target/release` directory. +This command builds the plug-in in release mode. The compiled binary will be located in the `target/release` directory. -## Install the Plugin +## Install the Plug-in -To install the plugin, you can use the `cargo install` command: +To install the plug-in, you can use the `cargo install` command: ```bash cargo install --path . ``` -This command will install the built plugin into your Rust binary directory. +This command will install the built plug-in into your Rust binary directory. ## Usage -To use the plugin with WasmEdge, you need to specify it when starting the WasmEdge runtime: +To use the plug-in with WasmEdge, you need to specify it when starting the WasmEdge runtime: ```bash wasmedge --dir .:. --reactor --rustls_plugin target/release/libwasmedge_rustls.so your_wasm_file.wasm ``` -Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--rustls_plugin` flag specifies the path to the Rustls plugin. +Replace `your_wasm_file.wasm` with the path to your WebAssembly file. The `--rustls_plugin` flag specifies the path to the Rustls plug-in. -That's it! You have successfully built and installed the WasmEdge Rustls plugin. Please ensure to replace the OpenSSL plugin with the Rustls plugin in your WasmEdge runtime configuration if you were previously using OpenSSL. +That's it! You have successfully built and installed the WasmEdge Rustls plug-in. Please ensure to replace the OpenSSL plug-in with the Rustls plug-in in your WasmEdge runtime configuration if you were previously using OpenSSL. For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_crypto). diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/tensorflow.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/tensorflow.md index 89fedb5f..135f8089 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/tensorflow.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/tensorflow.md @@ -4,6 +4,8 @@ sidebar_position: 5 # Build WasmEdge With WasmEdge-Tensorflow Plug-in +The WasmEdge-TensorFlow plug-in is a software component that extends the functionality of the WasmEdge runtime. It allows developers to perform TensorFlow model inference with similar APIs to Python. The plug-in is designed for Rust to WebAssembly applications and depends on the TensorFlow C library for its operations. + ## Prerequisites The prerequisites of the WasmEdge-Tensorflow plug-in is the same as the WasmEdge building environment on the [Linux platforms](../os/linux.md) or [MacOS platforms](../os/macos.md). @@ -70,3 +72,5 @@ ln -s libtensorflow_framework.2.dylib /usr/local/lib/libtensorflow_framework.dyl ``` Or create the symbolic link in the current directory and set the environment variable `export LD_LIBRARY_PATH=$(pwd):${LD_LIBRARY_PATH}`. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_tensorflow). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/tensorflowlite.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/tensorflowlite.md index 0ad91376..773c9eee 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/tensorflowlite.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/tensorflowlite.md @@ -4,6 +4,8 @@ sidebar_position: 6 # Build WasmEdge With WasmEdge-TensorflowLite Plug-in +The WasmEdge-TensorflowLite plug-in is a software component that extends the functionality of the WasmEdge runtime to perform TensorFlow-Lite model inference. It allows WebAssembly applications to access TensorFlow-Lite functionality when executed on the WasmEdge runtime. The plugin provides a bridge between the WasmEdge runtime and the TensorFlow-Lite backend, allowing developers to execute machine learning models within WebAssembly applications. + ## Prerequisites The prerequisites of the WasmEdge-TensorflowLite plug-in is the same as the WasmEdge building environment on the [Linux platforms](../os/linux.md) or [MacOS platforms](../os/macos.md). @@ -62,3 +64,5 @@ mv libtensorflowlite_flex.dylib /usr/local/lib ``` Or set the environment variable `export LD_LIBRARY_PATH=$(pwd):${LD_LIBRARY_PATH}`. + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasmedge_tensorflowlite). diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_crypto.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_crypto.md index ace9d1e0..4f83efa8 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_crypto.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_crypto.md @@ -4,7 +4,7 @@ sidebar_position: 1 # Build with WASI-Crypto Plug-in -WebAssembly System Interface (WASI) Crypto is a proposal for a set of APIs that provide cryptographic operations for WebAssembly modules. It aims to provide a consistent, portable, and secure interface for cryptographic operations across different platforms. The WasmEdge WASI-Crypto plugin is an implementation of this proposal, providing cryptographic functionalities to WebAssembly applications running on the WasmEdge runtime. +WebAssembly System Interface (WASI) Crypto is a proposal for a set of APIs that provide cryptographic operations for WebAssembly modules. It aims to provide a consistent, portable, and secure interface for cryptographic operations across different platforms. The WasmEdge WASI-Crypto plug-in is an implementation of this proposal, providing cryptographic functionalities to WebAssembly applications running on the WasmEdge runtime. ## Prerequisites diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_logging.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_logging.md index 2452e0cd..0bf20a01 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_logging.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_logging.md @@ -4,7 +4,7 @@ sidebar_position: 1 # Build WasmEdge With WASI-Logging Plug-in -WASI-Logging allows WebAssembly applications to log messages in a standardized way. This becomes particularly helpful when debugging applications or understanding the flow of execution within them. The WASI-Logging plugin is designed to be straightforward to use, enabling developers to focus more on their application logic and less on logging mechanics. +WASI-Logging allows WebAssembly applications to log messages in a standardized way. This becomes particularly helpful when debugging applications or understanding the flow of execution within them. The WASI-Logging plug-in is designed to be straightforward to use, enabling developers to focus more on their application logic and less on logging mechanics. ## Prerequisites @@ -27,15 +27,15 @@ cmake --install . If the built `wasmedge` CLI tool cannot find the WASI-Logging plug-in, you can set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (`/usr/local/lib/wasmedge`, or the built plug-in path `build/plugins/wasi_logging`) to try to fix this issue. You should find `libwasmedgePluginWasiLogging.so` in your `WASMEDGE_PLUGIN_PATH` ::: -Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Logging plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so` after installation. +Then you will have an executable `wasmedge` runtime under `/usr/local/bin` and the WASI-Logging plugin under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so` after installation. -## Loading WASI-Logging Plugin -If the built `wasmedge` CLI tool cannot find the WASI-Logging plugin, set the `WASMEDGE_PLUGIN_PATH` environment variable to the plugin installation path (such as `/usr/local/lib/wasmedge/`, or the built plugin path `build/plugins/wasi_logging/`) to resolve this issue 1. +## Loading WASI-Logging Plug-in +If the built `wasmedge` CLI tool cannot find the WASI-Logging plug-in, set the `WASMEDGE_PLUGIN_PATH` environment variable to the plug-in installation path (such as `/usr/local/lib/wasmedge/`, or the built plug-in path `build/plugins/wasi_logging/`) to resolve this issue 1. -After installation, the `wasmedge` runtime will be located under `/usr/local/bin` and the WASI-Logging plugin under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so`. +After installation, the `wasmedge` runtime will be located under `/usr/local/bin` and the WASI-Logging plug-in under `/usr/local/lib/wasmedge/libwasmedgePluginWasiLogging.so`. ## Using WASI-Logging in Your Applications -You can use the WASI-Logging plugin in your WebAssembly applications to log messages in a standardized way. +You can use the WASI-Logging plug-in in your WebAssembly applications to log messages in a standardized way. For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_logging). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_nn.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_nn.md index 60e67e6e..005fb33c 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_nn.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/wasi_nn.md @@ -4,6 +4,8 @@ sidebar_position: 2 # Build with WASI-nn Plug-in +The WASI-NN plug-in is a proposed WebAssembly System Interface (WASI) API for machine learning. It allows WebAssembly programs to access host-provided machine learning functions. + ## Prerequisites Currently, WasmEdge used OpenVINO™ or PyTorch as the WASI-NN backend implementation. For using WASI-NN on WasmEdge, you need to install [OpenVINO™](https://docs.openvino.ai/2023.0/openvino_docs_install_guides_installing_openvino_apt.html)(2023) or [PyTorch 1.8.2 LTS](https://pytorch.org/get-started/locally/) for the backend. @@ -125,3 +127,5 @@ Or set the environment variable `export LD_LIBRARY_PATH=$(pwd):${LD_LIBRARY_PATH :::note We also provided the `darwin_x86_64`, `darwin_arm64`, and `manylinux_aarch64` versions of the TensorFlow-Lite pre-built shared libraries. ::: + +For more information, you can refer to the [GitHub repository](https://github.com/WasmEdge/WasmEdge/tree/master/plugins/wasi_nn). \ No newline at end of file From d3fe60d7db5357bbdaf3b5309afecb8353c87b2d Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Sat, 25 Nov 2023 08:11:00 +0600 Subject: [PATCH 6/6] fix hyperlink Signed-off-by: Mahfuza Humayra Mohona --- docs/contribute/source/plugin/ebpf.md | 2 +- .../current/contribute/source/plugin/ebpf.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contribute/source/plugin/ebpf.md b/docs/contribute/source/plugin/ebpf.md index acbee0cb..514d8015 100644 --- a/docs/contribute/source/plugin/ebpf.md +++ b/docs/contribute/source/plugin/ebpf.md @@ -12,7 +12,7 @@ The eBPF (extended Berkeley Packet Filter) plug-in provides an interface to exec Before building the eBPF plug-in, ensure that you have the following installed: -* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](./os/linux.md). +* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](../os/linux.md). * libbpf - This plug-in requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. ### Build steps diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md index acbee0cb..514d8015 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/contribute/source/plugin/ebpf.md @@ -12,7 +12,7 @@ The eBPF (extended Berkeley Packet Filter) plug-in provides an interface to exec Before building the eBPF plug-in, ensure that you have the following installed: -* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](./os/linux.md). +* WasmEdge - If you haven't installed it, follow the [follow the guide to build from source](../os/linux.md). * libbpf - This plug-in requires `libbpf >= 1.2`. See [Building libbpf](https://github.com/libbpf/libbpf#building-libbpf) for details. ### Build steps