Skip to content

Commit 07182a2

Browse files
author
Adithya Krishna
authored
[Feat] - Migration of Content from Book to Docs - v2 (#131)
* Migration of Content from Book to Docs Signed-off-by: Adithya Krishna <[email protected]> * Fixed Lint Issues Signed-off-by: Adithya Krishna <[email protected]> * Fixed Broken Links Signed-off-by: Adithya Krishna <[email protected]> * Fixed Broken Links -v 3 Signed-off-by: Adithya Krishna <[email protected]> * Fixed Broken Links Signed-off-by: Adithya Krishna <[email protected]> * Added Eslint MD Parser Signed-off-by: Adithya Krishna <[email protected]> * Moved Use Cases Signed-off-by: Adithya Krishna <[email protected]> --------- Signed-off-by: Adithya Krishna <[email protected]>
1 parent 033e35f commit 07182a2

28 files changed

+15889
-9814
lines changed

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@ module.exports = {
2121
'plugin:import/warnings',
2222
'plugin:@typescript-eslint/eslint-recommended',
2323
'plugin:@typescript-eslint/recommended',
24+
'plugin:prettier/recommended',
25+
'plugin:md/recommended',
26+
],
27+
overrides: [
28+
{
29+
files: ['*.md'],
30+
parser: 'markdown-eslint-parser',
31+
rules: {
32+
'prettier/prettier': [
33+
'error',
34+
// Important to force prettier to use "markdown" parser - otherwise it wouldn't be able to parse *.md files.
35+
// You also can configure other options supported by prettier here - "prose-wrap" is
36+
// particularly useful for *.md files
37+
{ parser: 'markdown' },
38+
],
39+
},
40+
},
41+
{
42+
files: ['*.md.js'], // Will match js code inside *.md files
43+
rules: {
44+
// Example - disable 2 core eslint rules 'no-unused-vars' and 'no-undef'
45+
'no-unused-vars': 'off',
46+
'no-undef': 'off',
47+
},
48+
},
2449
],
2550
parserOptions: {
2651
ecmaFeatures: {

docs/develop/deploy/cri-runtime/containerd-crun.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The args are as follows.
8383
File content is This is in a file
8484
```
8585

86-
Next, you can try to run it in [Kubernetes](../kubernetes/kubernetes-containerd-crun.md#a-simple-webassembly-app)!
86+
Next, you can try to run it in [Kubernetes](../kubernetes/kubernetes-containerd-crun.md#a-simple-webassembly-app))!
8787

8888
## Run a HTTP server app
8989

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "Use Cases",
3-
"position": 6,
2+
"label": "Kubernetes Use Cases",
3+
"position": 7,
44
"link": {
55
"type": "generated-index",
6-
"description": "In this chapter, we will introduce how to use K8s variations to depoloy Wasm app."
6+
"description": "In this chapter, we will discuss how popular software applications embed WasmEdge to support extended functionalities."
77
}
88
}

docs/develop/deploy/kubernetes/knative.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Here we setup crun as a runtimeClass in kubernetes cluster, **rather than replac
1414

1515
## Compile crun
1616

17-
Please refer to the document [crun](../../deploy/oci-runtime/crun) to build and compile crun with WasmEdge support.
17+
Please refer to the document [crun](../../../develop/deploy/oci-runtime/crun) to build and compile crun with WasmEdge support.
1818

1919
```bash
2020
# Install dependencies

docs/develop/deploy/kubernetes/kubedge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ KubeEdge is an open source system for extending native containerized application
88

99
<!-- prettier-ignore -->
1010
:::note
11-
This demo is based on [crun's support](../../deploy/oci-runtime/crun)
11+
This demo is based on [crun's support](../../../develop/deploy/oci-runtime/crun)
1212
:::
1313

1414
## 1. Setup Cloud Side (KubeEdge Master Node)

docs/develop/deploy/kubernetes/kubernetes-containerd-crun.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The [GitHub repo](https://github.com/second-state/wasmedge-containers-examples/)
1313

1414
In the rest of this section, we will explain the steps in detail.
1515

16-
We will assume that you have already [installed and configured containerd](../cri-runtime/containerd-crun.md) to work with WasmEdge container images.
16+
We will assume that you have already [installed and configured containerd](../../../develop/deploy/cri-runtime/containerd-crun) to work with WasmEdge container images.
1717

1818
## Install and start Kubernetes
1919

docs/develop/deploy/kubernetes/kubernetes-cri-o.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The [WasmEdge Containers Example](https://github.com/second-state/wasmedge-conta
1111
- Simple WebAssembly example [Quick start](https://github.com/second-state/wasmedge-containers-examples/blob/main/kubernetes_crio/README.md) | [Github Actions](https://github.com/second-state/wasmedge-containers-examples/blob/main/.github/workflows/kubernetes-crio.yml)
1212
- WebAssembly-based HTTP service [Quick start](https://github.com/second-state/wasmedge-containers-examples/blob/main/kubernetes_crio/http_server/README.md) | [Github Actions](https://github.com/second-state/wasmedge-containers-examples/blob/main/.github/workflows/kubernetes-crio-server.yml)
1313

14-
In the rest of this section, we will explain the steps in detail. We will assume that you have already [installed and configured CRI-O](../oci-runtime/crun.md) to work with WasmEdge container images.
14+
In the rest of this section, we will explain the steps in detail. We will assume that you have already [installed and configured CRI-O](../../../develop/deploy/oci-runtime/crun) to work with WasmEdge container images.
1515

1616
## Install and start Kubernetes
1717

docs/develop/deploy/kubernetes/openyurt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ systemctl start containerd
111111

112112
#### Install WasmEdge
113113

114-
Use the [simple install script](../../build-and-run/install) to install WasmEdge on your edge node.
114+
Use the [simple install script](../../../develop/build-and-run/install) to install WasmEdge on your edge node.
115115

116116
```bash
117117
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash

docs/develop/overview.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ We will cover the following content:
1919
- Develop WebAssembly apps from your programming languages from [Rust](/category/develop-wasm-apps-in-rust), [C/C++](/category/develop-wasm-apps-in-cc), [JavaScript](/category/develop-wasm-apps-in-javascript), [Go](/category/develop-wasm-apps-in-go), and many other languages.
2020
- [Deploy Wasm Apps with the existing container toolings](/category/deploy-wasmedge-apps-in-kubernetes)
2121

22-
Besides this, we also have two more guides for embedding Wasm Functions and contributing to WasmEdge.
22+
# Write a WebAssembly Application
23+
24+
A key value proposition of WebAssembly is that it supports multiple programming languages. WebAssembly is a "managed runtime" for many programming languages including [C/C++](/category/develop-wasm-apps-in-cc), [Rust](/category/develop-wasm-apps-in-rust), [Go](/category/develop-wasm-apps-in-go), and even [JavaScript](/category/develop-wasm-apps-in-javascript) and [Python](/category/develop-wasm-apps-in-python).
25+
26+
- For compiled languages (e.g., C and Rust), WasmEdge WebAssembly provides a safe, secure, isolated, and containerized runtime as opposed to Native Client (NaCl).
27+
- For interpreted or managed languages (e.g., JavaScript and Python), WasmEdge WebAssembly provides a secure, fast, lightweight, and containerized runtime as opposed to Docker + guest OS + native interpreter.
28+
29+
In this chapter, we will discuss how to compile sources into WebAssembly in different languages and run them in WasmEdge.
30+
31+
Besides this, we also have two more guides for [Embedding Wasm Functions](/embed/overview) and [Contributing](/contribute/overview) to WasmEdge.
2332

2433
If you find some issues or have any feedback, you could reach out to us via the following ways.
2534

docs/develop/wasmedge/integrations.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# WasmEdge Integrations
6+
7+
WasmEdge is a "serverless" runtime for cloud native and edge computing applications. It allows developers safely embed third-party or "native" functions into a host application or a distributed computing framework.
8+
9+
## Embed WasmEdge Into A Host Application
10+
11+
A major use case of WasmEdge is to start a VM instance from a host application. Depending on your host application's programming language, you can use WasmEdge SDKs to start and invoke WasmEdge functions.
12+
13+
- Embed WasmEdge functions into a `C`-based application using the [WasmEdge C API](/category/c-sdk-for-embedding-wasmedge). Checkout the [quick start guide](/embed/c/intro).
14+
- Embed WasmEdge functions into a `Go` application using the [WasmEdge Go API](/category/go-sdk-for-embedding-wasmedge). Here is a [tutorial](https://www.secondstate.io/articles/extend-golang-app-with-webassembly-rust/) and are some [examples](https://github.com/second-state/WasmEdge-go-examples)!
15+
- Embed WasmEdge functions into a `Rust` application using the [WasmEdge Rust crate](https://crates.io/crates/wasmedge-sdk).
16+
- Embed WasmEdge functions into a `Node.js` application using the `NAPI`. Here is a [tutorial](https://www.secondstate.io/articles/getting-started-with-rust-function/).
17+
- Embed WasmEdge functions into any application by spawning a new process. See examples for [Vercel Serverless Functions](https://www.secondstate.io/articles/vercel-wasmedge-webassembly-rust/) and [AWS Lambda](https://www.cncf.io/blog/2021/08/25/webassembly-serverless-functions-in-aws-lambda/).
18+
19+
However, the WebAssembly spec only supports very limited data types as input parameters and return values for the WebAssembly bytecode functions. In order to pass complex data types, such as a string of an array, as call arguments into WebAssembly compiled from Rust, you should use the `bindgen` solution provided by the [`wasmedge-bindgen`](https://crates.io/crates/wasmedge-bindgen). We currently support the `wasmedge-bindgen` in the [Rust](/develop/rust/bindgen) and in [Go](/embed/go/bindgen).
20+
21+
## Use WasmEdge As A Docker-Like Container
22+
23+
WasmEdge provides an OCI compliant interface. You can use container tools, such as CRI-O, Docker Hub, and Kubernetes, to orchestrate and manage WasmEdge runtimes.
24+
25+
- [Manage WasmEdge with CRI-O and Docker Hub](https://www.secondstate.io/articles/manage-webassembly-apps-in-wasmedge-using-docker-tools/).
26+
27+
## Call Native Host Functions From WasmEdge
28+
29+
A key feature of WasmEdge is its extensibility. WasmEdge APIs allow developers to register "host functions" from the host programming languages into a WasmEdge instance, and then invoke these functions from the WebAssembly program.
30+
31+
- The WasmEdge C API supports the [C host functions](/embed/c/host_function).
32+
- The WasmEdge Go API supports the [Go host functions](https://github.com/second-state/WasmEdge-go-examples/tree/master/go_HostFunc#wasmedge-go-host-function-example).
33+
- The WasmEdge Rust API supports the [Rust host functions](https://github.com/second-state/wasmedge-rustsdk-examples/blob/main/README.md#host-functions).
34+
35+
[Here is an example](https://www.secondstate.io/articles/call-native-functions-from-javascript/) of a JavaScript program in WasmEdge calling a C-based host function in the underlying OS.
36+
37+
The host functions break the Wasm sandbox to access the underly OS or hardware. But the sandbox breaking is done with explicit permission from the system’s operator.

0 commit comments

Comments
 (0)