-
Notifications
You must be signed in to change notification settings - Fork 13
Rust bindings #256
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
Open
Choochmeque
wants to merge
66
commits into
develop
Choose a base branch
from
rust-bindings
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rust bindings #256
Changes from 57 commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
feadf80
Initial commit
Choochmeque d797611
C++ code formatting
Choochmeque ec44a32
Add GitHub Actions workflow for Rust project with checks and tests (e…
Choochmeque daa1adf
Improve error handling in FFI callbacks to suppress panics
Choochmeque 79eec1d
Update README with new FDB API usage examples and correct method calls
Choochmeque 5c27e96
Refactor axes() to use dynamic mapping instead of hardcoded axis names
Choochmeque 014c3de
Add safety comments for thread-safety of various iterators in FDB
Choochmeque 6888dec
Add integration tests for FDB methods: archive_raw, read_uri, read_ur…
Choochmeque 5d43c67
Fix CMake patching error handling and improve seek position calculations
Choochmeque 0886506
Refactor FDB configuration accessors to return Option types for missi…
Choochmeque 5f5b02b
Add concurrent archive and mixed read/write tests for FDB operations
Choochmeque 4320482
Improve exception handling messages in fdb_bridge
Choochmeque 0a4d9b0
Update rust CI workflow
Choochmeque b9e0404
Refactor FdbHandle to use direct FDB instance instead of unique_ptr
Choochmeque df834bc
Remove unnecessary drop statements from FDB test cases
Choochmeque af8d471
Add support for user configuration in FdbHandle initialization and API
Choochmeque ae1d491
Update iterator methods to return Result<bool> for hasNext checks
Choochmeque baa976d
Add Cargo configuration and improve control identifier handling in FDB
Choochmeque cbcc8b7
Update GRIB support and improve URI handling in FDB integration tests
Choochmeque 990cb6e
Remove AxesIteratorHandle and related axes iterator functionality
Choochmeque 0fe11aa
Update log message for empty axes case to clarify request context
Choochmeque 7d2bcc3
Remove debug print statement for FDB name in example code
Choochmeque 3a7672b
Update fdb_list example to format output as key-value pairs in braces
Choochmeque 47ddce5
Remove FDB configuration methods and related data structures to simpl…
Choochmeque f03a576
Update documentation for HandleInner to clarify FDB instance usage
Choochmeque 826f9e1
Update README to correct FDB name and improve description clarity
Choochmeque 57ef2ed
Update README files to clarify feature flags and build strategies for…
Choochmeque 117cf99
Update README and examples to clarify key requirements for FDB usage
Choochmeque a53a1c2
Add `memfs` feature to bake eccodes tables into libeccodes for easier…
Choochmeque 1b1c6b5
Refactor version retrieval to use module-level functions instead of m…
Choochmeque cbddb3b
Replace std::runtime_error with eckit exceptions in DataReader and it…
Choochmeque 76a9c50
Refactor Key struct to use fdb_sys::KeyData
Choochmeque 3582a80
Add function to determine CMake build type based on Cargo profile set…
Choochmeque 9d2cf2d
Update MARS request parsing to use metkit's parser and expansion logic
Choochmeque a096b5d
Add path-based constructors to FdbHandle for loading configurations d…
Choochmeque d1311fc
Add clap dependency and implement CLI for fdb_list example tool
Choochmeque 08f099d
Refactor FDB handle creation to use `Fdb::open` instead of `Fdb::new`
Choochmeque 6a9dffc
Add ListOptions struct for improved parameter handling in Fdb methods
Choochmeque 9170f39
Add streaming support for archiving GRIB data from Rust `Read` sources
Choochmeque 2d12394
Add examples for `fdb_read` and `fdb_write` tools with CLI usage inst…
Choochmeque 55b958e
Add detailed index and database statistics reporting in FDB bridge
Choochmeque 027ca66
Refactor DataReaderHandle to eckit::DataHandle shim functions
Choochmeque ae445d4
Add integration test for FDB axes to validate expected values returned
Choochmeque fd9b094
Add bindman-utils dependency and refactor build scripts
Choochmeque 39232f3
Add fdb-hammer tool for benchmarking and stress testing FDB performance
Choochmeque 5f86390
Add integration testing workflow for rust-bindings branch in CI
Choochmeque bfa19e7
Add compact listing functionality to ListIterator for MARS-request ag…
Choochmeque 0834d5c
Remove MoveIterator and related move_data functionality from FDB API
Choochmeque bd495fd
Enhance rpath handling in fdb build scripts
Choochmeque 1ca42b3
Update README.md to clarify binary execution without environment vari…
Choochmeque 40de393
Update fdb_axes example to use structured argument parsing with clap
Choochmeque 5984a13
Remove unnecessary FDB handle creation logs from examples
Choochmeque 3705937
Add IndexMap dependency and update Request struct for key-value manag…
Choochmeque c20c3ec
Remove unnecessary FDB_DIR parameter from cmake_find_package call
Choochmeque 4001f5d
Remove branch specification for bindman-utils in Cargo.toml
Choochmeque 17e0fc1
Remove unnecessary integration test steps and update test commands
Choochmeque 902007f
Add mutex lock to serialize GRIB ingest across Fdb instances to preve…
Choochmeque b9ee763
Remove obsolete file
Choochmeque 61edadd
Remove unused `request_from_key` function and simplify request creation
Choochmeque 62b7374
Update integration test to archive multiple steps for accurate axis q…
Choochmeque 865da32
Fix flush call by removing unnecessary assignment in fdb_archive.rs
Choochmeque c4f67ac
Refactor FdbHandle methods to be member functions
Choochmeque cac535b
Remove debug print statements from fdb_archive_simple test for clarity
Choochmeque 6ee4c19
Update README.md to clarify RPATH handling and build options for FDB
Choochmeque 5e46a05
Refactor FDB tests to use temporary directories for configuration setup
Choochmeque 0b00598
Remove outdated test for concurrent error handling in FDB threads
Choochmeque File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| [build] | ||
| jobs = -1 | ||
|
|
||
| [target.'cfg(all())'] | ||
| rustflags = [ | ||
| "-Wclippy::all", | ||
| "-Wclippy::pedantic", | ||
| "-Wclippy::nursery", | ||
| "-Wclippy::unwrap_used", | ||
| "-Aclippy::module_name_repetitions", | ||
| "-Aclippy::missing_errors_doc", | ||
| ] | ||
|
|
||
| [net] | ||
| git-fetch-with-cli = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: rust | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'master' | ||
| - 'develop' | ||
| - 'rust-bindings' | ||
| tags-ignore: | ||
| - '**' | ||
| paths: | ||
| - 'rust/**' | ||
| - '.github/workflows/ci-rust.yml' | ||
|
|
||
| pull_request: | ||
| paths: | ||
| - 'rust/**' | ||
| - '.github/workflows/ci-rust.yml' | ||
|
|
||
| workflow_dispatch: ~ | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| CARGO_NET_GIT_FETCH_WITH_CLI: "true" | ||
|
|
||
| jobs: | ||
| fmt: | ||
| name: fmt | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: rust | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: rustfmt | ||
|
|
||
| - name: Format check | ||
| run: cargo fmt --check | ||
|
|
||
| clippy: | ||
| name: clippy | ||
| if: ${{ !github.event.pull_request.head.repo.fork }} | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: rust | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Configure git for private repos | ||
| run: git config --global url."https://x-access-token:${{ secrets.GH_REPO_READ_TOKEN }}@github.com/".insteadOf "ssh://git@github.com/" | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy | ||
|
|
||
| - name: Clippy | ||
| run: cargo clippy --features vendored --all-targets -- -D warnings | ||
|
|
||
| test: | ||
| name: test | ||
| if: ${{ !github.event.pull_request.head.repo.fork }} | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: rust | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Configure git for private repos | ||
| run: git config --global url."https://x-access-token:${{ secrets.GH_REPO_READ_TOKEN }}@github.com/".insteadOf "ssh://git@github.com/" | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Test | ||
| run: cargo test --features vendored |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,3 +16,7 @@ compile_commands.json | |
| __pycache__/ | ||
|
|
||
| *.swp | ||
|
|
||
| # Rust | ||
| rust/target/ | ||
| rust/Cargo.lock | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| [workspace] | ||
| resolver = "2" | ||
| members = ["crates/fdb-sys", "crates/fdb", "tools/fdb-hammer"] | ||
|
|
||
| [workspace.package] | ||
| edition = "2024" | ||
| license = "Apache-2.0" | ||
| repository = "https://github.com/ecmwf/fdb" | ||
| rust-version = "1.90" | ||
| readme = "README.md" | ||
| keywords = ["ecmwf", "weather", "meteorology", "grib", "climate"] | ||
| categories = ["science", "database"] | ||
|
|
||
| [workspace.dependencies] | ||
| # Internal | ||
| fdb-sys = { path = "crates/fdb-sys" } | ||
| fdb = { path = "crates/fdb" } | ||
|
|
||
| # Foundation crates | ||
| eckit-sys = { git = "ssh://git@github.com/ecmwf/rust-wrappers-playground.git", default-features = false } | ||
| metkit-sys = { git = "ssh://git@github.com/ecmwf/rust-wrappers-playground.git", default-features = false } | ||
| eccodes-sys = { git = "ssh://git@github.com/ecmwf/rust-wrappers-playground.git", default-features = false } | ||
|
|
||
| # Build tools | ||
| bindman = { git = "ssh://git@github.com/ecmwf/bindman.git" } | ||
| bindman-build = { git = "ssh://git@github.com/ecmwf/bindman.git" } | ||
| bindman-utils = { git = "ssh://git@github.com/ecmwf/bindman.git" } | ||
|
|
||
| # External | ||
| thiserror = "2" | ||
| cxx = "1.0" | ||
| cxx-build = "1.0" | ||
| parking_lot = "0.12" | ||
| tempfile = "3" | ||
| indexmap = "2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| [package] | ||
| name = "fdb-sys" | ||
| version = "5.19.1" | ||
| edition.workspace = true | ||
| license.workspace = true | ||
| repository.workspace = true | ||
| rust-version.workspace = true | ||
| readme.workspace = true | ||
| keywords.workspace = true | ||
| categories.workspace = true | ||
| description = "C++ bindings to ECMWF FDB5 library using cxx" | ||
| links = "fdb_sys" | ||
| build = "build.rs" | ||
|
|
||
| [features] | ||
| # Defaults match CMake defaults (without external library dependencies), | ||
| # plus `memfs` so the eccodes definition tables are baked into libeccodes | ||
| # and end users don't have to ship an `eccodes_resources/` directory. | ||
| default = ["grib", "tocfdb", "fdb-remote", "memfs"] | ||
|
|
||
| # Build strategy (mutually exclusive) | ||
| vendored = ["eckit-sys/vendored", "metkit-sys/vendored", "eccodes-sys/vendored"] | ||
| system = ["eckit-sys/system", "metkit-sys/system", "eccodes-sys/system"] | ||
|
|
||
| # Core features (CMake default: ON) | ||
| # GRIB support requires both eccodes-sys/product-grib (the eccodes library | ||
| # itself) AND metkit-sys/grib (so metkit's grib message splitter is built and | ||
| # its static initializers register with eckit::message::Splitter). | ||
| grib = ["eccodes-sys/product-grib", "metkit-sys/grib"] | ||
| tocfdb = [] # Filesystem TOC support for FDB | ||
| fdb-remote = [] # FDB remote access | ||
|
|
||
| # Bake the eccodes definition/sample tables directly into the eccodes shared | ||
| # library (CMake `ENABLE_MEMFS=ON`). With this on, runtime needs no | ||
| # `eccodes_resources/` directory next to the binary. Build-time requirement: | ||
| # Python 3 must be available, since the upstream CMake step uses a Python | ||
| # script to embed the resource files. | ||
| memfs = ["eccodes-sys/memfs"] | ||
|
|
||
| # Storage backends (CMake default: OFF or require external libs) | ||
| radosfdb = [] # Ceph/Rados support for FDB Store (requires RADOS) | ||
| lustre = [] # Lustre API control of file stripping (requires LUSTREAPI) | ||
| daosfdb = [] # DAOS support for FDB Store (requires DAOS) | ||
| daos-admin = [] # DAOS pool management (requires DAOS) | ||
| dummy-daos = [] # Dummy DAOS library (emulates DAOS with filesystem) | ||
|
|
||
| # Other (CMake default: OFF) | ||
| experimental = [] # Experimental features | ||
| sandbox = [] # Sandbox stuff | ||
|
|
||
| [dependencies] | ||
| cxx.workspace = true | ||
| eckit-sys.workspace = true | ||
| metkit-sys.workspace = true | ||
| eccodes-sys.workspace = true | ||
| bindman.workspace = true | ||
|
|
||
| [build-dependencies] | ||
| cxx-build.workspace = true | ||
| bindman-build.workspace = true | ||
| bindman-utils.workspace = true | ||
| fs_extra = "1.3" | ||
|
|
||
| [package.metadata.docs.rs] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # fdb-sys | ||
|
|
||
| Low-level Rust bindings to ECMWF's [FDB](https://github.com/ecmwf/fdb) (Fields DataBase) C++ library. | ||
|
|
||
| This crate provides raw FFI bindings using [cxx](https://cxx.rs/). For a safe, ergonomic API, use the [`fdb`](https://crates.io/crates/fdb) crate instead. | ||
|
|
||
| ## Features | ||
|
|
||
| ### Build strategy (mutually exclusive) | ||
|
|
||
| - `vendored` - Build the FDB and its dependencies (eckit, metkit, ecCodes) from source. | ||
| - `system` - Link against system-installed FDB. | ||
|
|
||
| Note: neither is enabled by default on `fdb-sys` itself. End users should | ||
| depend on the higher-level [`fdb`](https://crates.io/crates/fdb) crate, which | ||
| defaults to `vendored`. If you depend on `fdb-sys` directly you must select | ||
| one explicitly. | ||
|
|
||
| ### Core (enabled by default) | ||
|
|
||
| - `grib` - GRIB format support. Pulls in `eccodes-sys/product-grib` and | ||
| `metkit-sys/grib` so the GRIB message splitter is registered with | ||
| `eckit::message::Splitter`. | ||
| - `tocfdb` - Filesystem TOC backend (the standard local FDB store). | ||
| - `fdb-remote` - Client support for remote FDB servers. | ||
| - `memfs` - Bake the eccodes definition/sample tables into `libeccodes` | ||
| itself (`ENABLE_MEMFS=ON`). With this on, end users do **not** have to | ||
| ship an `eccodes_resources/` directory next to their binary. Build-time | ||
| requirement: Python 3 must be on `PATH` (the upstream CMake step uses a | ||
| Python helper to embed the resource files). | ||
|
|
||
| ### Storage backends (off by default; require external libraries) | ||
|
|
||
| - `radosfdb` - Ceph/RADOS object store backend (requires RADOS). | ||
| - `lustre` - Lustre file striping control (requires LUSTREAPI). | ||
| - `daosfdb` - DAOS object store backend (requires DAOS). | ||
| - `daos-admin` - DAOS pool management (requires DAOS). | ||
| - `dummy-daos` - Filesystem-emulated DAOS (no DAOS install needed). | ||
|
|
||
| ### Other (off by default) | ||
|
|
||
| - `experimental` - Experimental upstream features. | ||
| - `sandbox` - Sandbox builds. | ||
|
|
||
| ## License | ||
|
|
||
| Apache-2.0 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.