-
Notifications
You must be signed in to change notification settings - Fork 15
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
67
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 all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
1e6f997
Initial commit
Choochmeque 50b2f70
C++ code formatting
Choochmeque 5401e19
Add GitHub Actions workflow for Rust project with checks and tests (e…
Choochmeque ebce4a4
Improve error handling in FFI callbacks to suppress panics
Choochmeque 4eec8a1
Update README with new FDB API usage examples and correct method calls
Choochmeque ea5cdfd
Refactor axes() to use dynamic mapping instead of hardcoded axis names
Choochmeque 2cc586c
Add safety comments for thread-safety of various iterators in FDB
Choochmeque b4d7dab
Add integration tests for FDB methods: archive_raw, read_uri, read_ur…
Choochmeque 1b5a9c4
Fix CMake patching error handling and improve seek position calculations
Choochmeque 126e010
Refactor FDB configuration accessors to return Option types for missi…
Choochmeque a28a596
Add concurrent archive and mixed read/write tests for FDB operations
Choochmeque ab2114c
Improve exception handling messages in fdb_bridge
Choochmeque dbf112e
Update rust CI workflow
Choochmeque 8b06ea1
Refactor FdbHandle to use direct FDB instance instead of unique_ptr
Choochmeque 44a6244
Remove unnecessary drop statements from FDB test cases
Choochmeque 709678f
Add support for user configuration in FdbHandle initialization and API
Choochmeque 74dd1e4
Update iterator methods to return Result<bool> for hasNext checks
Choochmeque 73e8f25
Add Cargo configuration and improve control identifier handling in FDB
Choochmeque 0baf458
Update GRIB support and improve URI handling in FDB integration tests
Choochmeque 8876205
Remove AxesIteratorHandle and related axes iterator functionality
Choochmeque ee6352d
Update log message for empty axes case to clarify request context
Choochmeque d70c86b
Remove debug print statement for FDB name in example code
Choochmeque ff77d00
Update fdb_list example to format output as key-value pairs in braces
Choochmeque 5d9b991
Remove FDB configuration methods and related data structures to simpl…
Choochmeque 135b6b1
Update documentation for HandleInner to clarify FDB instance usage
Choochmeque 0116f48
Update README to correct FDB name and improve description clarity
Choochmeque c2455aa
Update README files to clarify feature flags and build strategies for…
Choochmeque 473fa9a
Update README and examples to clarify key requirements for FDB usage
Choochmeque 11a40dc
Add `memfs` feature to bake eccodes tables into libeccodes for easier…
Choochmeque c794dd0
Refactor version retrieval to use module-level functions instead of m…
Choochmeque fb13e60
Replace std::runtime_error with eckit exceptions in DataReader and it…
Choochmeque a981760
Refactor Key struct to use fdb_sys::KeyData
Choochmeque f0722b8
Add function to determine CMake build type based on Cargo profile set…
Choochmeque d87d7b6
Update MARS request parsing to use metkit's parser and expansion logic
Choochmeque a1c9ecc
Add path-based constructors to FdbHandle for loading configurations d…
Choochmeque 15625db
Add clap dependency and implement CLI for fdb_list example tool
Choochmeque 4234491
Refactor FDB handle creation to use `Fdb::open` instead of `Fdb::new`
Choochmeque 4945eb4
Add ListOptions struct for improved parameter handling in Fdb methods
Choochmeque d88b744
Add streaming support for archiving GRIB data from Rust `Read` sources
Choochmeque 9160e4e
Add examples for `fdb_read` and `fdb_write` tools with CLI usage inst…
Choochmeque b3a1e25
Add detailed index and database statistics reporting in FDB bridge
Choochmeque 6d6de54
Refactor DataReaderHandle to eckit::DataHandle shim functions
Choochmeque 21fcee8
Add integration test for FDB axes to validate expected values returned
Choochmeque fad02f4
Add bindman-utils dependency and refactor build scripts
Choochmeque 243bdf5
Add fdb-hammer tool for benchmarking and stress testing FDB performance
Choochmeque 7f4e0f3
Add integration testing workflow for rust-bindings branch in CI
Choochmeque 26bea7d
Add compact listing functionality to ListIterator for MARS-request ag…
Choochmeque b8f3032
Remove MoveIterator and related move_data functionality from FDB API
Choochmeque 7a6b0ca
Enhance rpath handling in fdb build scripts
Choochmeque 947163f
Update README.md to clarify binary execution without environment vari…
Choochmeque 79131b2
Update fdb_axes example to use structured argument parsing with clap
Choochmeque 259c4a6
Remove unnecessary FDB handle creation logs from examples
Choochmeque bd65cee
Add IndexMap dependency and update Request struct for key-value manag…
Choochmeque 75a231a
Remove unnecessary FDB_DIR parameter from cmake_find_package call
Choochmeque b3cd524
Remove branch specification for bindman-utils in Cargo.toml
Choochmeque e4abea4
Remove unnecessary integration test steps and update test commands
Choochmeque e2d8e5f
Add mutex lock to serialize GRIB ingest across Fdb instances to preve…
Choochmeque f50f673
Remove obsolete file
Choochmeque 28055da
Remove unused `request_from_key` function and simplify request creation
Choochmeque a907698
Update integration test to archive multiple steps for accurate axis q…
Choochmeque aa77036
Fix flush call by removing unnecessary assignment in fdb_archive.rs
Choochmeque 02d7bbd
Refactor FdbHandle methods to be member functions
Choochmeque 8cd3241
Remove debug print statements from fdb_archive_simple test for clarity
Choochmeque 68742ea
Update README.md to clarify RPATH handling and build options for FDB
Choochmeque 537f096
Refactor FDB tests to use temporary directories for configuration setup
Choochmeque 61bf425
Remove outdated test for concurrent error handling in FDB threads
Choochmeque 8bd2e66
Update FDB version to 5.19.1 in build configuration for compatibility
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.