Skip to content
Open
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
feadf80
Initial commit
Choochmeque Mar 25, 2026
d797611
C++ code formatting
Choochmeque Mar 25, 2026
ec44a32
Add GitHub Actions workflow for Rust project with checks and tests (e…
Choochmeque Mar 25, 2026
daa1adf
Improve error handling in FFI callbacks to suppress panics
Choochmeque Apr 2, 2026
79eec1d
Update README with new FDB API usage examples and correct method calls
Choochmeque Apr 2, 2026
5c27e96
Refactor axes() to use dynamic mapping instead of hardcoded axis names
Choochmeque Apr 2, 2026
014c3de
Add safety comments for thread-safety of various iterators in FDB
Choochmeque Apr 2, 2026
6888dec
Add integration tests for FDB methods: archive_raw, read_uri, read_ur…
Choochmeque Apr 2, 2026
5d43c67
Fix CMake patching error handling and improve seek position calculations
Choochmeque Apr 2, 2026
0886506
Refactor FDB configuration accessors to return Option types for missi…
Choochmeque Apr 2, 2026
5f5b02b
Add concurrent archive and mixed read/write tests for FDB operations
Choochmeque Apr 2, 2026
4320482
Improve exception handling messages in fdb_bridge
Choochmeque Apr 2, 2026
0a4d9b0
Update rust CI workflow
Choochmeque Apr 7, 2026
b9e0404
Refactor FdbHandle to use direct FDB instance instead of unique_ptr
Choochmeque Apr 8, 2026
df834bc
Remove unnecessary drop statements from FDB test cases
Choochmeque Apr 8, 2026
af8d471
Add support for user configuration in FdbHandle initialization and API
Choochmeque Apr 8, 2026
ae1d491
Update iterator methods to return Result<bool> for hasNext checks
Choochmeque Apr 8, 2026
baa976d
Add Cargo configuration and improve control identifier handling in FDB
Choochmeque Apr 8, 2026
cbcc8b7
Update GRIB support and improve URI handling in FDB integration tests
Choochmeque Apr 8, 2026
990cb6e
Remove AxesIteratorHandle and related axes iterator functionality
Choochmeque Apr 8, 2026
0fe11aa
Update log message for empty axes case to clarify request context
Choochmeque Apr 8, 2026
7d2bcc3
Remove debug print statement for FDB name in example code
Choochmeque Apr 8, 2026
3a7672b
Update fdb_list example to format output as key-value pairs in braces
Choochmeque Apr 8, 2026
47ddce5
Remove FDB configuration methods and related data structures to simpl…
Choochmeque Apr 9, 2026
f03a576
Update documentation for HandleInner to clarify FDB instance usage
Choochmeque Apr 9, 2026
826f9e1
Update README to correct FDB name and improve description clarity
Choochmeque Apr 9, 2026
57ef2ed
Update README files to clarify feature flags and build strategies for…
Choochmeque Apr 9, 2026
117cf99
Update README and examples to clarify key requirements for FDB usage
Choochmeque Apr 9, 2026
a53a1c2
Add `memfs` feature to bake eccodes tables into libeccodes for easier…
Choochmeque Apr 9, 2026
1b1c6b5
Refactor version retrieval to use module-level functions instead of m…
Choochmeque Apr 9, 2026
cbddb3b
Replace std::runtime_error with eckit exceptions in DataReader and it…
Choochmeque Apr 9, 2026
76a9c50
Refactor Key struct to use fdb_sys::KeyData
Choochmeque Apr 9, 2026
3582a80
Add function to determine CMake build type based on Cargo profile set…
Choochmeque Apr 9, 2026
9d2cf2d
Update MARS request parsing to use metkit's parser and expansion logic
Choochmeque Apr 9, 2026
a096b5d
Add path-based constructors to FdbHandle for loading configurations d…
Choochmeque Apr 9, 2026
d1311fc
Add clap dependency and implement CLI for fdb_list example tool
Choochmeque Apr 9, 2026
08f099d
Refactor FDB handle creation to use `Fdb::open` instead of `Fdb::new`
Choochmeque Apr 9, 2026
6a9dffc
Add ListOptions struct for improved parameter handling in Fdb methods
Choochmeque Apr 9, 2026
9170f39
Add streaming support for archiving GRIB data from Rust `Read` sources
Choochmeque Apr 9, 2026
2d12394
Add examples for `fdb_read` and `fdb_write` tools with CLI usage inst…
Choochmeque Apr 9, 2026
55b958e
Add detailed index and database statistics reporting in FDB bridge
Choochmeque Apr 9, 2026
027ca66
Refactor DataReaderHandle to eckit::DataHandle shim functions
Choochmeque Apr 9, 2026
ae445d4
Add integration test for FDB axes to validate expected values returned
Choochmeque Apr 9, 2026
fd9b094
Add bindman-utils dependency and refactor build scripts
Choochmeque Apr 11, 2026
39232f3
Add fdb-hammer tool for benchmarking and stress testing FDB performance
Choochmeque Apr 13, 2026
5f86390
Add integration testing workflow for rust-bindings branch in CI
Choochmeque Apr 13, 2026
bfa19e7
Add compact listing functionality to ListIterator for MARS-request ag…
Choochmeque Apr 15, 2026
0834d5c
Remove MoveIterator and related move_data functionality from FDB API
Choochmeque Apr 15, 2026
bd495fd
Enhance rpath handling in fdb build scripts
Choochmeque Apr 15, 2026
1ca42b3
Update README.md to clarify binary execution without environment vari…
Choochmeque Apr 15, 2026
40de393
Update fdb_axes example to use structured argument parsing with clap
Choochmeque Apr 15, 2026
5984a13
Remove unnecessary FDB handle creation logs from examples
Choochmeque Apr 15, 2026
3705937
Add IndexMap dependency and update Request struct for key-value manag…
Choochmeque Apr 16, 2026
c20c3ec
Remove unnecessary FDB_DIR parameter from cmake_find_package call
Choochmeque Apr 16, 2026
4001f5d
Remove branch specification for bindman-utils in Cargo.toml
Choochmeque Apr 16, 2026
17e0fc1
Remove unnecessary integration test steps and update test commands
Choochmeque Apr 16, 2026
902007f
Add mutex lock to serialize GRIB ingest across Fdb instances to preve…
Choochmeque Apr 16, 2026
b9ee763
Remove obsolete file
Choochmeque Apr 24, 2026
61edadd
Remove unused `request_from_key` function and simplify request creation
Choochmeque Apr 24, 2026
62b7374
Update integration test to archive multiple steps for accurate axis q…
Choochmeque Apr 24, 2026
865da32
Fix flush call by removing unnecessary assignment in fdb_archive.rs
Choochmeque Apr 24, 2026
c4f67ac
Refactor FdbHandle methods to be member functions
Choochmeque Apr 24, 2026
cac535b
Remove debug print statements from fdb_archive_simple test for clarity
Choochmeque Apr 24, 2026
6ee4c19
Update README.md to clarify RPATH handling and build options for FDB
Choochmeque Apr 24, 2026
5e46a05
Refactor FDB tests to use temporary directories for configuration setup
Choochmeque Apr 24, 2026
0b00598
Remove outdated test for concurrent error handling in FDB threads
Choochmeque Apr 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .cargo/config.toml
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
79 changes: 79 additions & 0 deletions .github/workflows/ci-rust.yml
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ compile_commands.json
__pycache__/

*.swp

# Rust
rust/target/
rust/Cargo.lock
35 changes: 35 additions & 0 deletions rust/Cargo.toml
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"
64 changes: 64 additions & 0 deletions rust/crates/fdb-sys/Cargo.toml
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)
Comment thread
simondsmart marked this conversation as resolved.
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]
47 changes: 47 additions & 0 deletions rust/crates/fdb-sys/README.md
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
Loading
Loading