Use variables to configure notifications
Your vacation is just around the corner. Your colleague takes over the monitoring of various projects from you. In AskAnna you can set who gets notifications. Now that you’re going on vacation, you want to change this temporarily. Also handy because when you come back from vacation, you don’t have to clean up all these notification emails :)
In AskAnna you can configure who should get email notifications. In the askanna.yml you can specify a list of email addresses. Or, you could set a variable name and use this variable to configure who should set an email.
Using the variable has the advantage that you don’t have to push a new version of the code in case you want to change who should receive a notification email.
See the askanna.yml
below for an example. In the notifications
section we set the variable notification_email
. With this set in the job definition, every time you run the job, it will look up this variable and add the value to the list of email addresses that should receive a notification.
train model:
job:
- pip install poetry && poetry install
- python code/train.py
output:
result: model.pkl
schedule:
- “@weekly”
notifications:
all:
email:
- ${notification_email}
With the job configured, you only have to add this variable to the project. You can use the AskAnna CLI:
# Add a new variable
askanna variable add -n notification_email
# Change an existing variable
askanna variable change
Or:
- open your project in the web interface,
- go to the project section variables
- and add a variable with the name
notification_email
.
The value for this variable can be one or multiple email addresses. If you want to add multiple email addresses, you
can comma-separate them: [email protected], [email protected], ...
Now you know how to use variables in AskAnna to change who should receive a notification about job activity quickly.