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