Skip to main content

snakemake-logger-plugin-biffix

A Snakemake (9.0 or later) logger plugin that reports a workflow's progress to biffix, the AWS-native control plane for running and tracking workflows. It is the Snakemake counterpart of the nf-biffix Nextflow plugin in ../nf-biffix, and both report the same wire contract (schemas/wire.engine.schema.json).

What it does

The plugin maps Snakemake's log records to biffix engine events (run_started, run_progress, run_dag, task_created, task_submitted, task_retrying, task_succeeded, task_failed, task_outputs and engine_task_verdict) and sends each one to two places:

  • The ingest route, live. Events are buffered and POSTed in batches to {ingest_url}/events, bearer-authenticated with the run's capability token, by a background thread, so Snakemake's logging never waits on the network. Failed requests are retried or dropped; a lost POST never fails the workflow.
  • A durable events.jsonl. Every event is also appended to a local file, which the biffix coordinator uploads and replays through ingest when the run exits, so an event the live POST dropped still arrives (ingest dedupes the repeats).

For a job on AWS Batch, the plugin emits task_submitted carrying the Batch job id, read from the payload the AWS Batch executor plugin attaches to its log records, and AWS EventBridge supplies the job's terminal state. For a local rule, which runs on the coordinator and never reaches Batch, the plugin emits the terminal event itself.

The plugin has no dependencies beyond snakemake-interface-logger-plugins; it uses only the standard library for HTTP.

How biffix uses it

biffix builds the plugin into a wheel for the coordinator base image (docker/coordinator/build-wheels.sh) and installs it into each Snakemake runtime layer (codebuild/runtime/build.sh). The coordinator (docker/coordinator/lib/snakemake.sh) runs Snakemake with --logger biffix and sets the variables below. The version in pyproject.toml must match logger_version in crates/biffix-workflow/src/runtime/pins.rs; a test in runtime/tests.rs checks it.

Configuration

Enable it with snakemake --logger biffix. Each setting comes from an environment variable or a command-line option; a non-empty option wins.

Environment variable Option Meaning
BIFFIX_RUN_ID --logger-biffix-run-id The biffix run the events belong to.
BIFFIX_INGEST_URL --logger-biffix-ingest-url Base URL of the ingest route.
BIFFIX_INGEST_TOKEN --logger-biffix-ingest-token The run's capability token. It is a secret, so prefer the environment variable. The handler removes it from Snakemake's environment once read, so jobs and workflow code that read the variable see it unset.
BIFFIX_EVENT_FILE --logger-biffix-event-file Name of the durable events file, relative to the directory Snakemake starts in (default .biffix_events.jsonl).
BIFFIX_TASK_IMAGES_FILE none Set by the coordinator in a single-job run only: path of a JSON object from each rule name to the image its jobs run in (as the run's image map names it). Each job's task_created names its rule's image; a rule the file lacks ran without a container. Read once, at the first job; a missing or unreadable file means no images.

Snakemake's own derived variables (SNAKEMAKE_LOGGER_BIFFIX_*) are not read; the BIFFIX_* names are the only environment channel.

Development

uv sync --dev
uv run ruff check . && uv run ruff format --check .
uv run validate-pyproject pyproject.toml && uv run mypy
uv run pytest

The tests read files from the biffix repository's schemas/ directory, so they run from a biffix checkout: test_schema_conformance.py checks every emitted event against the engine wire schema, and test_ingest_limits.py checks that the poster's limits (largest batch, largest body, buffer size, retries and timeouts) equal schemas/ingest-limits.json, which biffix-core writes from the constants the ingest route enforces.

License

MIT; see LICENSE.

NOTICE

Parts of handler.py, remote_adapter.py and writer.py (Snakemake log record parsing, the remote executor payload adapter and the JSONL event writer) are adapted from the snakemake-logger-plugin-snakesee package of snakesee. This package does not depend on snakesee. snakesee is distributed under the following license:

MIT License

Copyright (c) 2024 Fulcrum Genomics LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Metadata

Release files for snakemake-logger-plugin-biffix 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for snakemake-logger-plugin-biffix 0.2.3
File Size Uploaded Provenance Actions
snakemake_logger_plugin_biffix-0.2.3.tar.gz 89.3 kB With provenance Details for snakemake_logger_plugin_biffix-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for snakemake-logger-plugin-biffix 0.2.3
File Interpreter ABI Platform Actions
snakemake_logger_plugin_biffix-0.2.3-py3-none-any.whl Python 3 none any Details for snakemake_logger_plugin_biffix-0.2.3-py3-none-any.whl

Total release size: 120.8 kB

Release files / snakemake_logger_plugin_biffix-0.2.3.tar.gz

Download URL snakemake_logger_plugin_biffix-0.2.3.tar.gz
Size 89.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a0fb2f1114cfd8f07bdd080375a976620efd44e739faa7db29d9be2412725098
BLAKE2b-256 checksum
How to use checksums
dd67b2c9cc36c81ad84e95d124790601c690109ff77d186e7fdad82a89a5ce71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Release files / snakemake_logger_plugin_biffix-0.2.3-py3-none-any.whl

Download URL snakemake_logger_plugin_biffix-0.2.3-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbd04238a8691a9db28f59fe3604495ecb9a377c35d87d52915c924cce73712a
BLAKE2b-256 checksum
How to use checksums
47f604eb8e1f45c1d1e9fee8c5238f0c4abb9f7669086f2c622560097ce43a54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

Security for snakemake-logger-plugin-biffix 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for snakemake_logger_plugin_biffix-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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