Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,13 @@ jobs:
run: |
.venv/bin/maturin develop --features rocksdb

# The tests ask the build which index backends it has, so no environment
# variable is needed — and cannot drift from what was actually compiled.
- name: RocksDB-backed index store tests
# Durable reactions need a persistent index, so the hermetic suite runs
# here as well as in the default build. The tests ask the build which
# index backends it has, so no environment variable is needed.
- name: Hermetic tests with RocksDB enabled
run: |
.venv/bin/python -c "import drasi; assert 'rocksdb' in drasi.host_info()['index_backends']"
.venv/bin/pytest tests/e2e/test_stores.py -v
.venv/bin/pytest -m "not plugins and not oci and not docker" -v

coverage:
name: Conversion and error coverage
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,35 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht

## [Unreleased]

### Changed

- Built against drasi-lib 0.9.3, drasi-core 0.5.10, drasi-host-sdk 0.11.3 and
drasi-plugin-sdk 0.11.3 (previously 0.8.9, 0.5.7, 0.10.0 and 0.10.0). The
store crates moved with them: drasi-state-store-redb 0.2.8 and
drasi-index-rocksdb 0.6.4. Published plugins must match on `major.minor`;
the current `ghcr.io/drasi-project` releases do. `host_info()` now reports
FFI ABI 0.14.0.

- Reactions registered before `start()` now start after their queries. drasi-lib
0.9 will not subscribe to a query that is still stopped, and the query
auto-start workaround was starting reactions first.

- A durable reaction now requires a persistent index store as well as a state
store. drasi-lib 0.9 rejects a durable subscription to an in-memory query,
because the outbox the checkpoint points at would not survive a restart.
Pass `index_store={"kind": "rocksdb", "path": ...}` to `Drasi.create`.
Missing it raises `DURABLE_REQUIRES_INDEX_STORE`.

- A failing reaction callback follows the recovery policy. `strict` and
`auto_reset` stop the reaction and leave the checkpoint where it was, so the
event is replayed the next time the reaction starts. `skip_gap` records the
event as handled and continues. Previously the loop logged the failure and
carried on without advancing the checkpoint.

- Plugin reactions report their own recovery policy and bootstrap
implementation. The wrapper had been answering with the trait defaults, so a
plugin's policy never reached startup recovery.

### Documentation

- How to declare a synthetic join. The concepts page said a query can span
Expand Down
76 changes: 30 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pyo3-async-runtimes = { version = "0.29", features = ["tokio-runtime"] }
# ghcr.io/drasi-project are annotated with the drasi-core / drasi-lib /
# drasi-plugin-sdk versions they were built against, and the host rejects any
# plugin whose versions do not match ours on major.minor. See docs/plugins.md.
drasi-lib = { version = "=0.8.9", features = [
drasi-lib = { version = "=0.9.3", features = [
# Query middleware. `jq` is deliberately excluded: it pulls in `jq-rs`,
# which links against libjq, and a C dependency would put the
# cross-compiled aarch64 and Windows wheels at risk. The rest have no
Expand All @@ -37,11 +37,11 @@ drasi-lib = { version = "=0.8.9", features = [
"middleware-relabel",
"middleware-unwind",
] }
drasi-core = "=0.5.7"
drasi-host-sdk = { version = "=0.10.0", features = ["watcher", "registry"] }
drasi-plugin-sdk = "=0.10.0"
drasi-state-store-redb = "=0.2.4"
drasi-index-rocksdb = { version = "=0.5.8", optional = true, features = ["plugin-descriptor"] }
drasi-core = "=0.5.10"
drasi-host-sdk = { version = "=0.11.3", features = ["watcher", "registry"] }
drasi-plugin-sdk = "=0.11.3"
drasi-state-store-redb = "=0.2.8"
drasi-index-rocksdb = { version = "=0.6.4", optional = true, features = ["plugin-descriptor"] }

anyhow = "1"
async-trait = "0.1"
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ A durable reaction only advances its checkpoint once your callback succeeds, so
an unhandled event is replayed after a restart:

```python
drasi = await Drasi.create("app", state_store={"kind": "redb", "path": "state.redb"})
drasi = await Drasi.create(
"app",
state_store={"kind": "redb", "path": "state.redb"},
index_store={"kind": "rocksdb", "path": "index"},
)


async def handle(event):
Expand Down
14 changes: 7 additions & 7 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Plugins are published as OCI artifacts to `ghcr.io/drasi-project`:
```
ghcr.io/drasi-project/{type}/{kind}:{version}-{arch}

ghcr.io/drasi-project/source/postgres:0.1.13-linux-amd64
ghcr.io/drasi-project/source/mock:0.2.7-darwin-arm64
ghcr.io/drasi-project/reaction/log:0.2.5-linux-arm64
ghcr.io/drasi-project/source/postgres:0.2.12-linux-amd64
ghcr.io/drasi-project/source/mock:0.2.12-darwin-arm64
ghcr.io/drasi-project/reaction/log:0.2.9-linux-arm64
```

Short references are expanded against the default registry, so `source/postgres`
Expand Down Expand Up @@ -49,10 +49,10 @@ Inspect what this host offers:
>>> import drasi
>>> drasi.host_info()
{'arch_suffix': 'darwin-arm64',
'core_version': '0.5.7',
'ffi_sdk_version': '0.11.0',
'lib_version': '0.8.9',
'sdk_version': '0.10.0',
'core_version': '0.5.10',
'ffi_sdk_version': '0.14.0',
'lib_version': '0.9.3',
'sdk_version': '0.11.3',
'target_triple': 'aarch64-apple-darwin'}
```

Expand Down
12 changes: 6 additions & 6 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Check it worked:
```

```
{'arch_suffix': 'darwin-arm64', 'core_version': '0.5.7',
'ffi_sdk_version': '0.11.0', 'lib_version': '0.8.9',
'sdk_version': '0.10.0', 'target_triple': 'aarch64-apple-darwin'}
{'arch_suffix': 'darwin-arm64', 'core_version': '0.5.10',
'ffi_sdk_version': '0.14.0', 'lib_version': '0.9.3',
'sdk_version': '0.11.3', 'target_triple': 'aarch64-apple-darwin'}
```

(Your `target_triple` and `arch_suffix` will reflect your own machine.)
Expand Down Expand Up @@ -146,13 +146,13 @@ matches your machine, so you never deal with architecture tags.

```
host: aarch64-apple-darwin
drasi-core 0.5.7, drasi-lib 0.8.9
plugin sdk 0.10.0, ffi abi 0.11.0
drasi-core 0.5.10, drasi-lib 0.9.3
plugin sdk 0.11.3, ffi abi 0.14.0

56 plugins published; sources include:
cloudflare-radar, dataverse, grpc, gtfs-rt, here-traffic, http, ...

source/mock resolves to 0.2.7 for aarch64-apple-darwin
source/mock resolves to 0.2.12 for aarch64-apple-darwin
installed to /tmp/drasi-python-plugins/plugin-demo/libdrasi_source_mock.dylib
signature: unsigned

Expand Down
4 changes: 2 additions & 2 deletions scripts/build_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@

# (crate, version, cargo lib name)
PLUGINS = [
("drasi-source-mock", "0.2.7", "drasi_source_mock"),
("drasi-reaction-log", "0.2.5", "drasi_reaction_log"),
("drasi-source-mock", "0.2.12", "drasi_source_mock"),
("drasi-reaction-log", "0.2.9", "drasi_reaction_log"),
]


Expand Down
Loading
Loading