Skip to content

Commit 5a127c7

Browse files
author
fawei zhao
authored
en blog for release v1.0.0 (#344)
* en blog for release v1.0.0 Signed-off-by: faweizhao26 <faweizhao@kubesphere.io> * Update release_v1.0.0.md * Update release_v1.0.0.md --------- Signed-off-by: faweizhao26 <faweizhao@kubesphere.io>
1 parent 07f2eb7 commit 5a127c7

File tree

1 file changed

+148
-0
lines changed

1 file changed

+148
-0
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
title: "Announcing OpenFunction 1.0.0: Integrate WasmEdge to support Wasm Functions and Enhanced CI/CD"
3+
linkTitle: "Release v1.0.0"
4+
date: 2023-03-11
5+
weight: 92
6+
7+
---
8+
9+
[OpenFunction](https://github.com/OpenFunction/OpenFunction) is a cloud-native open-source FaaS (Function as a Service) platform aiming to let you focus on your business logic only. Today, we are thrilled to announce the general availability of OpenFunction 1.1.0.
10+
11+
In this update, we have continued our commitment to providing developers with more flexible and powerful tools, and have added some new feature. This release integrates WasmEdge to support Wasm functions; we have also enhanced the CI/CD functionality of OpenFunction to provide relatively complete end-to-end CI/CD functionality; and we have added the ability to build an image of a function or application directly from local code in this release, making it easier for developers to publish and deploy their code.
12+
13+
We have optimized OpenFunction's performance and stability and fixed bugs to improve the user experience.
14+
15+
The following introduces the major updates.
16+
17+
## Integrate WasmEdge to support Wasm Functions
18+
19+
WasmEdge is a lightweight, high-performance, and scalable WebAssembly runtime for cloud-native, edge, and decentralized applications. It powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices.
20+
21+
OpenFunction now supports building and running wasm functions with WasmEdge as the workload runtime. WasmEdge has been an alternative container runtime of Docker, Containerd, and CRI-O.
22+
23+
### Create a wasm function
24+
25+
```shell
26+
cat <<EOF | kubectl apply -f -
27+
apiVersion: core.openfunction.io/v1beta1
28+
kind: Function
29+
metadata:
30+
name: wasmedge-http-server
31+
spec:
32+
workloadRuntime: wasmedge
33+
image: openfunctiondev/wasmedge_http_server:0.1.0
34+
imageCredentials:
35+
name: push-secret
36+
build:
37+
dockerfile: Dockerfile
38+
srcRepo:
39+
revision: main
40+
sourceSubPath: functions/knative/wasmedge/http-server
41+
url: https://github.com/OpenFunction/samples
42+
port: 8080
43+
route:
44+
rules:
45+
- matches:
46+
- path:
47+
type: PathPrefix
48+
value: /echo
49+
serving:
50+
runtime: knative
51+
scaleOptions:
52+
minReplicas: 0
53+
template:
54+
containers:
55+
- command:
56+
- /wasmedge_hyper_server.wasm
57+
imagePullPolicy: IfNotPresent
58+
livenessProbe:
59+
initialDelaySeconds: 3
60+
periodSeconds: 30
61+
tcpSocket:
62+
port: 8080
63+
name: function
64+
EOF
65+
```
66+
67+
With the WasmEdge engine, developers can write and run functions using a variety of Wasm-enabled languages and development frameworks.
68+
69+
> Please refer to the official documentation [Wasm Functions](https://openfunction.dev/docs/concepts/wasm_functions/).
70+
71+
## Enhanced CI/CD
72+
73+
Previously users can use OpenFunction to build function or application source code into container images, and then the system deploys the built image directly to the underlying sync/async Serverless runtime without user intervention.
74+
75+
But OpenFunction can neither rebuild the image and then redeploy it whenever the function or application source code changes nor redeploy the image whenever this image changes (When the image is built and pushed manually or in another function)
76+
77+
Starting from v1.0.0, OpenFunction adds the ability to detect source code or image changes and then rebuild and/or redeploy the newly built image in a new component called Revision Controller. The Revision Controller is able to:
78+
79+
- Detect source code changes in GitHub, GitLab or Gitee, and then rebuild and redeploy the new built image whenever the source code changes.
80+
- Detect the bundle container image (image containing the source code) changes, then rebuild and redeploy the new built image whenever the bundle image changes.
81+
- Detect the function or application image changes, then redeploy the new image whenever the function or application image changes.
82+
83+
The enhanced CI/CD functionality ensures that the code runs efficiently in different environments, and users can have better control over the versions and code quality during the development and deployment process. This also provides a better user experience.
84+
85+
> Please refer to the official documentation [CI/CD](https://openfunction.dev/docs/concepts/cicd/).
86+
87+
## Build functions from local source code
88+
89+
To build functions or applications from local source code, you'll need to package your local source code into a container image and push this image to a container registry.
90+
91+
Suppose your source code is in the `samples` directory, you can use the following `Dockerfile` to build a source code bundle image.
92+
93+
```shell
94+
FROM scratch
95+
WORKDIR /
96+
COPY samples samples/
97+
```
98+
99+
Then you can build the source code bundle image like this:
100+
101+
```shell
102+
docker build -t <your registry name>/sample-source-code:latest -f </path/to/the/dockerfile> .
103+
docker push <your registry name>/sample-source-code:latest
104+
```
105+
106+
> It's recommended to use the empty image `scratch` as the base image to build the source code bundle image, a non-empty base image may cause the source code copy to fail.
107+
108+
Unlike defining the `spec.build.srcRepo.url` field for the git repo method, you'll need to define the `spec.build.srcRepo.bundleContainer.image` field instead.
109+
110+
```yaml
111+
apiVersion: core.openfunction.io/v1beta1
112+
kind: Function
113+
metadata:
114+
name: logs-async-handler
115+
spec:
116+
build:
117+
srcRepo:
118+
bundleContainer:
119+
image: openfunctiondev/sample-source-code:latest
120+
sourceSubPath: "/samples/functions/async/logs-handler-function/"
121+
```
122+
123+
> The `sourceSubPath` is the absolute path of the source code in the source code bundle image.
124+
125+
## Other enhancements
126+
127+
In addition to the major changes mentioned above, this release has the following changes and enhancements.
128+
129+
- OpenFunction
130+
- The core v1alpha2 API was deprecated and removed
131+
- Add sha256 to serving image
132+
- Add information of build source to function status
133+
- Bump shipwright to v0.11.0, knative to v0.32.0, dapr to v1.8.3, and go to 1.18
134+
- functions-framework-java released version 1.0.0
135+
- Support multiple functions in one pod
136+
- Support for automatic publishing
137+
- Builder
138+
- Support multiple functions in one pod
139+
- Update the default java framework version to 1.0.0
140+
- revision-controller released version 1.0.0
141+
142+
143+
These are the main feature changes in OpenFunction v1.0.0 and we would like to thank all contributors for their contributions. If you are looking for an efficient and flexible cloud-native function development platform, OpenFunction v1.0.0 is the perfect choice for you.
144+
145+
For more details and documentation, please visit our website and GitHub repo.
146+
147+
- [Website](https://openfunction.dev/):https://openfunction.dev/
148+
- [Github](https://github.com/OpenFunction/OpenFunction/releases/tag/v1.0.0):https://github.com/OpenFunction/OpenFunction/releases/tag/v1.0.0

0 commit comments

Comments
 (0)