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.

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.2.1.tar.gz (8.8 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.1.tar.gz.

File metadata

File hashes

Hashes for snakemake_logger_plugin_panoptes-0.2.1.tar.gz
Algorithm Hash digest
SHA256 da59ae6d45190dd934348898dc972da4b063166a2333526b8a5f601d7eafb6d3
MD5 2db0e3d4fbf48f15677d59e786e9a891
BLAKE2b-256 5804e1afe02c17b5184d6e7b10e2f48c929cfa5b40b0ae1bafa01db75b122061

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snakemake_logger_plugin_panoptes-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 134438cd4007f77b8a989b8aabf7504b4b76f0f504eba10b2c31b416ef881528
MD5 9c363cf77a4cee2342d537b78b896e33
BLAKE2b-256 7c947a587a2e4524b4618dfe2bb38d671f271afbd3e903763418e1ab289ccaf4

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