HakaiInstitute / hakai-ctd-qc

Series of tests applied to the Hakai CTD profile data based on the QARTOD tests and other Hakai Specific ones.
0 stars 0 forks source link

Generate email once rebuild completed #28

Closed JessyBarrette closed 1 year ago

JessyBarrette commented 1 year ago

The present workfow applies occasionally a full rebuild of the CTD profiles flags on the hakaidev database in order to test and identify the different issues.

Since this process is long (~4-5h) it would be good to have a script that generates an email to send to a list of email addresses once the process is completed.

This email could also potentially contain a report or make it available somewhere online.

fostermh commented 1 year ago

perhaps tie into git hooks on the server? Actually, now I'm remembering the process is triggered by an ssh call so that won't work.

I assume GitHub does not leave the ssh connection open for 4-5 hours?

JessyBarrette commented 1 year ago

that's right it just triggers it and then disconnects right away for this specific case.

I was thinking of setting up a little email in Python to get sent with stmplib in python https://docs.python.org/3/library/smtplib.html

I'm not sure if that's possible option with hakai's email system

fostermh commented 1 year ago

it's an option. we can discuss. I have done this for other applications.

JessyBarrette commented 1 year ago

I think I will just add a warning at the end of the code which will be capture by sentry and then can be send to Slack/email whatever. That's by far the simplest way to get an alarm :)

JessyBarrette commented 1 year ago

Any rebuild of the hakaidev or hakai database ctd qc flags now triggers a sentry warning. We can close that issue.

Any rebuilds are also tracked on github through the environment deployments. https://github.com/HakaiInstitute/hakai-profile-qaqc/deployments