diff --git a/.github/workflows/docusaurus-ci.yml b/.github/workflows/docusaurus-ci.yml index b935f4dc93..6bf6c6a0da 100644 --- a/.github/workflows/docusaurus-ci.yml +++ b/.github/workflows/docusaurus-ci.yml @@ -3,8 +3,6 @@ name: CI on: push: branches: [ main ] - pull_request: - branches: [ main ] jobs: build: diff --git a/docs/blog/code/layotto-rpc/index.md b/docs/blog/code/layotto-rpc/index.md index 0feba1da72..b28915153e 100644 --- a/docs/blog/code/layotto-rpc/index.md +++ b/docs/blog/code/layotto-rpc/index.md @@ -936,9 +936,7 @@ func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byt 最终收到返回数据: ```json - {"jsonrpc":"2.0","id":9527,"result":{"id":"113","name":"Moorse","age":30,"time":703394193,"sex":"MAN"}} - ``` ## 总结 diff --git a/docs/docs/README.md b/docs/docs/README.md index deba99879f..ecd39ab8d9 100644 --- a/docs/docs/README.md +++ b/docs/docs/README.md @@ -1,7 +1,8 @@ # Layotto (L8): To be the next layer of OSI layer 7 -[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml) +[//]: # ([![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml)) +[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml) [![Layotto Dev Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml) [![GoDoc](https://godoc.org/mosn.io/layotto?status.svg)](https://godoc.org/mosn.io/layotto) @@ -178,6 +179,6 @@ Layotto enriches the CNCF CLOUD N ## FAQ -## 跟 dapr 有什么差异? +### 跟 dapr 有什么差异? dapr 是一款优秀的 Runtime 产品,但它本身缺失了 Service Mesh 的能力,而这部分能力对于实际在生产环境落地是至关重要的,因此我们希望把 Runtime 跟 Service Mesh 两种能力结合在一起,满足更复杂的生产落地需求。 diff --git a/docs/docs/component_specs/configuration/apollo.md b/docs/docs/component_specs/configuration/apollo.md index 9a7b7495c1..545676d000 100644 --- a/docs/docs/component_specs/configuration/apollo.md +++ b/docs/docs/component_specs/configuration/apollo.md @@ -2,7 +2,7 @@ ## 配置项说明 示例:configs/config_apollo.json -![img.png]((/img/configuration/apollo/img.png) +![img.png](/img/configuration/apollo/img.png) | 字段 | 必填 | 说明 | | --- | --- | --- | diff --git a/docs/docs/component_specs/configuration/nacos.md b/docs/docs/component_specs/configuration/nacos.md index fe113130b6..4561f272df 100644 --- a/docs/docs/component_specs/configuration/nacos.md +++ b/docs/docs/component_specs/configuration/nacos.md @@ -27,7 +27,7 @@ 不过不是添加在 nacos configstore 组件的配置里,添加在而外的配置项中,方便其他需要使用 `app_id` 的组件复用。 -![img.png]((/img/configuration/nacos/img.png) +![img.png](/img/configuration/nacos/img.png) ## 怎么启动 Nacos diff --git a/docs/docs/component_specs/file/tencentcloud_oss.md b/docs/docs/component_specs/file/tencentcloud_oss.md index 13cfe3cdf6..8385528300 100644 --- a/docs/docs/component_specs/file/tencentcloud_oss.md +++ b/docs/docs/component_specs/file/tencentcloud_oss.md @@ -19,7 +19,7 @@ 访问 https://console.cloud.tencent.com/cos/bucket 创建存储桶 -![]((/img/file/create_tencent_oss_bucket.png) +![](/img/file/create_tencent_oss_bucket.png) 3.创建 AK 和 SK diff --git a/docs/docs/configuration/overview.md b/docs/docs/configuration/overview.md index b66d8ee47e..d8669936dc 100644 --- a/docs/docs/configuration/overview.md +++ b/docs/docs/configuration/overview.md @@ -3,7 +3,7 @@ Layotto 启动时需要读取一个 json 格式的配置文件。示例配置文 目前,Layotto使用一个MOSN 4层filter与MOSN集成、跑在MOSN上,**所以Layotto用到的配置文件其实就是MOSN配置文件。** -![img.png]((/img/configuration/layotto/img.png) +![img.png](/img/configuration/layotto/img.png) 如上图示例,大部分配置是MOSN的配置项,参考[MOSN的配置说明](https://mosn.io/docs/configuration/) ; diff --git a/docs/docs/design/faas/faas-poc-design.md b/docs/docs/design/faas/faas-poc-design.md index faf9d9469c..c0b6bdcb29 100644 --- a/docs/docs/design/faas/faas-poc-design.md +++ b/docs/docs/design/faas/faas-poc-design.md @@ -8,10 +8,10 @@ 整套FaaS的方案中,主要解决了以下两个问题: 1. 编译产生的 wasm 文件跟镜像之间的关系是什么? - 1. 目标 wasm 文件最终被构建到一个普通镜像中,推送到 Dockerhub 里,拉取镜像的过程也跟原生的镜像保持一致,只不过实际运行时会把目标 wasm 文件从镜像中提取出来单独加载。 + 1. 目标 wasm 文件最终被构建到一个普通镜像中,推送到 Dockerhub 里,拉取镜像的过程也跟原生的镜像保持一致,只不过实际运行时会把目标 wasm 文件从镜像中提取出来单独加载。 2. 如何让k8s管理部署 wasm 文件? - 1. 基于k8s的生命周期管理及调度策略,结合Containerd的v2接口定义,自定义了Containerd-shim-layotto-v2插件,把容器运行时改造为Layotto Runtime,比如k8s创建容器的动作变成了加载 wasm 形态的函数并运行。 - 2. 得益于 WebAssembly 优秀的沙箱隔离环境,Layotto 作为基座可以加载运行多个 wasm 形态的函数,它们虽然都跑在一个进程里但互不影响,这种 nanoprocess 的思路相比于 docker 可以进一步充分利用资源。 + 1. 基于k8s的生命周期管理及调度策略,结合Containerd的v2接口定义,自定义了Containerd-shim-layotto-v2插件,把容器运行时改造为Layotto Runtime,比如k8s创建容器的动作变成了加载 wasm 形态的函数并运行。 + 2. 得益于 WebAssembly 优秀的沙箱隔离环境,Layotto 作为基座可以加载运行多个 wasm 形态的函数,它们虽然都跑在一个进程里但互不影响,这种 nanoprocess 的思路相比于 docker 可以进一步充分利用资源。 ### 二、核心组件 diff --git a/docs/docs/development/component_ref/component_ref.md b/docs/docs/development/component_ref/component_ref.md index 942ba29db4..bd060e708a 100644 --- a/docs/docs/development/component_ref/component_ref.md +++ b/docs/docs/development/component_ref/component_ref.md @@ -7,12 +7,12 @@ ### 相关设计 目前只支持最需要被应用的两个组件类型:ConfigStore和SecretStore,即配置组件和秘钥组件。 -Ref接口设计,组件需实现此接口才能实现注入。 +Ref接口设计,组件需实现此接口才能实现注入。 ```go type SetComponent interface { - SetConfigStore(cs configstores.Store) (err error) - SetSecretStore(ss secretstores.SecretStore) (err error) +SetConfigStore(cs configstores.Store) (err error) +SetSecretStore(ss secretstores.SecretStore) (err error) } ``` @@ -39,13 +39,13 @@ return nil } //fetch secret/config when component init func (hw *HelloWorld) Init(config *hello.HelloConfig) error { - hw.secretStore.GetSecret(secretstores.GetSecretRequest{ - Name: "dbPassword", - }) - hw.config.Get(context.Background(),&configstores.GetRequest{ - Keys: []string{"dbAddress"}, - }) - return nil +hw.secretStore.GetSecret(secretstores.GetSecretRequest{ +Name: "dbPassword", +}) +hw.config.Get(context.Background(),&configstores.GetRequest{ +Keys: []string{"dbAddress"}, +}) +return nil } ``` diff --git a/docs/docs/development/contributing-doc.md b/docs/docs/development/contributing-doc.md index 6de049554f..97361c79ac 100644 --- a/docs/docs/development/contributing-doc.md +++ b/docs/docs/development/contributing-doc.md @@ -8,7 +8,7 @@ 文档统一放在docs/目录下,其中docs/en存放英文文档,docs/zh存放中文文档。 -![img_2.png]((/img/development/doc/img_2.png) +![img_2.png](/img/development/doc/img_2.png) ## 2. 文档站点说明 docs/目录下的文件,会被自动部署到github pages,通过[docsify](https://docsify.js.org/#/) 渲染。 @@ -39,7 +39,7 @@ step 3. 打开 http://localhost:3000/ 查看文档站点。 ### step 1. 新建 markdown 文档 当需要新增文档时,可以按目录结构新建文件夹、新建.md文件。比如想写分布式锁API的设计文档,就新建目录: -![img_1.png]((/img/development/doc/img_1.png) +![img_1.png](/img/development/doc/img_1.png) ### step 2. 把文档加入侧边栏 新增文档、写完内容后,记得更新一下侧边栏哦。 @@ -60,14 +60,14 @@ step 3. 打开 http://localhost:3000/ 查看文档站点。 这里说的超链接是那种点了后会跳转到其他文档的链接,比如下面这种: -![img_4.png]((/img/development/doc/img_4.png) +![img_4.png](/img/development/doc/img_4.png) ### 4.1. 错误的写法 如果你尝试用相对路径写超链接url,会发现在站点里点击他就会404: -![img_6.png]((/img/development/doc/img_6.png) +![img_6.png](/img/development/doc/img_6.png) -![img_7.png]((/img/development/doc/img_7.png) +![img_7.png](/img/development/doc/img_7.png) ### 4.2. 正确的写法 @@ -75,7 +75,7 @@ step 3. 打开 http://localhost:3000/ 查看文档站点。 a. 用相对于docs/目录的相对路径。例如: -![img_5.png]((/img/development/doc/img_5.png) +![img_5.png](/img/development/doc/img_5.png) b. 用完整的Url。例如: @@ -86,7 +86,7 @@ see [runtime_config.json](https://github.com/mosn/layotto/blob/main/configs/runt ## 5. 图片目录与图片链接 图片放在docs/img/ 目录下。放这里是为了能让docsify站点能访问到: -![img.png]((/img/development/doc/img.png) +![img.png](/img/development/doc/img.png) 文档中引用图片建议就用完整路径,免得遇到一堆乱七八糟的路径问题。 diff --git a/docs/docs/development/developing-api.md b/docs/docs/development/developing-api.md index 4907340767..27ef59e83e 100644 --- a/docs/docs/development/developing-api.md +++ b/docs/docs/development/developing-api.md @@ -46,10 +46,10 @@ A: **本规范只限制“新增Layotto API的pr需要有哪些东西”(比 - 需求分析 - 为什么要做这个API - - 定义需求的边界,哪些feature支持,哪些不支持 -- 市面上产品调研 + - 定义需求的边界,哪些feature支持,哪些不支持 +- 市面上产品调研 - grpc/http API设计 -- 组件API设计 +- 组件API设计 - 解释你的设计 一个优秀的提案示例:https://github.com/dapr/dapr/issues/2988 @@ -87,14 +87,14 @@ A: **本规范只限制“新增Layotto API的pr需要有哪些东西”(比 文档路径在"用户手册--接口文档"下,例如 State API的见 https://mosn.io/layotto/#/zh/api_reference/state/reference >调研发现Dapr的使用文档较多,比如光State API就有: -> +> > https://docs.dapr.io/developing-applications/building-blocks/state-management/ -> https://docs.dapr.io/reference/api/state_api/ -> +> https://docs.dapr.io/reference/api/state_api/ +> > https://docs.dapr.io/operations/components/setup-state-store/ -> +> > https://docs.dapr.io/reference/components-reference/supported-state-stores/ -> +> > 我们处于项目早期,可以轻一些 需要有: @@ -102,12 +102,12 @@ A: **本规范只限制“新增Layotto API的pr需要有哪些东西”(比 ##### when.什么场景适合用这个API ##### how.怎么用这个API - 接口列表。例如: - + ![img_4.png]((/img/development/api/img_4.png) - + 列出来有哪些接口,一方面省的用户自己去翻proto、不知道哪些是相关API,一方面避免用户产生"这项目连接口文档都没有?!"的反感 - 关于接口的出入参:拿proto注释当接口文档 -考虑到接口文档用中英文写要写两份、时间长了还有可能和代码不一致,因此建议不写接口文档,直接把proto注释写的足够详细、当接口文档。例如: + 考虑到接口文档用中英文写要写两份、时间长了还有可能和代码不一致,因此建议不写接口文档,直接把proto注释写的足够详细、当接口文档。例如: ```protobuf // GetStateRequest is the message to get key-value states from specific state store. @@ -124,7 +124,7 @@ message GetStateRequest { // (optional) The metadata which will be sent to state store components. map metadata = 4; } - + // StateOptions configures concurrency and consistency for state operations message StateOptions { // Enum describing the supported concurrency for state. @@ -162,7 +162,7 @@ message StateOptions { 这就要求proto注释里写清楚: - 是必传参数还是可选参数; - 解释这个字段啥含义;光解释字面意思是不够的,要解释背后的使用机制,比如上面的consistency和concurrency要解释用户传了某个选项后,服务器能提供什么样的保证 - + (consistency和concurrency上面的注释其实是我把Dapr文档上的描述精简后粘过来的,省了写双语文档) - 注释讲不清楚的,在文档上解释 @@ -202,7 +202,7 @@ message StateOptions { ```protobuf //StopSubscribe stop subs - StopSubscribe() + StopSubscribe() ``` ## 三、提交pull request diff --git a/docs/docs/development/developing-component.md b/docs/docs/development/developing-component.md index 643d0a6200..1f72aaef8b 100644 --- a/docs/docs/development/developing-component.md +++ b/docs/docs/development/developing-component.md @@ -10,7 +10,7 @@ 1. git clone下载代码到您喜欢的目录 2. 使用Docker启动您需要的环境。比如您想用zookeeper开发分布式锁API,就需要本地用Docker启动一个zookeeper容器,用于本地测试。 - + 如果您本地没有Docker也不用害怕,可以参照 [Docker Desktop教程](https://www.runoob.com/docker/windows-docker-install.html) 装一个Docker Desktop,Mac和Windows都可以,用起来特别简单。 ## 二、开发组件和单元测试 @@ -29,7 +29,7 @@ - 其他:Layotto的pkg/common目录下有一些工具类,以及mosn.io/pkg下也有很多工具类 ### 2.2. 复制粘贴别的组件 - + 简单起见,可以直接复制粘贴别的组件过来,修改开发。比如想用zookeeper实现分布式锁API的话,可以把redis组件复制粘贴过来改 ### 2.3. 记得编写单元测试哦! @@ -43,7 +43,7 @@ 一般是把所有网络调用的代码封装成一个interface,然后在ut中mock掉这个interface。以apollo配置中心的单元测试为例,见components/configstores/apollo/configstore.go 和 components/configstores/apollo/configstore_test.go : -首先,在configstore.go里,把所有调sdk、发起网络调用调apollo的地方给封装成一个interface +首先,在configstore.go里,把所有调sdk、发起网络调用调apollo的地方给封装成一个interface ![mock.png]((/img/development/component/mock.png) ![img_8.png]((/img/development/component/img_8.png) @@ -129,7 +129,7 @@ ![img_2.png]((/img/development/component/img_2.png) -启动demo、调用Layotto,看看有没有报错。如果是通用客户端,可以在命令行命令里带上-s storeName传入storeName +启动demo、调用Layotto,看看有没有报错。如果是通用客户端,可以在命令行命令里带上-s storeName传入storeName ![img_5.png]((/img/development/component/img_5.png) diff --git a/docs/docs/development/github-workflows.md b/docs/docs/development/github-workflows.md index c5b061edcb..9c861552a6 100644 --- a/docs/docs/development/github-workflows.md +++ b/docs/docs/development/github-workflows.md @@ -82,7 +82,7 @@ Layotto Env Pipeline 流水线任务触发方式: ## Layotto Dev Pipeline 🌊 (Before Merged) -![release.png]((/img/development/workflow/workflow-dev.png) +![release.png](/img/development/workflow/workflow-dev.png) ### Job 任务内容 @@ -118,7 +118,7 @@ Layotto Dev Pipeline (Before Merged) 流水线主要负责 Layotto 提交 PR 后 ## Layotto Dev Pipeline 🌊 (After Merged) -![release.png]((/img/development/workflow/workflow-merge.png) +![release.png](/img/development/workflow/workflow-merge.png) ### Job 任务内容 @@ -157,7 +157,7 @@ Layotto Dev Pipeline (After Merged) 流水线主要负责 Layotto 代码合并 ## Layotto Release Pipeline 🌊 -![release.png]((/img/development/workflow/work(/img/lease.png) +![release.png](/img/development/workflow/work(/img/lease.png) ### Job 任务内容 diff --git a/docs/docs/development/release-guide.md b/docs/docs/development/release-guide.md index 5a5ffcfee9..fd9d29c290 100644 --- a/docs/docs/development/release-guide.md +++ b/docs/docs/development/release-guide.md @@ -34,7 +34,7 @@ Layotto 发布周期暂定为每季度发布一次。 + AMD64/X86 架构的镜像:`layotto/layotto:{tag}` + ARM64 架构的镜像:`layotto/layotto.arm64:{tag}` -![release.png]((/img/development/workflow/release.png) +![release.png](/img/development/workflow/release.png) ### Step3: Draft a new release 并编写发布报告 @@ -42,14 +42,14 @@ Layotto 发布周期暂定为每季度发布一次。 > 可以参考以前的 [发版报告](https://github.com/mosn/layotto/releases) -![img_1.png]((/img/development/release/img_1.png) +![img_1.png](/img/development/release/img_1.png) ### Step4: 上传多平台架构的 Binaries > 2022/05/04更新:这一步可以忽略。打 tag 发布后,Layotto 的 Release Pipeline 会自动上传二进制文件,无需手动上传。PR 见 https://github.com/mosn/layotto/pull/566 > 如果没有自动上传,可以手动将 `步骤 2` 中构建的多平台 Artifacts 下载、上传 -![img.png]((/img/development/release/img.png) +![img.png](/img/development/release/img.png) ### Step5: 确认发布 diff --git a/docs/docs/start/faas/start.md b/docs/docs/start/faas/start.md index 44395be585..eaf5ad9a70 100644 --- a/docs/docs/start/faas/start.md +++ b/docs/docs/start/faas/start.md @@ -19,7 +19,7 @@ Layotto支持加载并运行以 wasm 为载体的 Function,并支持Function 按照官网操作即可。 3. [virtualbox](https://www.oracle.com/virtualization/technologies/vm/virtualbox.html) - + 直接官网下载安装包安装即可,mac下也可以使用 [homebrew](https://brew.sh/) 进行安装。安装完以后如果启动失败,请参考[The host-only adapter we just created is not visible](https://github.com/kubernetes/minikube/issues/3614) @@ -160,7 +160,7 @@ There are 100 inventories for book1. 2.启动Layotto时,redis连接失败,打印 "occurs an error: redis store: error connecting to redis at": - 检查redis的配置,看是否redis配置错误造成的。 +检查redis的配置,看是否redis配置错误造成的。 diff --git a/docs/docs/start/wasm/start.md b/docs/docs/start/wasm/start.md index 02d135a844..8a0b6671af 100644 --- a/docs/docs/start/wasm/start.md +++ b/docs/docs/start/wasm/start.md @@ -101,22 +101,22 @@ docker rm -f redis-test ```json "config": { - "function1": { - "name": "function1", - "instance_num": 1, - "vm_config": { - "engine": "wasmtime", - "path": "demo/faas/code/golang/client/function_1.wasm" - } - }, - "function2": { - "name": "function2", - "instance_num": 1, - "vm_config": { - "engine": "wasmtime", - "path": "demo/faas/code/golang/server/function_2.wasm" - } - } +"function1": { +"name": "function1", +"instance_num": 1, +"vm_config": { +"engine": "wasmtime", +"path": "demo/faas/code/golang/client/function_1.wasm" +} +}, +"function2": { +"name": "function2", +"instance_num": 1, +"vm_config": { +"engine": "wasmtime", +"path": "demo/faas/code/golang/server/function_2.wasm" +} +} } ``` diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index bc210b68d9..379c0a84ef 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -8,7 +8,7 @@ const config = { favicon: 'https://gw.alipayobjects.com/zos/bmw-prod/65518bfc-8ba5-4234-a5c5-2bc065e3a5f0.svg', url: 'https://mosn.io', - baseUrl: '/mosn.github.io/layotto/', + baseUrl: '/layotto/', organizationName: 'mosn', projectName: 'layotto', diff --git a/docs/i18n/en-US/docusaurus-plugin-content-blog/code/flowcontrol/flowcontrol_code_analyze.md b/docs/i18n/en-US/docusaurus-plugin-content-blog/code/flowcontrol/flowcontrol_code_analyze.md index 33cba9c94a..2751e4c5cd 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-blog/code/flowcontrol/flowcontrol_code_analyze.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-blog/code/flowcontrol/flowcontrol_code_analyze.md @@ -25,7 +25,7 @@ Reference to
[https://mosn.io/docs/concept/extensions/](https://mosn.io/do Mosn Stream Filter Extension -![01.png](https://gw.alipaayobjects.com/md/rms_5891a1/afts/img/A*tSn4SpIkAa4AAAAAAAAAAAAAAAAAAAARQAQAQ) +![01.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*tSn4SpIkAa4AAAAAAAAAAAAAARQnAQ) ### Code in: [flowcontrol代码](https://github.com/mosn/mosn/tree/master/pkg/filter/stream/flowcontrol) @@ -35,37 +35,37 @@ This class is a factory class to create StreamFilter. Some constant values are defined for default values -![02.png](https://gw.alipaayobjects.com/md/rms_5891a1/afts/img/A*PAWCTL6MS40AAAAAAAAAAAAAAAAAAAAAARQAQAQ) +![02.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*PAWCTL6MS40AAAAAAAAAAAAAARQnAQ) Defines the restricted stream config class to load yaml definition and parse production corresponding functions -![03.png](https://gw.alipaayobjects.com/md/rms_5891a1/afts/img/A*Ua32SokhILEAAAAAAAAAAAAAAAAAAAAARQAQAQ) +![03.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*Ua32SokhILEAAAAAAAAAAAAAARQnAQ) init() Inner initialization is the storage of name and corresponding constructor to the filter blocking plant map -![04.png](https://gw.alipaayobjects.com/md/rms_5891a1/afts/img/A*kb3qRqWnqxYAAAAAAAAAAAAAAAAAAARQAQAQ) +![04.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*kb3qRqWnqxYAAAAAAAAAAAAAARQnAQ) Highlight createRpcFlowControlFilterFactory Production rpc Current Factory -![05.png](https://gw.alipaayobjects.com/md/rms_5891a1/afts/img/A*u5rkS54zkgAAAAAAAAAAAAAAAAAAAAARQAQ) +![05.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*u5rkS54zkgAAAAAAAAAAAAAAARQnAQ) Before looking at streamfilter, we see how factory classes are producing restricted streamers -![06.png](https://gw.alipaayobjects.com/md/rms_5891a1/afts/img/A*cj0nT5O69OYAAAAAAAAAAAAAAAAAAARQAQAQ) +![06.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*cj0nT5O69OYAAAAAAAAAAAAAARQnAQ) Limit the streaming to the restricted stream chain structure to take effect in sequential order. CreateFilterChain method adds multiple filters to the link structure -![07.png](https://gw.alipaayobjects.com/mdn/rms_5891a1/afts/img/A*a8ClQ76odpEAAAAAAAAAAAAAAAAAAAARQNAQNAQAQAQ) +![07.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*a8ClQ76odpEAAAAAAAAAAAAAARQnAQ) We can see that this interface is achieved by a wide variety of plant types, including those that we are studying today. -![08.png](https://gw.alipaayobjects.com/md/rms_5891a1/afts/img/A*sBDbT44r2r2vgAAAAAAAAAAAAAAAAAAAAARQAQAQ) +![08.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*sBDbT44r2vgAAAAAAAAAAAAAARQnAQ) ### Stream_filter.go Analysis -![09.png](https://gw.alipaayobjects.com/mdn/rms_5891a1/afts/img/A*ww3RKe1GH8AAAAAAAAAAAAAAAAAAAAARQAQAQ) +![09.png](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*wsw3RKe1GH8AAAAAAAAAAAAAARQnAQ) ## Overall process: diff --git a/docs/i18n/en-US/docusaurus-plugin-content-blog/code/layotto-rpc/index.md b/docs/i18n/en-US/docusaurus-plugin-content-blog/code/layotto-rpc/index.md index 4d4dece3b7..02dd0e66c0 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-blog/code/layotto-rpc/index.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-blog/code/layotto-rpc/index.md @@ -2,10 +2,10 @@ > This paper is based on the Dubbo Json RPC as an example of the Layotto RPC processing. > -> by:[王志龙](https://github.com/rayowang) | 21April 2022 +> by:[Wang Zhilong](https://github.com/rayowang) | 21April 2022 -- [概述](#overview) -- [源码分析](#source analysis) +- [overview](#overview) +- [source analysis](#source analysis) - [0x00 Layotto initialize RPC](#_0x00-layotto-initializ-rpc) - [0x01 Dubbo-go-sample client to request request] (#_0x01-dubbo-go-sample-client-request request) - [0x02 Mosn EventLoop Reader Processing Request Data](#_0x02-mosn-eventloop-read processing request) @@ -17,7 +17,7 @@ - [0x08 Layotto receive RPC responses and read Local Virtual Connections](#_0x08-layotto-receive-rpc-response and read -local-virtual connection) - [0x09 Grpc Sever processed data frames returned to client](#_0x09-grpc-sever processed frame returned to client) - [0x10 Dubbo-go-sample client receiving response](#_0x10-dubbo-go-sample-client-receiving response) -- [总结](#summary) +- [summary](#summary) ## General description diff --git a/docs/i18n/en-US/docusaurus-plugin-content-blog/code/webassembly/index.md b/docs/i18n/en-US/docusaurus-plugin-content-blog/code/webassembly/index.md index 262d3149fe..71740527b2 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-blog/code/webassembly/index.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-blog/code/webassembly/index.md @@ -2,19 +2,19 @@ > This paper mainly analyses the relevant implementation and application of Layotto Middle WASM. > -> by:[王志龙](https://github.com/rayowang) | 18 May 2022 +> by:[Wang Zhilong](https://github.com/rayowang) | 18 May 2022 -- [概述](#overview) -- [源码分析](#source analysis) - - [框架INIT](#Frame INIT) - - [工作流程](#workflow) - - [FaaS模式](#FaaS mode) -- [总结](#summary) +- [overview](#overview) +- [source analysis](#source analysis) + - [Frame INIT](#Frame INIT) + - [workflow](#workflow) + - [FaaSmode](#FaaS mode) +- [summary](#summary) ## General description WebAssemly Abbreviations WASM, a portable, small and loaded binary format operating in sandboxing implementation environment, was originally designed to achieve high-performance applications in web browsers, benefiting from its good segregation and security, multilingual support, cool-start fast flexibility and agility and application to embed other applications for better expansion, and obviously we can embed it into Layotto.Layotto supports loading compiled WASM files and interacting with the Target WASM API via proxy_abi_version_0_2_0; -other Layotto also supports loading and running WASM carrier functions and supports interfaces between Function and access to infrastructure; and Layotto communities are also exploring the compilation of components into WASM modules to increase segregation between modules.本文以 Layotto 官方 [quickstart](https://mosn.io/layotto/#/zh/start/wasm/start) 即访问redis相关示例为例来分析 Layotto 中 WebAssemly 相关的实现和应用。 +other Layotto also supports loading and running WASM carrier functions and supports interfaces between Function and access to infrastructure; and Layotto communities are also exploring the compilation of components into WASM modules to increase segregation between modules.This article uses the Layotto official [quickstart](https://mosn.io/layotto/#/zh/start/wasm/start) example of accessing redis as an example to analyze WebAssemly in Layotto Related implementation and application. ## Source analysis @@ -24,7 +24,7 @@ Note:is based on commit hash:f1cf350a52b5a1a0b3788a31681007a056e332ef As the bottom layer of Layotto is Mosn, the WASM extension framework is also the WASM extension framework that reuses Mosn, as shown in figure 1 Layotto & Mosn WASM framework [1]. -![mosn\_wasm\_ext\_framework\_module](https://gw.alipaayobjects.com/md/rms_5891a1/afts/img/A*jz4BSJmVQ3gAAAAAAAAAAAAAAAAAAARQAQAQAQ) +![mosn\_wasm\_ext\_framework\_module](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*jz4BSJmVQ3gAAAAAAAAAAAAAARQnAQ)
Figure 1 Layotto & Mosn WASM framework
@@ -34,7 +34,7 @@ Here a brief review of the following concepts:\ [Proxy-Wasm](https://github.com/proxy-waste) :WebAssembly for Proxies (ABI specification) is an unrelated ABI standard that defines how proxy and WASM modules interact [3] in functions and callbacks. [proxy-wasm-go-sdk](https://github.com/tetratelabs/proxy-wasm-go-sdk) :defines the interface of function access to system resources and infrastructure services based on [proxy-wasm/spec](https://github.com/proxy-wasm/speci) which brings together the Runtime API to increase access to infrastructure.\ [proxy-wasm-go-host](https://github.com/mosn/proxy-waste-go-host) WebAssembly for Proxies (GoLang host implementation):Proxy-Wasm golang implementation to implement Runtime ABI logic in Layotto.\ -VM:Virtual Machine 虚拟机,Runtime类型有:wasmtime、Wasmer、V8、 Lucet、WAMR、wasm3,本文例子中使用 wasmer +VM: Virtual Machine Virtual machine. The Runtime types are wasmtime, wasmer, V8, Lucet, WAMR, and wasm3 1, see first the configuration of stream filter in [quickstart例子](https://mosn.io/layotto/#/start/waste/start) as follows, two WASM plugins can be seen, using waste VM to start a separate instance with configuration: below @@ -138,7 +138,7 @@ func createProxyWasmFilterFactory(confs map[string]interface{}) (api.StreamFilte log.DefaultLogger.Errorf("[proxywasm][factory] createProxyWasmFilterFactory config not a map, configID: %s", configID) return nil, errors.New("config not a map") } - // 解析 wasm filter 配置 + // Parse the wasm filter configuration config, err := parseFilterConfigItem(conf) if err != nil { log.DefaultLogger.Errorf("[proxywasm][factory] createProxyWasmFilterFactory fail to parse config, configID: %s, err: %v", configID, err) @@ -149,14 +149,14 @@ func createProxyWasmFilterFactory(confs map[string]interface{}) (api.StreamFilte if config.FromWasmPlugin == "" { pluginName = utils.GenerateUUID() - // 根据 stream filter 的配置初始化 WASM 插件配置,VmConfig 即 vm_config,InstanceNum 即 instance_num + // The WASM plug-in configuration is initialized according to the stream filter configuration. VmConfig is vm_config, and InstanceNum is instance_num v2Config := v2.WasmPluginConfig{ PluginName: pluginName, VmConfig: config.VmConfig, InstanceNum: config.InstanceNum, } - // WasmManager 实例通过管理 PluginWrapper 对象对所有插件的配置进行统一管理,提供增删查改能力。下接3 + // The WasmManager instance manages the configuration of all plug-ins in a unified manner by managing the PluginWrapper object, providing the ability to add, delete, check and modify. Continue 3 err = wasm.GetWasmManager().AddOrUpdateWasm(v2Config) if err != nil { config.PluginName = pluginName @@ -170,7 +170,7 @@ func createProxyWasmFilterFactory(confs map[string]interface{}) (api.StreamFilte } config.PluginName = pluginName - // PluginWrapper 在上面的 AddOrUpdateWasm 中对插件及配置进行封装完成初始化,这里根据插件名从 sync.Map 拿出,以管理并注册 PluginHandler + // PluginWrapper wraps the plug-in and configuration in AddOrUpdateWasm above to complete the initialization, which is pulled from sync.Map according to the plug-in name to manage and register the PluginHandler pw := wasm.GetWasmManager().GetWasmPluginWrapperByName(pluginName) if pw == nil { return nil, errors.New("plugin not found") @@ -186,7 +186,7 @@ func createProxyWasmFilterFactory(confs map[string]interface{}) (api.StreamFilte config: config, } factory.plugins[config.PluginName] = wasmPlugin - // 注册 PluginHandler,以对插件的生命周期提供扩展回调能力,例如插件启动 OnPluginStart、更新 OnConfigUpdate。下接4 + // Register PluginHandler to provide extended callback capabilities for the plug-in's life cycle, such as the plug-in starting OnPluginStart and updating OnConfigUpdate. Continue 4 pw.RegisterPluginHandler(factory) } @@ -206,7 +206,7 @@ func NewWasmPlugin(wasmConfig v2.WasmPluginConfig) (types.WasmPlugin, error) { wasmConfig.InstanceNum = instanceNum - // 根据配置获取 wasmer 编译和执行引擎 + // Get the wasmer compilation and execution engine according to the configuration vm := GetWasmEngine(wasmConfig.VmConfig.Engine) if vm == nil { log.DefaultLogger.Errorf("[wasm][plugin] NewWasmPlugin fail to get wasm engine: %v", wasmConfig.VmConfig.Engine) @@ -236,7 +236,7 @@ func NewWasmPlugin(wasmConfig v2.WasmPluginConfig) (types.WasmPlugin, error) { return nil, ErrWasmBytesIncorrect } - // 创建 WASM 模块,WASM 模块是已被编译的无状态二进制代码 + // Create the WASM module, which is the stateless binary code that has been compiled module := vm.NewModule(wasmBytes) if module == nil { log.DefaultLogger.Errorf("[wasm][plugin] NewWasmPlugin fail to create module, config: %v", wasmConfig) @@ -253,7 +253,7 @@ func NewWasmPlugin(wasmConfig v2.WasmPluginConfig) (types.WasmPlugin, error) { plugin.SetCpuLimit(wasmConfig.VmConfig.Cpu) plugin.SetMemLimit(wasmConfig.VmConfig.Mem) - // 创建包含模块和运行时状态的实例,值得关注的是,这里最终会调用 proxywasm.RegisterImports 注册用户实现的 Imports 函数,比如示例中的 proxy_invoke_service 和 proxy_get_state + // Contains module and runtime state to create instance, notable is that here will call proxywasm. RegisterImports registered users realize the Imports of function, Examples include proxy_invoke_service and proxy_get_state actual := plugin.EnsureInstanceNum(wasmConfig.InstanceNum) if actual == 0 { log.DefaultLogger.Errorf("[wasm][plugin] NewWasmPlugin fail to ensure instance num, want: %v got 0", instanceNum) @@ -286,18 +286,18 @@ func (f *FilterConfigFactory) OnPluginStart(plugin types.WasmPlugin) { instance.Lock(a) defer instance.Unlock() - // 使用 exports 函数 proxy_get_id(对应到 WASM 插件中 GetID 函数)获取 WASM 的 ID + // Use the exports function proxy_get_id (which corresponds to the GetID function in the WASM plug-in) to get the ID of WASM id, err := exports.ProxyGetID() if err != nil { log.DefaultLogger.Errorf("[proxywasm][factory] createProxyWasmFilterFactory fail to get wasm id, PluginName: %s, err: %v", plugin.PluginName(), err) return true } - // 把ID 和 对应的插件注册到路由中,即可通过 http Header 中的键值对进行路由,比如 'id:id_1' 就会根据 id_1 路由到上面的 Function1 + // If you register the ID and the corresponding plug-in in the route, the route can be performed using the key-value pair in the http Header. For example, 'id:id_1' is routed to Function1 based on id_1 f.router.RegisterRoute(id, wasmPlugin) - // 当第一个插件使用给定的根 ID 加载时通过 proxy_on_context_create 创建根上下文,并在虚拟机的整个生命周期中持续存在,直到 proxy_on_delete 删除 - // 值得注意的是这里说的第一个插件指的是多个松散绑定的插件(通过 SDK 使用 Root ID 对 Root Context 访问)在同一已配置虚拟机内共享数据的使用场景 [4] + // The root context is created by proxy_on_context_create when the first plug-in is loaded with the given root ID and persists for the entire life of the virtual machine until proxy_on_delete is deleted + // It is worth noting that the first plug-in here refers to a use case where multiple loosely bound plug-ins (accessed via the SDK using the Root ID to the Root Context) share data within the same configured virtual machine [4] err = exports.ProxyOnContextCreate(f.RootContextID, 0) if err != nil { log.DefaultLogger.Errorf("[proxywasm][factory] OnPluginStart fail to create root context id, err: %v", err) @@ -309,7 +309,7 @@ func (f *FilterConfigFactory) OnPluginStart(plugin types.WasmPlugin) { vmConfigSize = vmConfigBytes.Len() } - // VM 伴随启动的插件启动时调用 + // VM is called when the plug-in is started with the startup _, err = exports.ProxyOnVmStart(f.RootContextID, int32(vmConfigSize)) if err != nil { log.DefaultLogger.Errorf("[proxywasm][factory] OnPluginStart fail to create root context id, err: %v", err) @@ -321,7 +321,7 @@ func (f *FilterConfigFactory) OnPluginStart(plugin types.WasmPlugin) { pluginConfigSize = pluginConfigBytes.Len() } - // 当插件加载或重新加载其配置时调用 + // Called when the plug-in loads or reloads its configuration _, err = exports.ProxyOnConfigure(f.RootContextID, int32(pluginConfigSize)) if err != nil { log.DefaultLogger.Errorf("[proxywasm][factory] OnPluginStart fail to create root context id, err: %v", err) @@ -340,18 +340,18 @@ The workflow for Layotto Middle WASM is broadly as shown in figure 2 Layotto & M
Figure 2 Layotto & Mosn WAS Workflow
-1、由 Layotto 底层 Mosn 收到请求,经过 workpool 调度,在 proxy downstream 中按照配置依次执行 StreamFilterChain 到 Wasm StreamFilter 的 OnReceive 方法,具体逻辑详见如下代码: +By Layotto underneath Mosn, as a workpool schedule, implement the OnReceive method of StreamFilterChain to Wasm StreamFilter in proxy downstream, as configured and detailed in code: below ```go func (f *Filter) OnReceive(ctx context.Context, headers api.HeaderMap, buf buffer.IoBuffer, trailers api.HeaderMap) api.StreamFilterStatus { - // 获取 WASM 插件的 id + // Gets the id of the WASM plug-in id, ok := headers.Get("id") if !ok { log.DefaultLogger.Errorf("[proxywasm][filter] OnReceive call ProxyOnRequestHeaders no id in headers") return api.StreamFilterStop } - // 从 router 中根据 id 获取对应的 WASM 插件 + // Obtain the WASM plug-in from the router based on its id wasmPlugin, err := f.router.GetRandomPluginByID(id) if err != nil { log.DefaultLogger.Errorf("[proxywasm][filter] OnReceive call ProxyOnRequestHeaders id, err: %v", err) @@ -360,29 +360,29 @@ func (f *Filter) OnReceive(ctx context.Context, headers api.HeaderMap, buf buffe f.pluginUsed = wasmPlugin plugin := wasmPlugin.plugin - // 获取 WasmInstance 实例 + // Obtain an instance of WasmInstance instance := plugin.GetInstance() f.instance = instance f.LayottoHandler.Instance = instance - // ABI 包含 导出(Exports)和导入(Imports)两个部分,用户通过这它们与 WASM 扩展插件进行交互 + // The ABI consists of Exports and Imports, through which users interact with the WASM extension pluginABI := abi.GetABI(instance, AbiV2) if pluginABI == nil { log.DefaultLogger.Errorf("[proxywasm][filter] OnReceive fail to get instance abi") plugin.ReleaseInstance(instance) return api.StreamFilterStop } - // 设置导入 Imports 部分,导入部分由用户提供,虚拟机的执行需要依赖宿主机 Layotto 提供的部分能力,例如获取请求信息,这些能力通过导入部分由用户提供,并由 WASM 扩展调用 + // Set the Imports section. The import section is provided by the user. The execution of the virtual machine depends on some of the capabilities provided by the host Layotto, such as obtaining request information, which are provided by the user through the import section and invoked by the WASM extension pluginABI.SetABIImports(f) - // 导出 Exports 部分由 WASM 插件提供,用户可直接调用——唤醒 WASM 虚拟机,并在虚拟机中执行对应的 WASM 插件代码 + // The Exports section is provided by the WASM plug-in and can be called directly by the user to wake up the WASM virtual machine and execute the corresponding WASM plug-in code in the virtual machine exports := pluginABI.GetABIExports().(Exports) f.exports = exports instance.Lock(pluginABI) defer instance.Unlock() - // 根据 rootContextID 和 contextID 创建当前插件上下文 + // Create the current plug-in context according to rootContextID and contextID err = exports.ProxyOnContextCreate(f.contextID, wasmPlugin.rootContextID) if err != nil { log.DefaultLogger.Errorf("[proxywasm][filter] NewFilter fail to create context id: %v, rootContextID: %v, err: %v", @@ -395,7 +395,7 @@ func (f *Filter) OnReceive(ctx context.Context, headers api.HeaderMap, buf buffe endOfStream = 0 } - // 调用 proxy-wasm-go-host,编码请求头为规范指定的格式 + // Call proxy-wasm-go-host, encoding the request header in the format specified by the specification action, err := exports.ProxyOnRequestHeaders(f.contextID, int32(headerMapSize(headers)), int32(endOfStream)) if err != nil || action != proxywasm.ActionContinue { log.DefaultLogger.Errorf("[proxywasm][filter] OnReceive call ProxyOnRequestHeaders err: %v", err) @@ -415,7 +415,7 @@ func (f *Filter) OnReceive(ctx context.Context, headers api.HeaderMap, buf buffe } if f.requestBuffer != nil && f.requestBuffer.Len() > 0 { - // 调用 proxy-wasm-go-host,编码请求体为规范指定的格式 + // Call proxy-wasm-go-host, encoding the request body in the format specified by the specification action, err = exports.ProxyOnRequestBody(f.contextID, int32(f.requestBuffer.Len()), int32(endOfStream)) if err != nil || action != proxywasm.ActionContinue { log.DefaultLogger.Errorf("[proxywasm][filter] OnReceive call ProxyOnRequestBody err: %v", err) @@ -424,7 +424,7 @@ func (f *Filter) OnReceive(ctx context.Context, headers api.HeaderMap, buf buffe } if trailers != nil { - // 调用 proxy-wasm-go-host,编码请求尾为规范指定的格式 + // Call proxy-wasm-go-host, encoding the request tail in the format specified by the specification action, err = exports.ProxyOnRequestTrailers(f.contextID, int32(headerMapSize(trailers))) if err != nil || action != proxywasm.ActionContinue { log.DefaultLogger.Errorf("[proxywasm][filter] OnReceive call ProxyOnRequestTrailers err: %v", err) @@ -459,11 +459,11 @@ func (a *ABIContext) CallWasmFunction (functionName string, args ..interface{}) } ``` -3、WASMER 虚拟机经过处理调用 WASM 插件的具体函数,比如例子中的 OnHttpRequestBody 函数 -// function, _:= instance.Exports.GetFunction("exported_function") -// nativeFunction = function.Native() -//_ = nativeFunction(1, 2, 3) -// Native 会将 Function 转换为可以调用的原生 Go 函数 +3. The WASMER virtual machine is processed to call specific functions of the WASM plug-in, such as the OnHttpRequestBody function in the example + // function, _:= instance.Exports.GetFunction("exported_function") + // nativeFunction = function.Native() + //_ = nativeFunction(1, 2, 3) + // Native converts Function to a native Go function that can be called ```go func (self *Function) Native() NativeFunction { @@ -483,7 +483,7 @@ func (self *Function) Native() NativeFunction { C.wasm_val_vec_new(&arguments, C.size_t(numberOfReceivedParameters), (*C.wasm_val_t)(unsafe.Pointer(&allArguments[0]))) } - // 调用 WASM 插件内函数 + // Call functions inside the WASM plug-in trap := C.wasm_func_call(self.inner(), &arguments, &results) runtime.KeepAlive(arguments) @@ -498,7 +498,7 @@ func (self *Function) Native() NativeFunction { 4, proxy-wasm-go-sdk converts the requested data from the normative format to a user-friendly format and then calls the user extension code.Proxy-wasm-go-sdk, based on proxy-waste/spec implementation, defines the interface between function access to system resources and infrastructure services, and builds on this integration of the Runtime API, adding ABI to infrastructure access. ```go -// function1主要逻辑就是接收 HTTP 请求,然后通过 ABI 调用 function2,并返回 function2 结果,具体代码如下所示 +// function1The main logic is to receive the HTTP request, call function2 using the ABI, and return the function2 result. The code is as follows func (ctx *httpHeaders) OnHttpRequestBody(bodySize int, endOfStream bool) types.Action { //1. get request body body, err := proxywasm.GetHttpRequestBody(0, bodySize) @@ -631,4 +631,4 @@ Layotto WebAssemly involves more basic WASM knowledge, but it is understandable - [3] [WebAssembly for Proxies (ABI Spec)](https://github.com/proxy-wasm/spec) - [4] [Proxy WebAssembly Architecture](https://techhenzy.com/proxy-webassembly-archive/) - [5] [Layotto source parse — processing RPC requests](https://mosn.io/layotto/#/blog/code/layotto-rpc/index) -- [6] [云原生运行时的下一个五年](https://www.soft.tech/blog/the-next-fuve-years-of-cloud-native-runtime/) +- [6] [Cloud native runtime for the next five years](https://www.soft.tech/blog/the-next-fuve-years-of-cloud-native-runtime/) diff --git a/docs/i18n/en-US/docusaurus-plugin-content-blog/exploration-and-practice-of-antcloud-native-application-runtime-archsummit-shanghai.md b/docs/i18n/en-US/docusaurus-plugin-content-blog/exploration-and-practice-of-antcloud-native-application-runtime-archsummit-shanghai.md index e21bb184c7..19977b713f 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-blog/exploration-and-practice-of-antcloud-native-application-runtime-archsummit-shanghai.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-blog/exploration-and-practice-of-antcloud-native-application-runtime-archsummit-shanghai.md @@ -2,11 +2,12 @@ > The introduction of the Mesh model is a key path to the application of clouds and ant groups have achieved mass landings internally.The sinking of more middleware capabilities, such as Message, DB, Cache Mesh and others, will be the future shape of intermediate technology when the app evolves from Mesh.Apps run to help developers construct cloud native apps quickly and to further decouple apps and infrastructure, while the app runs at the core of API standards, the community is expected to build together. -> ![](https://gw.alipaayobjects.com/mn/rms_1c90e8/afts/img/A*nergRo8-RI0AAAAAAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*nergRo8-RI0AAAAAAAAAAAAAARQnAQ) ## Ant Group Mesh Introduction -Ant Financial is a technology and innovation-driven company. From the earliest payment application on Taobao to the current large-scale company serving globally over 1.2 billion users, the evolution of Ant's technological architecture can be roughly divided into the following stages: +Ant is a technology and innovation-driven company, from its earliest days as a payment app on Taobao to its current services +As a large company with 1.2 billion users worldwide, Ant's technical architecture evolution will probably be divided into the following stages: Prior to 2006, the earliest payment was a centralized monolithic application with modular development of different businesses. @@ -18,7 +19,7 @@ In 2014, like the advent of more business formalities like rush flow, online pay In 2020, ant business was not only digital finance, but also the emergence of new strategies such as digital life and internationalization, which prompted us to have a more efficient technical structure that would allow the operation to run faster and more steadily, so ant ants were able to internalize a more popular concept of cloud-origin in the industry. -> ![](https://gw.alipaayobjects.com/ms_1c90e8/afts/img/A*KCSVTZWSf8wAAAAAAAAAAAAAAAAAAARQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*KCSVTZWSf8wAAAAAAAAAAAAAARQnAQ) The technical structure of ant can also be seen to evolve along with the business innovations of the company from centralization to SOA to microservices, believing that the classmates with microservices are well known and that the practice of microservices to clouds has been explored by ants themselves in recent years. @@ -26,7 +27,7 @@ The technical structure of ant can also be seen to evolve along with the busines Since ant has a complete set of microservice governance intermediaries, why do you need to introduce Service Mesh? -> ![](https://gw.alipaayobjects.com/md/rms_1c90e8/afts/img/A*Sq7oR6eO2QAAAAAAAAAAAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*Sq7oR6eO2QAAAAAAAAAAAAAAARQnAQ) The service framework for ant self-research is SOFARPC as an example of a powerful SDK that includes a range of capabilities such as discovery of services, routing, melting out streams, etc.In a basic SOFA(Javaa) app, business code integrates SOFARP's SDK, both running in a process.After the large scale of sunk microservice, we faced some of the following problems with: @@ -54,8 +55,7 @@ Twenty and eleven years in 2020, more than 80% of online applications are connec Mesh at ant landing size is about thousands of applications and hundreds of thousands of levels of containers, a scale that falls in industry to a few and two times without a previous path to learn, so as ant arrives in a complete system of research and development delivery to support the mesh of ants as he arrives. -> ![](https://gw.alipaayobjects.com/mn/rms_1c90e8/afts/img/AeAlMT7SMTpMAAAAAAAAAAAAAAAAAAAARQNAQ) - +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*eAlMT7SMTpMAAAAAAAAAAAAAARQnAQ) Ant Mesh structure is probably our control plane, as shown in the graph, and the service end of the service governance centre, PaaS, monitoring centre, etc. are deployed as some of the existing products.There are also our transport systems, including R&D platforms and PaaS platforms.The middle is our main player data plane MOSN, which manages RPC, messages, MVC, Tasks four streams, as well as basic capabilities for health screening, monitoring, configuration, security, and technical risks, and MOSN blocks some interaction between operations and basic platforms.DBMesh is an independent product in the ant and is not drawn in the graph.Then the top tier is some of our applications that currently support access to many languages such as Java, Nodejs. For applications, while infrastructure decoupling, access will require an additional upgrade cost, so in order to promote access to the app, ant makes the entire research and development delivery process, including by making the simplest access to the existing framework, by pushing forward in batches to manage risks and progress, and by allowing new applications default access to Mesh to do so. @@ -72,8 +72,8 @@ A part of the application of the new:ant in business compatible with different The earliest scenes from Service Mesh to Multi-Mesh:ant are Service Mesh, MOSN intercept traffic through network connecting agents, and other intermediates interact with the server through the original SDK.Now MOSN is more than a Service Mosh, but multi-Mesh, because, with the exception of RPC, we have supported more mesh Mesh landing sites, including messages, configurations, caches, etc.Each sinking intermediate can be seen, and almost all have a lightweight SDK on the side of the app, which, in the context of the first issue just a moment ago, finds a very large amount of lightweight SDK that needs to be maintained.In order to keep the features do not interact with each other, each feature opens different ports, calls with MOSN via different protocol.e.g. RPC protocol for RPC, MQ protocol for messages, cached Redis protocol.Then the current MOSN is more than just a flow orientation. For example, the configuration is to expose the API to use business code. -> ![](https://gw.alipaayobjects.com/ms_1c90e8/afts/img/A*80o8SYwyHJoAAAAAAAAAAAAAAAAAAAAAARQAQ) - +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*80o8SYwyHJoAAAAAAAAAAAAAARQnAQ) + To solve the problems and scenes we are thinking about the following points: Can the SDK be styled in different intermediaries, languages and languages? @@ -84,15 +84,15 @@ Can interoperability protocols be unified? Can the implementation of the bottom be replaced? -> ![](https://gw.alipaayobjects.com/ms_1c90e8/afts/img/A*hsZBQJg0VnoAAAAAAAAAAAAAAAAAAAAAARQAQAQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*hsZBQJg0VnoAAAAAAAAAAAAAARQnAQ) ## Ant Cloud Native Apps Runtime Structure Beginning last March, following several rounds of internal discussions and research into new ideas in industry, we introduced a concept of “cloud native apps” (hereinafter referred to as running on).By definition, we want this operation to include all distributive capabilities that the app cares for, help developers build your cloud native apps quickly, help apps and infrastructure to decouple more! -> ![](https://gw.alipaayobjects.com/ms_1c90e8/afts/img/A*iqQoTYAMA4YAAAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*iqQoTYAma4YAAAAAAAAAAAAAARQnAQ) -云原生应用运行时设计里核心的几个点如下: +The core points of runtime design for cloud-native applications are as follows: \*\*First \*\*, due to experience of MOSN sizing and associated shipping systems, we decided to build up our cloud native app on the basis of MOSN kernel. @@ -104,7 +104,7 @@ Beginning last March, following several rounds of internal discussions and resea **Running abstract capabilities** -> ![](https://gw.alipaayobjects.com/mn/rms_1c90e8/afts/img/A*hWIVR6ccduYAAAAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*hWIVR6ccduYAAAAAAAAAAAAAARQnAQ) To abstract some of the capabilities most needed for cloud apping, we set a few principles: @@ -116,33 +116,33 @@ With this principle, we abstract out the primary API, which is the app for mosn. Three examples of this proto can be seen at: -> ![](https://gw.alipaayobjects.com/ms_1c90e8/afts/img/A*J76nQoLLYWgAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*J76nQoLLYWgAAAAAAAAAAAAAARQnAQ) **Run Component Controls** On the other hand, we have two concepts in MOSN for the purpose of realizing replaceability when running. We call a distribution capability and then have a different component to perform this Service, a service that can be implemented with multiple components, and a component that can deliver multiple services.For example, the example in the graph is that the service with the message "MQ-pub" is implemented by SOFAMQ and Kafka Component, while Kafka Component implements both the message and health check service. When a transaction is actually requested via a gRPC-generated client, the data will be sent to Runtime via the gRPC protocol and distributed to the next specific implementation.In this way, the app needs to use only the same set of API, which can be implemented differently by the parameters in the request or when the configuration is running. -> ![](https://gw.alipaayobjects.com/mn/rms_1c90e8/afts/img/A*dK9rRLTvtlMAAAAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*dK9rRLTvtlMAAAAAAAAAAAAAARQnAQ) **Compare between runtime and Mesh** Based on the above, when the cloud app is running and just just Mesh are easy to compare with: -> ![](https://gw.alipaayobjects.com/md/rms_1c90e8/afts/img/A*xyu9T74SD9MAAAAAAAAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*xyu9T74SD9MAAAAAAAAAAAAAARQnAQ) Scene started research last year while the cloud native app is running. The following scenes are currently falling inside the ant area. **Isomer Technical Stack Access** -> ![](https://gw.alipaayobjects.com/ms_1c90e8/afts/img/A*8UJhRbBg3zsAAAAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*8UJhRbBg3zsAAAAAAAAAAAAAARQnAQ) In the case of ants, applications in different languages, in addition to the need for RPC service governance, messages, etc., the infrastructure capabilities such as the one-size-fits-all intermediate of the ant are desirable and Java and Nodejs have corresponding SDKs, while the other languages are not corresponding SDKs.After the application runs, these isomer languages can be used directly through GRPC Client to the ant infrastructure. **Unbind the manufacturer** -> ![](https://gw.alipaayobjects.com/md/rms_1c90e8/afts/img/AeVoqRbkTFFwAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*eVoqRbkTFFwAAAAAAAAAAAAAARQnAQ) As mentioned earlier, ant blockchains, wind control, intelligent support services, financial intermediaries, etc., are scenes where they are deployed on their main stations, where there is either Aliyun or cloud.After running, the app can combine a set of code with a mirror when running. By configuring it to determine which bottom layer of implementation to be called, without being bound to specific implementations.For example, the internal interface between ant is for products such as SOFARegistration and SOFAMQ, and on the cloud is for products such as Nacos, RocketMQ, to Zokeper, Kafka and others.This scenario is in the process of reaching us.Of course, this can also be used for legacy system governance, such as upgrading from SOFAMQ 1.0 to SOFAMQ 2.0, and then running apps need not be upgraded. @@ -156,13 +156,13 @@ FaaS Cool is also a recent scene we are exploring and you know that the Function The most important part of the running time is the definition of the API. We already have a more complete set of APIs for the sake of getting inside, but we also see that many products in industry have similar demands, such as dapr, envoy, etc.So one of the next things we will do is to bring together communities to launch a set of recognized cloud native API. -> ![](https://gw.alipaayobjects.com/mn/rms_1c90e8/afts/img/A*d2BORogVotoAAAAAAAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*d2BORogVotoAAAAAAAAAAAAAARQnAQ) **Continuous Open Source** We will also develop our internal running practice in the near future, with a release of 0.1 in May and June, and keep a small monthly release pace, aiming to publish 1.0 by the end of the year. -> ![](https://gw.alipaayobjects.com/ms_1c90e8/afts/img/A*Kgr9QLc5TH4AAAAAAAAAAAAAAAAAARQAQAQ) +>![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*Kgr9QLc5TH4AAAAAAAAAAAAAARQnAQ) ## Summary @@ -182,8 +182,8 @@ Extend Reading - [Take you into Cloud Native Technology:Native Open Delivery Systems Exploration and Practices](https://mp.weixin.qq.com/s?_biz=MzUzU5Mjc1Nw===\&mid=2247488044\&idx=1\&sn=e6300d4b451723a5001cd3deb17fbc\&chksm=faa0f6cdd774e03ccd91300996747a8e7e109ecf810af147e08c663676946490\&scene=21) -- [积跬步至千里:QUIC 协议在蚂蚁集团落地之综述](https://mp.weixin.qq.com/s?__biz=MzUzMzU5Mjc1Nw==\&mid=2247487717\&idx=1\&sn=ca9452cdc10989f61afbac2f012ed712\&chksm=faa0ff3fcdd77629d8e5c8f6c42af3b4ea227ee3da3d5cdf297b970f51d18b8b1580aac786c3\&scene=21) +- [Taking a thousand miles one step at a time: A comprehensive overview of the QUIC protocol landing at Ant Group](https://mp.weixin.qq.com/s?__biz=MzUzMzU5Mjc1Nw==\&mid=2247487717\&idx=1\&sn=ca9452cdc10989f61afbac2f012ed712\&chksm=faa0ff3fcdd77629d8e5c8f6c42af3b4ea227ee3da3d5cdf297b970f51d18b8b1580aac786c3\&scene=21) -- [Rust 大展拳脚的新兴领域:机密计算](https://mp.weixin.qq.com/s?__biz=MzUzMzU5Mjc1Nw==\&mid=2247487576\&idx=1\&sn=0d0575395476db930dab4e0f75e863e5\&chksm=faa0ff82cdd77694a6fc42e47d6f20c20310b26cedc13f104f979acd1f02eb5a37ea9cdc8ea5\&scene=21) +- [Rust's emerging field showing its prowess: confidential computing](https://mp.weixin.qq.com/s?__biz=MzUzMzU5Mjc1Nw==\&mid=2247487576\&idx=1\&sn=0d0575395476db930dab4e0f75e863e5\&chksm=faa0ff82cdd77694a6fc42e47d6f20c20310b26cedc13f104f979acd1f02eb5a37ea9cdc8ea5\&scene=21) - [Protocol Extension Base on Wasm — protocol extension](https://mp.weixin.qq.com/s?_biz=MzUzU5Mjc1Nw===\&mid=2247487546\&idx=1\&sn=72c3f1e27ca4ace788e11ca20d5f9\&chksm=faa0ffe0cd776f6d17323466b500acee50a371663f18da34d8e4d72304d7681cf589b45\&scene=21) diff --git a/docs/i18n/en-US/docusaurus-plugin-content-blog/mosn-subproject-layotto-opening-a-new-chapter-in-service-grid-application-runtime/index.md b/docs/i18n/en-US/docusaurus-plugin-content-blog/mosn-subproject-layotto-opening-a-new-chapter-in-service-grid-application-runtime/index.md index d883d96bc5..498af68df5 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-blog/mosn-subproject-layotto-opening-a-new-chapter-in-service-grid-application-runtime/index.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-blog/mosn-subproject-layotto-opening-a-new-chapter-in-service-grid-application-runtime/index.md @@ -45,7 +45,7 @@ After seeing the huge gains from RPC capacity Mih, internal ants also transforme 1. Apply strong binding to infrastructure > ![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*nKxcTKLp4EoAAAAAAAAAAAAAARQnAQ) -> 一个现代分布式应用,往往会同时依赖 RPC、Cache、MQ、Config 等各种分布式能力来完成业务逻辑的处理。 +> A modern distributed application often relies on RPC, Cache, MQ, Config and other distributed capabilities to complete the processing of business logic. When RPC was initially seen, other capabilities were quickly sinking.Initially, they were developed in the most familiar way, leading to a lack of integrated planning management, as shown in the graph above, which relied on SDKs of a variety of infrastructure, and in which SDK interacted with MOSN in a unique way, often using private agreements provided by the original infrastructure, which led directly to a complex intermediate capability, but in essence the application was tied to the infrastructure, such as the need to upgrade the SDK from Redis to Memcache, which was more pronounced in the larger trend of the application cloud, assuming that if an application was to be deployed on the cloud, because the application relied on a variety of infrastructures, it would be necessary to move the entire infrastructure to the cloud before the application could be successfully deployed. So how to untie the application to the infrastructure so that it can be transplantable and that it can feel free to deploy across the platform is our first problem. @@ -53,7 +53,7 @@ So how to untie the application to the infrastructure so that it can be transpla 2. Isomal language connectivity > ![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*oIdQQZmgtyUAAAAAAAAAAAAAARQnAQ) -> 事实证明 Service Mesh 确实降低了异构语言的接入门槛,但在越来越多的基础能力下沉到 MOSN 以后,我们逐渐意识到为了让应用跟 MOSN 交互,各种 SDK 里都需要对通信协议,序列化协议进行开发,如果再加上需要对各种异构语言都提供相同的功能,那维护难度就会成倍上涨, +> It has been proved that Service Mesh does reduce the access threshold of heterogeneous languages, but after more and more basic capabilities sink to MOSN, we gradually realized that in order to allow applications to interact with MOSN, various SDKS need to develop communication protocols and serialization protocols. If you add in the need to provide the same functionality for a variety of heterogeneous languages, the difficulty of maintenance increases exponentially Service Mesh has made the SDK historic, but for the current scenario of programming languages and applications with strong infrastructural dependence, we find that the existing SDK is not thin enough, that the threshold for access to the isomer language is not low enough and that the threshold for further lowering the isomer language is the second problem we face. @@ -62,9 +62,9 @@ Service Mesh has made the SDK historic, but for the current scenario of programm ### A, what is Runtime? > ![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*hQT-Spc5rI4AAAAAAAAAAAAAARQnAQ) -> 20 年初的时候,Bilgin lbryam 发表了一篇名为 +> In the early 20th century, Bilgin lbryam published a paper called > Multi-Runtime Microservices Architecture -> 的文章,里面对微服务架构下一阶段的形态进行了讨论。 +> This article discusses the shape of the next phase of microservices architecture. As shown in the graph above, the author abstracts the demand for distributed services and is divided into four chaos: @@ -253,8 +253,8 @@ Finally, look at what Layotto does in the community. ### The APP -> ![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*GAe8QqZ03eoAAAAAAAAAAAAAARQnAQ) -> 关于如何定义一套标准的 API 以及如何让 Layotto 可以跑在 envoy 上等等事项,我们已经在各个社区进行了深入讨论,并且以后也还会继续推进。 +> ![](https://gw.alipayobjects.com/mdn/rms_1c90e8/afts/img/A*nKxcTKLp4EoAAAAAAAAAAAAAARQnAQ) +> We have had extensive discussions in the community about how to define a standard API and how Layotto can run on envoy, and we will continue to do so. ### C, Road map diff --git a/docs/i18n/en-US/docusaurus-plugin-content-blog/tcpcopy_code_analyze.md b/docs/i18n/en-US/docusaurus-plugin-content-blog/tcpcopy_code_analyze.md index 25ffc98f3d..e02beaf4ea 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-blog/tcpcopy_code_analyze.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-blog/tcpcopy_code_analyze.md @@ -19,7 +19,7 @@ Layotto 0e97e97e970dc504e0298017bd956d2841c44c0810b (main) ## Source analysis -### Code in: [tcpcopy代码](https://github.com/mosn/layotto/tree/main/pkg/filter/network/tcpcopy) +### Code in: [tcpcopy CODE](https://github.com/mosn/layotto/tree/main/pkg/filter/network/tcpcopy) ### model.go analysis @@ -48,7 +48,7 @@ Type DumpUpadDynamic Architect 6 This is the dump persistent core processing class of tcpcopy ```go -// 该方法在 tcpcopy.go 中 OnData 中调用 +// This method is called in OnData in tcpcopy.go func IsPersistence() bool { // 判断 dump 开关是否开启 if !strategy.DumpSwitch { @@ -58,7 +58,7 @@ func IsPersistence() bool { return false } - // 判断是否在采样窗口中 + // Check whether it is in the sampling window if atomic.LoadInt32(&strategy.DumpSampleFlag) == 0 { if log.DefaultLogger.GetLogLevel() >= log.DEBUG { log.DefaultLogger.Debugf("%s the dump sample flag is %d", model.LogDumpKey, strategy.DumpSampleFlag) @@ -66,7 +66,7 @@ func IsPersistence() bool { return false } - // 判断是否 dump 功能停止(获取系统负载判断处理器和内存是否超过 tcpcopy 的阈值,如果超过则停止) + // Check whether the dump function is stopped. Obtain the system load and check whether the processor and memory exceeds the threshold of the tcpcopy. If yes, stop the dump function. if !strategy.IsAvaliable() { if log.DefaultLogger.GetLogLevel() >= log.DEBUG { log.DefaultLogger.Debugf("%s the system usages are beyond max rate.", model.LogDumpKey) @@ -77,21 +77,21 @@ func IsPersistence() bool { return true } -// 根据配置信息持久化数据 +// Persist data based on configuration information func persistence(config *model.DumpUploadDynamicConfig) { - // 1.持久化二进制数据 + // 1.Persisting binary data if config.Binary_flow_data != nil && config.Port != "" { if GetTcpcopyLogger().GetLogLevel() >= log.INFO { GetTcpcopyLogger().Infof("[%s][%s]% x", config.Unique_sample_window, config.Port, config.Binary_flow_data) } } if config.Portrait_data != "" && config.BusinessType != "" { - // 2. 持久化用户定义的数据 + // 2. Persisting Binary data Persisting user-defined data if GetPortraitDataLogger().GetLogLevel() >= log.INFO { GetPortraitDataLogger().Infof("[%s][%s][%s]%s", config.Unique_sample_window, config.BusinessType, config.Port, config.Portrait_data) } - // 3. 增量持久化内存中的配置信息的变动内容 + // 3. Changes in configuration information in incrementally persistent memory buf, err := configmanager.DumpJSON() if err != nil { if log.DefaultLogger.GetLogLevel() >= log.DEBUG { @@ -99,7 +99,7 @@ func persistence(config *model.DumpUploadDynamicConfig) { } return } - // 3.1. 如果数据变化则 dump + // 3.1. dump if the data changes tmpMd5ValueOfMemDump := common.CalculateMd5ForBytes(buf) memLogger := GetMemLogger() if tmpMd5ValueOfMemDump != md5ValueOfMemDump || diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/README.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/README.md index 954a32439b..471e380f1c 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/README.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/README.md @@ -2,7 +2,7 @@ # Layotto (L8): To be the next layer of OSI layer 7 -[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml) +[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml) [![Layotto Dev Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml) [![GoDoc](https://godoc.org/mosn.io/layotto?status.svg)](https://godoc.org/mosn.io/layotto) diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/api_plugin/design.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/api_plugin/design.md index 3860492019..53fadad150 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/api_plugin/design.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/api_plugin/design.md @@ -283,7 +283,7 @@ Look at this example, you might ask:these callbacks, constructions and calls? The hook above is used to customize the start logic for the user extension.Layotto reverses the above life-cycle hooks and constructions during startup.Call order roughly: -`Layotto initialize all components` ---> Call `NewGrpcAPI` constructor ---> `GrpcAPI.Init` ---> ``Layotto create grpc server` --->``GrpcAPI.Register\`\` +`Layotto initialize all components` ---> Call `NewGrpcAPI` constructor ---> `GrpcAPI.Init` ---> ``Layotto create grpc server` ---> ``GrpcAPI.Register\`\` Graph below: diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc-design-doc.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc-design-doc.md index 286620a4e8..e8c7d4c989 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc-design-doc.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc-design-doc.md @@ -9,9 +9,9 @@ in order to decoupling with pb definition,add independent RPC abstrations. - invoker: provide complete rpc ability,currently only Mosn invoker - callback:before/after filter,extend with custom logic(eg: protocol convertion) - channel:send request and receive response, talk to diffrent transport protocol(http、bolt...) - + due to Mosn do all the dirty work, a lightweight framework is enough for layotto currently. - + ![img.png](../../../img/rpc/rpc-layer.png) @@ -48,9 +48,9 @@ In layotto, we design a convenient way to support xprotocols. The only task need "channel": [{ "size": 16, // analogy to connection nums "protocol": "http", // communicate with mosn via this protocol - "listener": "egress_runtime_http" // mosn's protocol listener name - }] - } - } -} + "listener": "egress_runtime_http" // mosn's protocol listener name + }] + } + } + } ``` \ No newline at end of file diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/component_ref/component_ref.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/component_ref/component_ref.md index 8d11422ecb..adc7259e50 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/component_ref/component_ref.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/component_ref/component_ref.md @@ -7,7 +7,7 @@ When a component starts, it may need to use another component's skill. For examp To make this happen, layotto offers the "component reference" feature. This feature lets component A use the features of component B. ### Related Designs -Currently, other components can only reference two types of components: ConfigStore and SecretStore. These are used to get configuration and secret keys. +Currently, other components can only reference two types of components: ConfigStore and SecretStore. These are used to get configuration and secret keys. The "referenced" components must implement the interface : diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/faas/start.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/faas/start.md index b43455548b..b97834c3b1 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/faas/start.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/faas/start.md @@ -19,7 +19,7 @@ The following software needs to be installed to run this demo: Follow the instructions on the official website. 3. [virtualbox](https://www.oracle.com/virtualization/technologies/vm/virtualbox.html) - + Download the installation package from the official website and install it. You can also use [homebrew](https://brew.sh/) to install it on mac. If the startup fails after installation, please refer to [The host-only adapter we just created is not visible](https://github.com/kubernetes/minikube/issues/3614). @@ -156,7 +156,7 @@ There are 100 inventories for book1. 1. Virtualbox failed to start, "The host-only adapter we just created is not visible": - refer [The host-only adapter we just created is not visible](https://github.com/kubernetes/minikube/issues/3614) + refer [The host-only adapter we just created is not visible](https://github.com/kubernetes/minikube/issues/3614) 2. When Layotto is started, the redis connection fails, and "occurs an error: redis store: error connecting to redis at" is printed: diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/file/minio.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/file/minio.md index 140bd5c82e..9b5a794d18 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/file/minio.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/file/minio.md @@ -131,4 +131,4 @@ Continue to experience other APIs with the navigation bar on the left! #### Learn how to implement File API -If you are interested in implementing the rationale or want to expand some features, you can read the [File API design document](en/design/file/file-design.md) +If you are interested in implementing the rationale or want to expand some features, you can read the [File API design document](../../design/file/file-design.md) diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/network_filter/tcpcopy.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/network_filter/tcpcopy.md index c1ee76ff36..227fd6aafe 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/network_filter/tcpcopy.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/network_filter/tcpcopy.md @@ -22,7 +22,7 @@ The meaning of this configuration is to load the tcpcopy plug-in at startup to d After enabling this configuration, when Layotto receives a request and the conditions for traffic dump are met, it will write the binary request data to the local file system. -The "dumped" binary traffic data will be stored in the `${user's home directory}/logs/mosn` directory, or under the /home/admin/logs/mosn directory: +The "dumped" binary traffic data will be stored in the ` ${user's home directory}/logs/mosn` directory, or under the /home/admin/logs/mosn directory: ![img.png](/img/tcp_dump.png) diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/stream_filter/flow_control.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/stream_filter/flow_control.md index 1a1d9ea1df..ed1e82801c 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/stream_filter/flow_control.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/stream_filter/flow_control.md @@ -1,8 +1,6 @@ [查看中文版本](docs/start/stream_filter/flow_control.md) -# Method Level Flow Control - -## Flow Control +## Method Level Flow Control ### Introduction diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/wasm/start.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/wasm/start.md index 40b9028a66..6acdc4a5b5 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/wasm/start.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/wasm/start.md @@ -100,24 +100,26 @@ docker rm -f redis-test We can specify the WASM file to be loaded in `./demo/faas/config.json` config file: ```json + "config": { - "function1": { - "name": "function1", - "instance_num": 1, - "vm_config": { - "engine": "wasmtime", - "path": "demo/faas/code/golang/client/function_1.wasm" - } - }, - "function2": { - "name": "function2", - "instance_num": 1, - "vm_config": { - "engine": "wasmtime", - "path": "demo/faas/code/golang/server/function_2.wasm" - } - } +"function1": { +"name": "function1", +"instance_num": 1, +"vm_config": { +"engine": "wasmtime", +"path": "demo/faas/code/golang/client/function_1.wasm" +} +}, +"function2": { +"name": "function2", +"instance_num": 1, +"vm_config": { +"engine": "wasmtime", +"path": "demo/faas/code/golang/server/function_2.wasm" +} } +} + ``` tip: we also support wasmer as the engine value in vm_config. diff --git a/docs/i18n/en-US/docusaurus-plugin-content-pages/index.md b/docs/i18n/en-US/docusaurus-plugin-content-pages/index.md index ce6af7159d..5e3f1ec351 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-pages/index.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-pages/index.md @@ -2,7 +2,7 @@ # Layotto (L8): To be the next layer of OSI layer 7 -[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml) +[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml) [![Layotto Dev Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml) [![GoDoc](https://godoc.org/mosn.io/layotto?status.svg)](https://godoc.org/mosn.io/layotto) diff --git a/docs/src/pages/index.md b/docs/src/pages/index.md index bce07879ed..2d76c81210 100644 --- a/docs/src/pages/index.md +++ b/docs/src/pages/index.md @@ -1,7 +1,7 @@ # Layotto (L8): To be the next layer of OSI layer 7 -[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml) +[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml) [![Layotto Dev Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml) [![GoDoc](https://godoc.org/mosn.io/layotto?status.svg)](https://godoc.org/mosn.io/layotto) @@ -164,17 +164,17 @@ Layotto enriches the
CNCF CLOUD N ## 设计文档 -[Actuator 设计文档](docs/design/actuator/actuator-design-doc) +[Actuator 设计文档](/docs/design/actuator/actuator-design-doc) -[Pubsub API 与 Dapr Component 的兼容性](docs/design/pubsub/pubsub-api-and-compability-with-dapr-component) +[Pubsub API 与 Dapr Component 的兼容性](/docs/design/pubsub/pubsub-api-and-compability-with-dapr-component) -[Configuration API with Apollo](docs/design/configuration/configuration-api-with-apollo) +[Configuration API with Apollo](/docs/design/configuration/configuration-api-with-apollo) -[RPC 设计文档](docs/design/rpc/rpc_design_document) +[RPC 设计文档](/docs/design/rpc/rpc_design_document) -[分布式锁 API 设计文档](docs/design/lock/lock-api-design) +[分布式锁 API 设计文档](/docs/design/lock/lock-api-design) -[FaaS 设计文档](docs/design/faas/faas-poc-design) +[FaaS 设计文档](/docs/design/faas/faas-poc-design) ## FAQ