snakemake-logger-plugin-dart
A Snakemake 9+ logger plugin that streams workflow events — scheduled jobs, progress, the rule DAG, logs and errors — in real time over WebSocket to a desktop application that hosts the server.
The app is the server and this plugin is the client, so there is nothing in
between: no polling, no intermediate service, and the endpoint stays on
loopback. The other half of the integration is the Dart package
snakemake_bridge, which provides
the embedded server, typed event models and a state reducer — but any server
implementing the protocol specification
works just as well. For the design, the security model and the failure modes,
see ARCHITECTURE.md.
Requirements
- Python
>= 3.11 - Snakemake
>= 9.0
Installation
pip install snakemake-logger-plugin-dart
Install it in the same Python environment as Snakemake (same venv/conda). Snakemake discovers plugins through the entry points of the active environment, so a plugin installed next door is simply invisible.
Verify that Snakemake found it:
snakemake --help | grep logger-dart
# --logger-dart-address VALUE
# --logger-dart-token VALUE
# --logger-dart-flush-timeout VALUE
If that prints nothing, run pip show snakemake snakemake-logger-plugin-dart
and check that both report the same Location.
Usage
Point the plugin at the address the app is listening on:
export SNAKEMAKE_LOGGER_DART_TOKEN=<token-generated-by-the-app>
snakemake --cores 4 \
--logger dart \
--logger-dart-address ws://127.0.0.1:8765
Passing the token through the environment rather than --logger-dart-token
keeps it out of ps output, where any local user could read it.
Settings
| Flag | Env var | Default | Description |
|---|---|---|---|
--logger-dart-address |
SNAKEMAKE_LOGGER_DART_ADDRESS |
(required) | ws:// URL of the server embedded in the app. |
--logger-dart-token |
SNAKEMAKE_LOGGER_DART_TOKEN |
— | Bearer token the app requires, sent as Authorization: Bearer. Prefer the env var. |
--logger-dart-flush-timeout |
— | 5.0 |
Seconds to wait on shutdown for pending events to be delivered. |
How it behaves
The guiding rule is that the workflow never pays for the telemetry. A closed app, a dropped connection or a stalled consumer degrade what the app sees, never the run itself.
emit()never blocks Snakemake. Events go onto an in-memory queue (10,000 entries) drained by a dedicated thread; if the queue fills, new events are dropped with a warning rather than applying backpressure to the run.- The worker reconnects on its own with exponential backoff (0.5 s up to 10 s), for as long as the run is active.
- A replay buffer keeps the last 100,000 events. On every (re)connection the
plugin sends
hello, the app answers withreplay, and the gap is refilled — so an app opened halfway through a run still catches up. Events dropped from the send queue remain in this buffer and are recoverable. - Delivery is at-least-once: after a replay some events arrive twice, and
the consumer deduplicates by the envelope's
seq. - On shutdown the queue is flushed (bounded by
flush-timeout) and abyeevent closes the run.
If nothing shows up in the app
In this order:
- the address passed to
--logger-dart-addresscarries the port the app actually printed; - the app and the plugin use exactly the same token — a mismatch is refused
at the handshake with
401, before any event is sent; snakemake --help | grep logger-dartfinds the plugin;- the plugin lives in the same Python environment as the
snakemakeexecutable in use; - the app's server was already listening before the run started (or, if not, that it reconnects — the replay buffer covers a late start).
Development
pip install -e '.[dev]'
pytest
With the package also installed in the environment,
pytestimports the installed copy and local edits are silently ignored. RunPYTHONPATH=src pytestto test the working tree.
Full guide — building the wheel, the Dart tests and end-to-end validation with a real workflow — in INSTALL.md.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snakemake_logger_plugin_dart-0.1.1.tar.gz.
File metadata
- Download URL: snakemake_logger_plugin_dart-0.1.1.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
127bf55dc286d260b5bf8c2e85ffa15ba7fbccdf91695c68120242dc576d0b83
|
|
| MD5 |
15447912107e7f60e556c896526cd545
|
|
| BLAKE2b-256 |
8a7b7f19596e080a0f6390773610098ccc9b50ef5c313d535f6cefb487d8f340
|
File details
Details for the file snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl.
File metadata
- Download URL: snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdc438524de7ec6ce4c5ad5746cf086d7809e713acc479b9cdc0a3d912594ac5
|
|
| MD5 |
ffbd9a5eb6f796824b6550cc1226b7c6
|
|
| BLAKE2b-256 |
19dc5711f4331a5ff901d43b84521c2df1c7c79a550c07fcff88a4d148365c56
|