Code Monkey home page Code Monkey logo

dubbo-rust's Introduction

Apache Dubbo-rust

logo

Apache Dubbo-rust, an RPC framework that implements Dubbo written in Rust.Please visit the official website for more information.

Build Status License

[ 中文 ]

Overview

Dubbo-rust is still under development. For now, gRPC calls based on HTTP2 have been implemented.

The following libraries are mainly dependent on:

  • Tokio is an event-driven, non-blocking I/O platform for writing asynchronous applications with Rust.

  • Prost is a Protocol Buffers implementation for Rust.

  • Hyper is a fast and correct HTTP implementation for Rust.

  • Serde is a framework for serializing and deserializing Rust data structures efficiently and generically.

Features

  • ✅ RPC synchronous / asynchronous call
  • ✅ IDL code automatic generation
  • 🚧 Multiple RPC protocol support (like Triple, Dubbo, gRPC, JSONRPC)
  • 🚧 Support TCP/HTTP2 transport protocol
  • 🚧 Service registration and discovery

Get started

  • Dubbo-rust Quick Start: 中文, English
  • Dubbo-rust Tutorials: Examples

Project structure

.
├── Cargo.toml
├── LICENSE
├── README.md
├── README_CN.md
├── common
│   ├── Cargo.toml
│   └── src
│       └── lib.rs
├── config
│   ├── Cargo.toml
│   └── src
│       ├── config.rs
│       ├── lib.rs
│       ├── protocol.rs
│       └── service.rs
├── contributing.md
├── docs
│   ├── filter-design.md
│   ├── generic-protocol-design.md
│   ├── readme.md
│   └── services.md
more ...

Contact Us

  • Subscribe to the official Wechat Account officialAccount

  • Search and join the DingTalk group: 44694199

Contribute

Welcome more developers to join us. About more details please check "How to contribute".

License

Apache Dubbo-rust software is licenced under the Apache License Version 2.0. See the LICENSE file for details.

dubbo-rust's People

Contributors

adachiandshimamura avatar albumenj avatar baerwang avatar chickenlj avatar daedalus2022 avatar dependabot[bot] avatar dongzl avatar g-xd avatar hubertshelley avatar i5ting avatar johankoi avatar kezhenxu94 avatar liudada114 avatar ljpgr avatar luoxiner avatar mozhou-tech avatar mxsm avatar onewe avatar rianico avatar robberphex avatar tuchg avatar xiaoqing91 avatar yang20150702 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dubbo-rust's Issues

[Proposal] Integrating a WebAssembly (wasm) runtime to support running business logic as a wasm module.

One feasible option is to integrate wasmtime, as wasm is a language-agnostic compilation target that can be obtained from a variety of languages (e.g. Go, Python, .Net) and supports hot swapping, providing Rust with an extension mechanism similar to or even better than Java's Service Provider Interface (SPI).

However, this is a preliminary idea and the wasm ecosystem is not yet fully mature. Some issues to consider include:

  1. Choosing or implementing a suitable wasm runtime.
  2. Managing the process of loading, unloading, and running wasm modules, and integrating with Dubbo's service registration and discovery.
  3. Providing comprehensive traffic control, load balancing, and runtime monitoring for wasm will also require further exploration.

In conclusion, a wasm runtime has the potential to bring great imagination to the Dubbo ecosystem, but there are still some issues to be addressed.

[Proposal] add c binding

Dubbo have different language binding for different scenario:

  • Dubbo Java for Java ecosystem.
  • Dubbo Go for Go ecosystem.
  • Dubbo Js for frontend scenario.
  • Dubbo Python for AI/ML scenario.

Dubbo Rust should cover low level programming/system programming. At this system-programming scenario, It's required to provide C binding.
Rust has standard build tool chain, Dubbo Rust's C binding is easier to build than pure C implement of Dubbo.

So, Could we have add c binding in Dubbo Rust's tasks?

Prepare for the first release

  1. 打包,暂时包含整个项目文件 tar -czvf dubbo-rust-v0.0.1.tar.gz ./dubbo-rust
  2. 生成 asc 签名 gpg -ab dubbo-rust-v0.0.1.tar.gz
  3. shasum -a 512 dubbo-rust-v0.0.1.tar.gz > dubbo-rust-v0.0.1.tar.gz.sha512
  4. 投票邮件
Hello Community,

This is a call for voting to release Apache Dubbo Rust version v0.1.0 and since this is the first formal relase of this rust language implementation please help to check the LICENSE carefully.

The release candidates:
https://dist.apache.org/repos/dist/dev/dubbo/dubbo-rust/v0.1.0/

Git tag for the release:
https://github.com/apache/dubbo-rust/tree/v0.1.0

Hash for the release tag:
xxx

Release Notes:
xxx

