Sage-Bionetworks / SynapseWorkflowHook

Code for linking a workflow engine to a Synapse evaluation queue
Apache License 2.0
4 stars 1 forks source link

Turn off participant email notifications #42

Closed philerooski closed 5 years ago

philerooski commented 5 years ago

My workflow already handles emailing the submitter when their submission has been validated and scored. This process rarely takes more than a few seconds, so I want to be able to disable the emails sent by the workflow hook to the submitter so that they aren't inundated with emails.

The "received" email is more useful in my use case than the "completed" email, so being able to enable/disable these individually would be ideal.

thomasyu888 commented 5 years ago

There is a docker compose env variable you can set to disable notifications. Please carefully read through readme.

It's something like SHARE_RESULTS_IMMEDIATELY=false

philerooski commented 5 years ago

Are you certain this disables email notifications? Even received? The README currently only mentions how this variable affects logs (which are sent with the "completed" email).

thomasyu888 commented 5 years ago

Hmm.... Maybe I'm remembering incorrectly. I would confirm with Bruce.

Edit. I think you're right and we would need this feature for what you want. SHARE_RESULTS_IMMEDIATELY has to do with the logs being returned. Although I will say that the email tool we have is actually a bit hacky. We should honestly be figuring out how to log certain steps of the workflow and returning those to the participant. We can chat more when I get back

brucehoff commented 5 years ago

The workflow hook notifies the submitter of the following events:

Do you want to control which of the five notifications are sent?

philerooski commented 5 years ago

It would be great if they could be optional variables that I set in .env -- defaulting to true (do notify).

brucehoff commented 5 years ago

How about a 'mask' of submitter notifications: 0x00001 = 1 = send message when workflow has started 0x00010 = 2 = send message when workflow has completed 0x00100 = 4 = send message when workflow has failed 0x01000 = 8 = send message when workflow has been stopped by user 0x10000 = 16 = send message when workflow has timed out

The default would be 0x11111 = 31, send messages for everything.

brucehoff commented 5 years ago

https://github.com/Sage-Bionetworks/SynapseWorkflowHook/commit/e8e21a189bf4118b17edc5e8853764237a799941

brucehoff commented 5 years ago

@philerooski When the build finishes, as shown here: https://cloud.docker.com/u/sagebionetworks/repository/docker/sagebionetworks/synapseworkflowhook/builds you can try out the new SUBMITTER_NOTIFICATION_MASK parameter documented here: https://github.com/Sage-Bionetworks/SynapseWorkflowHook/blob/master/README.md

philerooski commented 5 years ago

Am I using SUBMITTER_NOTIFICATION_MASK correctly? I pulled the latest sagebionetworks/synapseworkflowhook and sagebionetworks/synapseworkflowhook-toil and set SUBMITTER_NOTIFICATION_MASK=28 because I only wanted participants to receive emails when something went wrong or they cancelled their submission -- but I still received "workflow in progress" and "workflow has finished running" emails.

brucehoff commented 5 years ago

A line needs to be added to docker-compose.yaml as shown in this commit: https://github.com/Sage-Bionetworks/SynapseWorkflowHook/commit/5fae5997c4e488a4a6d033a97dd4862c9280e61b

philerooski commented 5 years ago

I still seem to be getting emails after pulling commit 7c7a022 and respective images (also from 7c7a022).

I've set SUBMITTER_NOTIFICATION_MASK=28 in my .env file

brucehoff commented 5 years ago

Sorry, there was a typo. Please:

docker pull sagebionetworks/synapseworkflowhook

to get the fix.