Skip to main content

Snakemake logger plugin that forwards workflow events to a panoptes server.

Project description

snakemake-logger-plugin-panoptes

PyPI Conda

A Snakemake 9 logger plugin that forwards workflow events to a running panoptes server, replacing the legacy --wms-monitor integration that was removed in Snakemake 9.

Requirements

Install

# via PyPI
pip install snakemake-logger-plugin-panoptes

# or via bioconda
conda install -c conda-forge -c bioconda snakemake-logger-plugin-panoptes

After installing, Snakemake should advertise the plugin in --help:

snakemake --help | grep logger-panoptes
#   --logger-panoptes-address VALUE
#   --logger-panoptes-timeout VALUE

Use

Start a panoptes server, then run Snakemake with the plugin enabled:

snakemake \
    --cores 1 \
    --logger panoptes \
    --logger-panoptes-address http://127.0.0.1:5000

You can also point at the address via an environment variable:

export SNAKEMAKE_LOGGER_PANOPTES_ADDRESS=http://127.0.0.1:5000
snakemake --cores 1 --logger panoptes

Settings

Flag Env var Default Description
--logger-panoptes-address SNAKEMAKE_LOGGER_PANOPTES_ADDRESS (required) Base URL of the panoptes server.
--logger-panoptes-timeout 10.0 Per-request HTTP timeout in seconds.
--logger-panoptes-name SNAKEMAKE_LOGGER_PANOPTES_NAME (auto uuid) Stable workflow name. Re-running with the same name reuses and resets the existing panoptes workflow instead of creating a new one.

Give a run a stable name so re-runs update the same panoptes entry instead of piling up new ones:

snakemake \
    --cores 1 \
    --logger panoptes \
    --logger-panoptes-address http://127.0.0.1:5000 \
    --logger-panoptes-name my-pipeline

How it works

On workflow start the plugin calls GET /create_workflow to register a new workflow with the panoptes server and remembers the returned workflow id. When --logger-panoptes-name is set it is passed along, and the server reuses (and resets) any existing workflow with that name so re-runs land on the same id. It then translates Snakemake LogEvent records (JOB_INFO, JOB_STARTED, JOB_FINISHED, JOB_ERROR, SHELLCMD, PROGRESS, ERROR, RUN_INFO) into the JSON message format that panoptes' /update_workflow_status endpoint already understands.

Network errors are logged but never crash the workflow.

For a working example workflow that uses this plugin, see snakemake_example_workflow.

Development

pip install -e '.[dev]'   # editable install with test deps (quote .[dev] for zsh)
pytest

License

MIT

Project details


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_panoptes-0.2.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file snakemake_logger_plugin_panoptes-0.2.0.tar.gz.

File metadata

File hashes

Hashes for snakemake_logger_plugin_panoptes-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d13465e05407004177c9ba8b422c7f0a4ce21ba6adc4b2359b69d1b0a281d860
MD5 8c9a7494d52d69ac73903b57b2ad15c4
BLAKE2b-256 808ee81b4fe0a390ba27c39f301cae69b91143b9d639e34f23161c66b4d0ecd6

See more details on using hashes here.

File details

Details for the file snakemake_logger_plugin_panoptes-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for snakemake_logger_plugin_panoptes-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a98143a69c2b3cf3c53eb6ba6974c643ba2ecee41379173cbefc289c329a9b7
MD5 965dfafded98f8fc48c003870c1b7cd1
BLAKE2b-256 c1b8b1675f55a30246b922dbeeb24b14a808b586e7e588cd067b8448c4fb36a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page