new feature: Support creating and registering custom services via FFI

Aperta
#7,194 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
32/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
c, python, rust

Direzione di ricerca

Inizia con i binding C esistenti, inclusi opendal_bytes, opendal_error, opendal_metadata e gli entry point opendal_operator_*, quindi confrontali con il pattern Access in core/services/huggingface e con l’API generica di registrazione di OperatorRegistry. Il lavoro sarà considerato completato quando un servizio compilato separatamente potrà registrarsi attraverso il confine FFI ed essere wrappato come un normale Operator con i layer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement releases-note/feat
Feature Description

Enable third-party applications to register custom OpenDAL services (implementations of Access) across FFI boundaries, so that external Rust crates compiled as separate shared libraries can provide new storage backends without compile-time coupling.

Desired outcome

An extension author can:

  1. Implement an OpenDAL service in Rust (following the standard Access pattern, like https://github.com/apache/opendal/tree/main/core/services/huggingface)
  2. Compile it as a standalone shared library (no compile-time dependency on the host application)
  3. Register it with the host application at runtime via some ABI-stable mechanism
  4. The host application wraps it as a normal Operator with its own layers (retry, metrics, etc.)

The existing C-ABI types (opendal_bytes, opendal_error, opendal_metadata, etc.) seem like natural building blocks for this.

Problem and Solution

We're integrating OpenDAL into https://github.com/Eventual-Inc/Daft (a distributed dataframe engine) to support pluggable storage backends. Our users want to implement custom protocols (e.g. my-proprietary-protocol://) by writing an OpenDAL service in Rust, packaging it as a Python wheel (cdylib via PyO3/maturin), and registering it at runtime.

The challenge is that Daft and the extension are separate shared libraries loaded into the same Python process. They each statically link their own copy of OpenDAL, so Rust types can't be safely shared across the dylib boundary.

Current state:

OpenDAL's C bindings let you consume services (call opendal_operator_read, etc.), but there's no way to implement a service from the other side of an FFI boundary. The OperatorRegistry requires compile-time generics (register<B: Builder>), so you can't register a service from a separately compiled shared library.

Additional Context

Use cases

  • Daft — pluggable storage protocols for a dataframe engine (the motivating use case)
  • Any application embedding OpenDAL that wants to allow third-party storage plugins without recompilation
  • Cross-language service implementations — implement an OpenDAL service in Go, Python (via cffi), etc.
Are you willing to contribute to the development of this feature?
  • Yes, I am willing to contribute to the development of this feature.
Lingua principale
Rust
Stelle
5.5k
Fork
869
Merge medio
8h 2m
PR unite (30g)
862

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/opendal

Tutte le issue di apache/opendal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.