Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add madsim support for opendal? #122

Open
Xuanwo opened this issue Feb 14, 2023 · 3 comments
Open

How to add madsim support for opendal? #122

Xuanwo opened this issue Feb 14, 2023 · 3 comments

Comments

@Xuanwo
Copy link

Xuanwo commented Feb 14, 2023

Hello, I am the maintainer of OpenDAL. This project is interesting and I would like to extend it with OpenDAL madsim support. Is there any way to do this without copying all opendal code to this repo?

@wangrunji0408
Copy link
Member

Hi! Thank you for your interest in this project. 😄

To build a simulator of your service on madsim, you don't need to copy all existing code. Instead, you will be going to create a mock of all public APIs on top of the madsim infra. Take OpenDAL as an example. I just had a quick look of the opendal docs. It says that it is an abstraction layer over all storage services. So you only need to build a simulator that matchs the semantic of the abstraction layer (Operator and Object), and don't have to build for each service implementations. The simulator will consist of a client side and a server side. The server should emulate your service in a single-thread manner (etcd example), and it should be exposed using madsim's network API (etcd example), so that we can access it later from the client side (etcd example). All of them could be put in your crate with the #[cfg(madsim)] condition, so that when the cfg is not enabled, this crate still behaves the same as original.

For more details, you can refer to our simulation code of etcd-client, rdkafka, and aws-sdk-s3. You are also welcome to direct message me later. Looking forward to seeing madsim-opendal soon. 😜

@Xuanwo
Copy link
Author

Xuanwo commented Apr 10, 2023

This issue, along with apache/opendal#1871, provides a great example of how open source works.

  • madsim builds a deterministic simulator for distributed systems
  • opendal will add madsim support so that all applications based on opendal can benefit from the deterministic simulator for storage.
  • Existing application already uses madsim and opendal can extend their simulator to all storage without mocking all SDKs

Win, win, win!

@Xuanwo
Copy link
Author

Xuanwo commented Apr 15, 2023

This task has been started in apache/opendal#2006

@Xuanwo Xuanwo changed the title How to add madsim support for 3rd packages? How to add madsim support for opendal? Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants