Snakemake logger plugin that forwards workflow events to a panoptes server.
Project description
snakemake-logger-plugin-panoptes
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snakemake_logger_plugin_panoptes-0.2.2.tar.gz.
File metadata
- Download URL: snakemake_logger_plugin_panoptes-0.2.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5239389a2305502f193b94954c97ed71a0748fc45f0c3b27b661a480a5a3109e
|
|
| MD5 |
2ded1c48d23d12e68403063ef97c76ae
|
|
| BLAKE2b-256 |
03006efddb9181bae781bf50d3a80226d2eaa54b4958330e80da30e14341ddee
|
File details
Details for the file snakemake_logger_plugin_panoptes-0.2.2-py3-none-any.whl.
File metadata
- Download URL: snakemake_logger_plugin_panoptes-0.2.2-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dca70439d18e86e2848b9320cd4951ccf328ec8a3dc6984f19f0d1f3a97f97c7
|
|
| MD5 |
702b791e483aadb279568658a53d4a4b
|
|
| BLAKE2b-256 |
367171a4e3fc8742ca38e27cc70c3da06cabfefee76f784e953bfebb4fae8562
|