Skip to main content

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 with replay, 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 a bye event closes the run.

If nothing shows up in the app

In this order:

  1. the address passed to --logger-dart-address carries the port the app actually printed;
  2. the app and the plugin use exactly the same token — a mismatch is refused at the handshake with 401, before any event is sent;
  3. snakemake --help | grep logger-dart finds the plugin;
  4. the plugin lives in the same Python environment as the snakemake executable in use;
  5. 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, pytest imports the installed copy and local edits are silently ignored. Run PYTHONPATH=src pytest to 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

snakemake_logger_plugin_dart-0.1.1.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file snakemake_logger_plugin_dart-0.1.1.tar.gz.

File metadata

File hashes

Hashes for snakemake_logger_plugin_dart-0.1.1.tar.gz
Algorithm Hash digest
SHA256 127bf55dc286d260b5bf8c2e85ffa15ba7fbccdf91695c68120242dc576d0b83
MD5 15447912107e7f60e556c896526cd545
BLAKE2b-256 8a7b7f19596e080a0f6390773610098ccc9b50ef5c313d535f6cefb487d8f340

See more details on using hashes here.

File details

Details for the file snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for snakemake_logger_plugin_dart-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdc438524de7ec6ce4c5ad5746cf086d7809e713acc479b9cdc0a3d912594ac5
MD5 ffbd9a5eb6f796824b6550cc1226b7c6
BLAKE2b-256 19dc5711f4331a5ff901d43b84521c2df1c7c79a550c07fcff88a4d148365c56

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page