The artifacts have been signed with Key 28681CB1, which can be
found in the keys file:
https://dist.apache.org/repos/dist/dev/dubbo/KEYS

The vote will be open for at least 72 hours or until the necessary number of
votes are reached.

Please vote accordingly:

[ ] +1 approve
[ ] +0 no opinion
[ ] -1 disapprove with the reason

Thanks,
The Apache Dubbo Team

Rft: refactor config module and Dubbo init

The Goal

This issue aims at fixing the problem about config initialization and make the Dubbo::init "more rust".

Description

Hello everyone, I have found some little problems about config module, and some code style in Dubbo::init:

  1. In config module, the config::GLOBAL_ROOT_CONFIG use lazy_static! to create a RwLock, but the RootConfig may be initialized multiple time due to get the read lock incorrectly:
if GLOBAL_ROOT_CONFIG.read().unwrap().as_ref().is_none() { // the read lock has already be dropped
    ...
    // may be write multiple times
    *GLOBAL_ROOT_CONFIG.write().unwrap() = Some(c);
}

Regardless of the complex RwLock, maybe we can use once_cell instead of lazy_static, which has merged into Rust Nightly.
2. Dubbo::init exists many condition branch like if xxx.is_some(), but use pattern match (e.g. if let Some(v)) is more general in Rust (refer to #19 and P.CTF.02 优先使用模式匹配而非判断后再取值).

Protocol API Design

This issue discuss the ability of protocol, exporter and invoker trait.
Based on the discussion of result, we should design some funcs.

Protocol的设计文档见 docs 目录。

我们需要从Server/Client两个角度分别进行头脑风暴。

The CI is not running properly.

image

Actions arduino/setup-protoc@v1 is used for setup grpc tools, which is used for compile .proto file, and dubbo-rust use it for stub code generation.

Please add this to allowlist.

20221104 社区周会

墨舟:负载均衡(实现阶段,20%);参与Context模块

bobi:

  • 服务发现演示:dubbo-java进行服务注册,dubbo-rust client进行服务发现
  • todo: 将待做的任务分解为子issue

dubbo rust demo演示以及代码结构简单分享

2022-04-25 社区第一次会议

会议纪要

参会人员:刘军、郭炜斌、过迷雾、月半酱

会议结论:

  • 讨论了 dubbo rust 项目的第一阶段总体目标:先实现 rpc 通信协议,再迭代服务治理如服务发现等能力
  • Apache 项目注意事项:以来代码一定兼容 Apache License,引用开源代码一定提前说明并注明出处
  • 前期先由刘军负责协调项目工作,包括在大家成为 Apache Committer 前负责合并代码

任务项:

  • 刘军 给出 Dubbo 总体架构,并尝试对任务项进行分解
  • 过迷雾 搭建项目基本结构
  • 调研 Tonic ,尝试参考设计出 dubbo triple 协议实现的基本架构与流程、包括框架选型等

Weekly 20221027 社区周会

会议纪要如下:(有不完整的或者描述错误的,大家补充一下

具体任务分配

需要军哥分享一下PPT;同时将任务新建issue来管理

项目进度

bobi:
服务注册:metadata解析
服务发现:周末赶进度,可以提供一个demo版本

雷杰:
Tower超时流程,Filter流程;

杨阳:
完成了上次周会遗留的工作

dubbo-rust协同工作

在Github上管理任务(issue),代码建议小batch多提交

关于issue的讨论,最好在Github上对应的issue下;没有的话,可以新建一个

对Rust的讨论

rust:零抽象(特性) ——> 难 ——> 适合做什么项目。

Rust难在哪儿

  • Rust的内存管理
  • Rust的所有权

内存管理:Rust 内存管理

Python的内存回收机制中有“借用”的概念

Rust可以做什么

Rust适合写 更贴近Unix系统库的程序

BPF

unix 系统库 -> dpdk ->

rust写kernel模块;标准化构建方式:cargo。

rust写docker:不太适合

控制面:并不需要太高的性能
数据面:性能要求高一些的场景。可以用Rust,类似于DPDK

桌面应用:面向下一代的electron
前端,wasm,二进制的逆向成本更高。
嵌入式

dubbo-rust的优势

dubbo-rust: http 通信 ——> RPC通信。可以将Rust写的微服务接入到现在的微服务框架体系中。避免了Rust Server -> C SDK -> CGO -> Golang微服务 -> Golang微服务框架这一复杂的链路

对于dubbo-rust的推广使用,doc很重要,可以更快地让用户上手

dubbo-rust:能够提供比较稳定的性能;希望使用Rust做新的东西,形式化证明框架

[Fix] fix the echo example

Goal

Fix the echo example.

Description

Hello, everyone. I have tried to run: cargo run --bin echo-server but get a panic. I have found two problems:

  1. config::RootConfig::test_config don't set the registry when build the ServiceConfig.
  2. ServiceConfig sets the name, which hasn't supported in the hello_echo.rs.

Currently, the hello_echo.rs only support the url just like /grpc.examples.echo.Echo/UnaryEcho, but we will build a url like {ServiceConfig name}/grpc.examples.echo.Echo/UnaryEcho according to the config::RootConfig::test_config.

[Discussion] Using Rust in the Dubbo ecosystem can bring many benefits due to Rust's affinity with low-level languages such as C/C++.

Some potential benefits include:

  1. Native integration with RPC protocols such as Thrift, enabling a unified data plane in a low-level language.
  2. Use of C/C++ code through FFI (Foreign Function Interface).

This can lead to:

  1. Extremely high performance and lower resource consumption.
  2. Easier integration of existing C/C++ assets with the current Dubbo and even web ecosystems.
  3. Low-latency, high-throughput RPC access for resource-sensitive edge devices such as IoT devices and industrial sensors.

[Proposal] integratable with other projects

Dubbo Rust will parse more than one protocol of Dubbo RPC,

  • Triple/gRPC protocol parsing ✅
  • Hessian protocol parsing
  • Thrift protocol parsing
  • etc.

Dubbo Rust could release protocol parsing as a library, and as a component of other project.

Here is ideas:

  1. Be protocol parsing component of Linkerd Proxy
  2. As RPC component of other framework.

新手入门资料

以下是一些新手入门资料,主要分为Dubbo框架(其他语言的设计)和Dubbo Rust的实现

Dubbo多语言资料 - rust.pptx

  1. 熟悉Dubbo框架的整体设计
  2. 熟悉Dubbo Rust的设计:
    • 从demo入门
    • PPT:《dubbo-rust的现在以及未来》,了解dubbo-rust当前的进展以及近期的规划
    • 阅读源码:深入了解,选择自己感兴趣的任务为社区贡献代码

已有的任务:有些任务已经有小伙伴在做,欢迎其他感兴趣的小伙伴参与进来

  • Filter组件:需要扩展多种Filter组件
  • Context:对齐其他语言框架中的Context能力
  • 服务注册以及服务发现模块:
  • 客户端侧Invoker组件:需要对Dubbo框架有些了解
  • 框架的Error优化:对框架内部所有组件的Error要标准化

这些模块目前会有2-3位小伙伴一起再做(用Rust写代码太慢了,只能增加并发度)。

还有其他任务正在逐步细化:这些工作看似简单,实则是组件未来扩展的基础

  • 独立组件的Readme doc
  • 独立组件的test case

如果对其中某个模块或者细节很感兴趣,可以直接联系我。

[Task] The load balance Module

With corresponding to Dubbo-java load balance module, load balance has 5 kinds of load balance algorithms to implement:

  1. Random
  2. RoundRobin
  3. ShortestResponse
  4. LeastActive
  5. ConsistentHash

[Feat] Add the ClusterFilter

Goal

Implement the ClusterFilter.

Description

Currently, the ClusterFilter is implemented as a tower's Layer, which can let us take full advantage of the other middleware provided by tower-http.

TODO: Add the ClusterFilter according to the name.

2022-06-02 社区第二次会议

参会人员:刘军、杨阳、过迷雾、蔡亦文、董宗磊、雷杰

分享人:杨阳

会议结论:

  • 从Client、Server两个角度分别介绍grpc-rust和tonic两个开源库的通信流程
  • 讨论httpbis和hyper两个开源库的区别:决定使用Hyper作为dubbo-rust的底层通信库
  • 大家同时讨论了rust的异步模型,以及对tokio的看法

任务项:

蔡亦文:计划基于Hyper写一个rpc Demo,作为下一次会议的分享议题
杨阳:调研服务注册的实现以及服务元数据;grpc stream与http stream之间的关系,以及如何对流式数据进行编解码

大体目标:针对Hyper以及tokio异步模型进行学习,并了解grpc开源库的实现
tonic
grpc-rust

Add dubbo protocol support

It is less competitive than grpc if dubbo_rust only support triple protocol. Maintain compatibility with dubbo protocol is necessary for some old project.

[Proposal] Let Dubbo Rust could call other RPC services.

At real business logics, there are always different RPC service to call.

For example, 1, to call Dubbo/hessian service to get user info, 2, to call Rest/http (third-party) service to get user associated info, 3, call gRPC service to get AI/ML recommendation result, and combine above information.

Currently, we have to use different client to call different RPC service.

Like FeignClient, Dubbo Rust could let user define different protocol service as uniform interfaces, and use one client(DubboClient.rs) to call. I think we could call this PR as build flat data plane.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.