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-workflow-id SNAKEMAKE_LOGGER_PANOPTES_WORKFLOW_ID (auto uuid) Stable workflow id. Re-running with the same id reuses and resets the existing panoptes workflow instead of creating a new one.

Give a run a stable id 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-workflow-id 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-workflow-id is set it is passed along, and the server reuses (and resets) any existing workflow with that id 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.

If the panoptes server is served over HTTPS with a certificate signed by a private/corporate CA, point the plugin at the CA bundle via one of REQUESTS_CA_BUNDLE, SSL_CERT_FILE, or CURL_CA_BUNDLE (checked in that order); the plugin uses it to verify the connection.

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.3.0.tar.gz (9.7 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.3.0.tar.gz.

File metadata

File hashes

Hashes for snakemake_logger_plugin_panoptes-0.3.0.tar.gz
Algorithm Hash digest
SHA256 246b1a5b064718aa685cc71272c2234829403c3e30ed70a5ce39d23e76fd3b74
MD5 96237a82cd91bfdf72182ca10a64b69f
BLAKE2b-256 b832bcd071899d552401a18e173441daedc8e8528f944c49a9fe8e7b59bb1ec0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snakemake_logger_plugin_panoptes-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcb889d7a6f00204f1f32cc28cd16d4022038d3edcff6245ddb9fe16c32c87d1
MD5 ebf6a84eb7b9e0d82ae3e08883d09036
BLAKE2b-256 3a9d1680499ba0061c7ba9e62c402e5770a77c22e75a5ed6b9b135d8922bc7eb

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