Skip to content

Commit 4b6c2a7

Browse files
authored
Adjust docs for wasm functions (#328)
Signed-off-by: Benjamin Huo <benjamin@kubesphere.io>
1 parent 40b28ac commit 4b6c2a7

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

content/en/docs/concepts/cicd.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "CICD"
3-
linkTitle: "CICD"
4-
weight: 4600
2+
title: "CI/CD"
3+
linkTitle: "CI/CD"
4+
weight: 3500
55
description:
66
---
77

content/en/docs/concepts/serverless_apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Serverless Applications"
33
linkTitle: "Serverless Applications"
4-
weight: 3310
4+
weight: 3330
55
description:
66
---
77
In addition to building and running Serverless Functions, you can also build and run Serverless Applications with OpenFuntion.

content/en/docs/concepts/wasmedge_integration.md renamed to content/en/docs/concepts/wasm_functions.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
---
2-
title: "WasmEdge Integration"
3-
linkTitle: "WasmEdge Integration"
4-
weight: 3380
2+
title: "Wasm Functions"
3+
linkTitle: "Wasm Functions"
4+
weight: 3310
55
description:
66
---
77

8-
## WasmEdge Integration
9-
108
`WasmEdge` is a lightweight, high-performance, and extensible WebAssembly runtime for cloud native, edge, and decentralized applications. It powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices.
119

1210
OpenFunction now supports building and running wasm functions with `WasmEdge` as the workload runtime.
1311

1412
> You can find the WasmEdge Integration proposal [here](https://github.com/OpenFunction/OpenFunction/blob/main/docs/proposals/20230223-wasmedge-integration.md)
1513
16-
### Function Build
14+
## Wasm container images
15+
16+
The wasm image containing the wasm binary is a special container image without the OS layer. An special annotation `module.wasm.image/variant: compat-smart` should be added to this wasm container image for a wasm runtime like WasmEdge to recognize it. This is handled automatically in OpenFunction and users only need to specify the `workloadRuntime` as `wasmedge`.
17+
18+
### The build phase of the wasm container images
1719

18-
When the value of the `spec.workloadRuntime` field is `wasmedge` or the annotations of the Function CR contains `module.wasm.image/variant: compat-smart`,
19-
`spec.build.shipwright.strategy` will be automatically generated based on the `ClusterBuildStrategy` named `wasmedge`.
20+
If `function.spec.workloadRuntime` is set to `wasmedge` or the function's annotation contains `module.wasm.image/variant: compat-smart`,
21+
`function.spec.build.shipwright.strategy` will be automatically generated based on the `ClusterBuildStrategy` named `wasmedge` in order to build a wasm container image with the `module.wasm.image/variant: compat-smart` annotation.
2022

21-
### Function Serving
23+
### The serving phase of the wasm container images
2224

23-
When the value of the `spec.workloadRuntime` field is `wasmedge` or the annotations of the Function CR contains `module.wasm.image/variant: compat-smart`:
24-
- If `spec.serving.annotations` does not contain `module.wasm.image/variant`, `module.wasm.image/variant: compat-smart` will be automatically generated into `spec.serving.annotations`
25-
- If `spec.serving.template.runtimeClassName` field is not set, the value of this field will be automatically set to `openfunction-crun`
25+
When `function.spec.workloadRuntime` is set to `wasmedge` or the function's annotation contains `module.wasm.image/variant: compat-smart`:
26+
- If `function.spec.serving.annotations` does not contain `module.wasm.image/variant`, `module.wasm.image/variant: compat-smart` will be automatically added to `function.spec.serving.annotations`.
27+
- If `function.spec.serving.template.runtimeClassName` is not set, this `runtimeClassName` will be automatically set to the default `openfunction-crun`
2628

27-
> If your kubernetes cluster is in a public cloud, such as `azure`, you can set `spec.serving.template.runtimeClassName` to override the default `runtimeClassName`.
29+
> If your kubernetes cluster is in a public cloud like `Azure`, you can set `spec.serving.template.runtimeClassName` manually to override the default `runtimeClassName`.
2830
2931
## Build and run wasm functions
3032

content/en/docs/getting-started/Quickstarts/wasm-functions.md renamed to content/en/docs/getting-started/Quickstarts/wasm_functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ Here you can find wasm function examples:
1313
|----------|------------------------------------------------------------------------------------------------------------------|----------|
1414
| Rust | [wasmedge-http-server](https://github.com/OpenFunction/samples/tree/main/functions/knative/wasmedge/http-server) | wasmedge |
1515

16-
> You can find more info about these Function [here](../../../concepts/wasmedge_integration/)
16+
> You can find more info about these Function [here](../../../concepts/wasm_functions/)

0 commit comments

Comments
 (0)