diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a49c89b7c8..c377e9f3f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ None of these is essential for a pull request, but they will all help. 9. Make sure checks have been correctly passed, you can simply run `make check` 10. Contribute a Pull Request as the rule of Github Workflow, and you should follow the pull request's rules. -> Layotto provides many useful commands to help you contribute easier, please check it [here](docs/en/development/commands.md) +> Layotto provides many useful commands to help you contribute easier, please check it [here](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/commands.md) ## Version naming convention diff --git a/README.md b/README.md index 9b77d06225..cfa1e1104c 100644 --- a/README.md +++ b/README.md @@ -137,15 +137,15 @@ Layotto enriches the CNCF CLOUD N As a programming enthusiast , have you ever felt that you want to participate in the development of an open source project, but don't know where to start? In order to help everyone better participate in open source projects, our community will regularly publish community tasks to help everyone learn by doing! -[Document Contribution Guide](docs/en/development/contributing-doc.md) +[Document Contribution Guide](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/contributing-doc.md) -[Component Development Guide](docs/en/development/developing-component.md) +[Component Development Guide](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/developing-component.md) -[Layotto Github Workflows](docs/en/development/github-workflows.md) +[Layotto Github Workflows](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/github-workflows.md) -[Layotto Commands Guide](docs/en/development/commands.md) +[Layotto Commands Guide](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/commands.md) -[Layotto Contributor Guide](docs/en/development/CONTRIBUTING.md) +[Layotto Contributor Guide](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/CONTRIBUTING.md) ## Contributors @@ -157,17 +157,17 @@ Thank y'all! ## Design Documents -[Actuator Design Doc](docs/en/design/actuator/actuator-design-doc.md) +[Actuator Design Doc](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/actuator/actuator-design-doc.md) -[Configuration API with Apollo](docs/en/design/configuration/configuration-api-with-apollo.md) +[Configuration API with Apollo](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/configuration/configuration-api-with-apollo.md) -[Pubsub API and Compability with Dapr Component](docs/en/design/pubsub/pubsub-api-and-compability-with-dapr-component.md) +[Pubsub API and Compability with Dapr Component](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/pubsub/pubsub-api-and-compability-with-dapr-component.md) -[RPC Design Doc](docs/en/design/rpc/rpc-design-doc.md) +[RPC Design Doc](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc-design-doc.md) -[Distributed Lock API Design](docs/en/design/lock/lock-api-design.md) +[Distributed Lock API Design](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/lock/lock-api-design.md) -[FaaS Design](docs/en/design/faas/faas-poc-design.md) +[FaaS Design](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/faas/faas-poc-design.md) ## FAQ diff --git a/docs/docs/design/faas/faas-poc-design.md b/docs/docs/design/faas/faas-poc-design.md index c0b6bdcb29..e70e92d91b 100644 --- a/docs/docs/design/faas/faas-poc-design.md +++ b/docs/docs/design/faas/faas-poc-design.md @@ -1,7 +1,5 @@ # FaaS设计文档 -## FaaS设计 - ### 一、架构设计 ![img.png](../(/img/faas/faas-design.jpg) diff --git a/docs/docs/design/rpc/rpc_design_document.md b/docs/docs/design/rpc/rpc_design_document.md index 3bcae1388d..097a2ff04a 100644 --- a/docs/docs/design/rpc/rpc_design_document.md +++ b/docs/docs/design/rpc/rpc_design_document.md @@ -1,5 +1,5 @@ # RPC 设计文档 -## RPC 设计 + ### API 设计 [layotto rpc API](https://github.com/mosn/layotto/blob/f70cdc619693ad762cf809daf0579403c341def1/spec/proto/runtime/v1/runtime.proto#L19https://github.com/mosn/layotto/blob/f70cdc619693ad762cf809daf0579403c341def1/spec/proto/runtime/v1/runtime.proto#L19) 与Dapr保持一致. diff --git a/docs/docs/development/component_ref/component_ref.md b/docs/docs/development/component_ref/component_ref.md index bd060e708a..8188023fdb 100644 --- a/docs/docs/development/component_ref/component_ref.md +++ b/docs/docs/development/component_ref/component_ref.md @@ -1,6 +1,6 @@ # layotto组件引用 -## 背景 +### 背景 组件初始化的时候,需要引用其他组件的能力,比如sequencer组件初始化的时候需要从config组件读取相关的配置,以此实现组件之间的引用。 diff --git a/docs/docs/development/developing-api.md b/docs/docs/development/developing-api.md index 27ef59e83e..0da9eb5f58 100644 --- a/docs/docs/development/developing-api.md +++ b/docs/docs/development/developing-api.md @@ -9,9 +9,9 @@ A: 目前缺少使用文档,用户不好用,例如: -![img_1.png]((/img/development/api/img_1.png) +![img_1.png](/img/development/api/img_1.png) -![img_2.png]((/img/development/api/img_2.png) +![img_2.png](/img/development/api/img_2.png) 代码缺少注释,感兴趣的贡献者看不懂,例如 https://github.com/mosn/layotto/issues/112 @@ -45,8 +45,8 @@ A: **本规范只限制“新增Layotto API的pr需要有哪些东西”(比 提案需要包含以下内容: - 需求分析 - - 为什么要做这个API - - 定义需求的边界,哪些feature支持,哪些不支持 + - 为什么要做这个API + - 定义需求的边界,哪些feature支持,哪些不支持 - 市面上产品调研 - grpc/http API设计 - 组件API设计 @@ -79,7 +79,7 @@ A: **本规范只限制“新增Layotto API的pr需要有哪些东西”(比 正例:[Dapr pub-sub quickstart](https://github.com/dapr/quickstarts/tree/v1.0.0/pub-sub) 在操作之前贴图解释下要做什么事情 -![img.png]((/img/development/api/img.png) +![img.png](/img/development/api/img.png) 反例:文档只写了操作步骤1234,用户看不懂操作这些想干啥 @@ -103,7 +103,7 @@ A: **本规范只限制“新增Layotto API的pr需要有哪些东西”(比 ##### how.怎么用这个API - 接口列表。例如: -![img_4.png]((/img/development/api/img_4.png) +![img_4.png](/img/development/api/img_4.png) 列出来有哪些接口,一方面省的用户自己去翻proto、不知道哪些是相关API,一方面避免用户产生"这项目连接口文档都没有?!"的反感 - 关于接口的出入参:拿proto注释当接口文档 @@ -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 1f72aaef8b..1657c6c061 100644 --- a/docs/docs/development/developing-component.md +++ b/docs/docs/development/developing-component.md @@ -18,7 +18,7 @@ 文件夹名用组件名就行,比如redis的组件如下图 -![img.png]((/img/development/component/img.png) +![img.png](/img/development/component/img.png) 开发过程中可能用到的工具类(不是强制一定要用哈,列在这只是供参考,希望能简化开发): @@ -45,22 +45,22 @@ 首先,在configstore.go里,把所有调sdk、发起网络调用调apollo的地方给封装成一个interface -![mock.png]((/img/development/component/mock.png) -![img_8.png]((/img/development/component/img_8.png) +![mock.png](/img/development/component/mock.png) +![img_8.png](/img/development/component/img_8.png) 然后,把你代码中调sdk、做网络调用的代码封装成一个struct、实现刚才的interface: -![img_9.png]((/img/development/component/img_9.png) +![img_9.png](/img/development/component/img_9.png) 做了这一步重构后,你的代码就有可测性了(这也是"测试驱动开发"思想的一种体现,为了让代码可测性好,把代码重构成可以依赖注入的形式) 接下来,写ut的时候,可以mock刚才的interface: -![img_10.png]((/img/development/component/img_10.png) +![img_10.png](/img/development/component/img_10.png) 把mock后的东西注入到要测的struct里就行,然后测那个struct就行 -![img_11.png]((/img/development/component/img_11.png) +![img_11.png](/img/development/component/img_11.png) 注:一般“集成测试”的时候,会真正做网络调用、调一个正常的zookeeper或者redis;而单测注重测局部逻辑,不会调真实环境 @@ -72,10 +72,10 @@ 需要在cmd/layotto/main.go里集成进新的组件,包括: ### 3.1. 在main.go里import你的组件 -![img_1.png]((/img/development/component/img_1.png) +![img_1.png](/img/development/component/img_1.png) ### 3.2. 在main.go的NewRuntimeGrpcServer函数中注册你的组件 -![img_4.png]((/img/development/component/img_4.png) +![img_4.png](/img/development/component/img_4.png) 之后,用户如果在Layotto配置文件中配置了"我要用zookeeper",那么Layotto就会初始化zookeeper组件 @@ -93,7 +93,7 @@ 之后编辑修改一下图中的配置: -![img_3.png]((/img/development/component/img_3.png) +![img_3.png](/img/development/component/img_3.png) @@ -103,12 +103,12 @@ #### a. 如果该组件有通用客户端,就不用开发啦 如果demo目录下有common文件夹,代表这是个通用demo、能给不同的组件用,可以通过命令行传参传storeName,有这个就不用再开发demo啦 -![img_6.png]((/img/development/component/img_6.png) +![img_6.png](/img/development/component/img_6.png) #### b. 如果该组件没有通用客户端,或者需要定制一些metadata传参,那就复制粘贴改一改 比如zookeeper实现分布式锁,有一些定制配置,所以想自己新写个demo,那就复制粘贴redis的demo、改一改 -![img_7.png]((/img/development/component/img_7.png) +![img_7.png](/img/development/component/img_7.png) 注:demo的代码里如果出现不该有的错误,可以直接panic。后续我们会直接用demo跑集成测试,如果panic了代表集成测试没有通过。 例如demo/lock/redis/client.go 里: @@ -127,11 +127,11 @@ 注:下面这个Error没事,无视就好 -![img_2.png]((/img/development/component/img_2.png) +![img_2.png](/img/development/component/img_2.png) 启动demo、调用Layotto,看看有没有报错。如果是通用客户端,可以在命令行命令里带上-s storeName传入storeName -![img_5.png]((/img/development/component/img_5.png) +![img_5.png](/img/development/component/img_5.png) 没有报错的话说明测试通过! diff --git a/docs/docs/start/faas/start.md b/docs/docs/start/faas/start.md index eaf5ad9a70..83608589bf 100644 --- a/docs/docs/start/faas/start.md +++ b/docs/docs/start/faas/start.md @@ -1,6 +1,6 @@ # FaaS 快速开始 -## 一、功能介绍 +### 一、功能介绍 Layotto支持加载并运行以 wasm 为载体的 Function,并支持Function之间互相调用以及访问基础设施,如Redis。 diff --git a/docs/docs/start/wasm/start.md b/docs/docs/start/wasm/start.md index 8a0b6671af..ba21e168b6 100644 --- a/docs/docs/start/wasm/start.md +++ b/docs/docs/start/wasm/start.md @@ -1,7 +1,4 @@ # 将业务逻辑通过WASM下沉进sidecar - -## sidecar - ### 功能介绍 service mesh 和 multi-runtime 的 sidecar 是全公司通用的基础设施,但实践中,业务系统也会有自己的sdk,也会有推动用户升级难、版本碎片的问题. diff --git a/docs/i18n/en-US/docusaurus-plugin-content-blog/code/start_process/start_process.md b/docs/i18n/en-US/docusaurus-plugin-content-blog/code/start_process/start_process.md index f1db48d3fd..1dc2ce3ab4 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-blog/code/start_process/start_process.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-blog/code/start_process/start_process.md @@ -6,11 +6,11 @@ > Writing: 4 May 2022 - [Overview](#Overview) -- [源码分析](#source analysis) - - [1.cmd分析](#1.cmd analysis) - - [2.回调函数NewRuntimeGrpcServer分析](#2.callback function NewRuntimeGrpcServer analysis) - - [3.runtime分析](#3.runtime analyse) -- [总结](#summary) +- [source analysis](#source analysis) + - [1.cmd analysis](#1.cmd analysis) + - [2.Callback functionNewRuntimeGrpcServer分析](#2.callback function NewRuntimeGrpcServer analysis) + - [3.runtimeanalyze](#3.runtime analyse) +- [summary](#summary) ## Overview @@ -94,7 +94,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp ### runtime analysis -Look at the structure of runtime, the composition of the `runtime' at the aggregate level of the`:' +Look at the structure of runtime, the composition of the `runtime' at the aggregate level of the `:' ``` type MosnRuntime struct { 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 71740527b2..d5cde8b516 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 @@ -6,9 +6,9 @@ - [overview](#overview) - [source analysis](#source analysis) - - [Frame INIT](#Frame INIT) - - [workflow](#workflow) - - [FaaSmode](#FaaS mode) + - [Frame INIT](#Frame INIT) + - [workflow](#workflow) + - [FaaSmode](#FaaS mode) - [summary](#summary) ## General description diff --git a/docs/i18n/en-US/docusaurus-plugin-content-blog/current/code/start_process/start_process.md b/docs/i18n/en-US/docusaurus-plugin-content-blog/current/code/start_process/start_process.md index f1db48d3fd..d8c5b6411d 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-blog/current/code/start_process/start_process.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-blog/current/code/start_process/start_process.md @@ -94,7 +94,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp ### runtime analysis -Look at the structure of runtime, the composition of the `runtime' at the aggregate level of the`:' +Look at the structure of runtime, the composition of the `runtime' at the aggregate level of the `:' ``` type MosnRuntime struct { diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/faas/faas-poc-design.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/faas/faas-poc-design.md index e079140bd7..e4f1a806b2 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/faas/faas-poc-design.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/faas/faas-poc-design.md @@ -1,6 +1,5 @@ # FaaS Design Document -# FaaS Design ### Structure design ![img.png](../(/img/faas/faas-design.jpg) 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 e8c7d4c989..90b17d3cd6 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 @@ -1,5 +1,5 @@ # RPC DESIGN -## RPC DESIGN + ### API runtime rpc API is same with Dapr. diff --git a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc_design_document.md b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc_design_document.md index 5b712fa792..2279212ff1 100644 --- a/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc_design_document.md +++ b/docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc_design_document.md @@ -1,7 +1,5 @@ # RPC Design Document -## RPC Design - ### API Design [layotto rpc API](https://github.com/mosn/layotto/blob/f70cdc6196963ad762cf809daf0579403c341def1/spec/proto/runtime/v1/runtime.proto#L19 https://github.com/mosn/layotto/blob/f70cdc619693ad762cf809daf0579403c341def1/spec/proto/runtime/v1/runtime.proto#L19) is consistent with Dapr. 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 adc7259e50..0c67e88e00 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 @@ -1,5 +1,5 @@ # layotto component reference -## layotto component + ### Background When a component starts, it may need to use another component's skill. For example, when the `sequencer` component `A` starts, it needs to read its settings from the `config` component `B`. 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 b97834c3b1..ac7d827530 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 @@ -1,5 +1,5 @@ # FaaS QuickStart -## FaaS QuickStart + ### 1. Features Layotto supports loading and running functions in the form of wasm, and supports calling each other between functions and accessing infrastructure, such as Redis. 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 6acdc4a5b5..51b3d3d69e 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 @@ -1,5 +1,5 @@ # Run business logic in Layotto using WASM -## Run business logic in Layotto using WASM + ### What is WASM on Layotto? The sidecar of service mesh and multi-runtime is a common infrastructure for the whole company, but in practice, the business system will also have its own SDK, and it will also have the difficulty of pushing users to upgrade the SDK and the problem of version fragmentation.