Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onError/onSuccess for rules #133

Open
dsnezhkov opened this issue Dec 2, 2019 · 6 comments
Open

onError/onSuccess for rules #133

dsnezhkov opened this issue Dec 2, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@dsnezhkov
Copy link

dsnezhkov commented Dec 2, 2019

Hello,

I have a long running workflows, and want to report the progress of execution to an external dashboard.

It would be nice to have rule-level onerror/onsuccess hooks so that a more granular reporting can be done. This call back can be used to execute pre- and post- logic.

I currently work around it by emulating start/stop of a rule by wrapping processing action in a call to an external utility (which in turn makes an HTTP call to the dashboard) but was hoping this can be done natively.

Thank you.

@dsnezhkov dsnezhkov added the enhancement New feature or request label Dec 2, 2019
@SichongP
Copy link
Contributor

SichongP commented Dec 7, 2019

Doesn't snakemake already output progress of rule execution? At least it reports error/success I think. Would something that periodically probes an output log file of snakemake work?

@dsnezhkov
Copy link
Author

I think snakemake run logs are not overly parser friendly for the environment I am in, both in structure and in timing (flush of output into a file). It would be cleaner to hook into the return code via callback. That way there is no separate process that watches the logs, and the callback is just another task I can instruct snakemake to execute on. Perhaps I may be missing some logging options?

@schaefed
Copy link

Hello Everybody,

first of all: Thanks for the great tool!

We are using Snakemake to organize scientific, ETL-like pipelines and it has proven to be extremely valuable. Our workflows run regularly and integrate quite a few failure-prone steps (e.g. data transfer over mobile networks, http-requests, limited computing ressources) and are monitored by non-technical folks. In order to provide fine-grained reporting, a feature like rule-based onerror/onsuccess handlers would be really useful.

Is there any chance to get some momentum behind this enhancement request? If so and with a somewhat clear prospect to get such a feature merged eventually, I would be happy to take on the work on this and prepare a MR. What do you think?

@gibsramen
Copy link

I would also be interested in such a feature. I have a few core steps in a workflow where it would be convenient to have a rule-level onerror/onsuccess.

@nh13
Copy link
Contributor

nh13 commented Dec 18, 2023

I would also add that I wouldn't mind having this!

@msto
Copy link
Contributor

msto commented Jan 4, 2024

A rule can complete successfully (exit code 0) but its outputs can be still be wrong. (e.g. if the invoked tool is buggy, if the user specified an incorrect argument, if the user provided incorrect inputs to the rule, etc)

One helpful use case for rule-level onsuccess would be to assert that the output data matches expectation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants