All Projects → neilmunday → slurm-mail

neilmunday / slurm-mail

Licence: GPL-3.0 license
Slurm-Mail is a drop in replacement for Slurm's e-mails to give users much more information about their jobs compared to the standard Slurm e-mails.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
Smarty
1635 projects
Dockerfile
14818 projects
CSS
56736 projects

Projects that are alternatives of or similar to slurm-mail

launcher-scripts
(DEPRECATED) A set of launcher scripts to be used with OAR and Slurm for running jobs on the UL HPC platform
Stars: ✭ 14 (-70.21%)
Mutual labels:  slurm
acorn
A responsive email framework based on a golden ratio typography grid.
Stars: ✭ 90 (+91.49%)
Mutual labels:  email-template
torchx
TorchX is a universal job launcher for PyTorch applications. TorchX is designed to have fast iteration time for training/research and support for E2E production ML pipelines when you're ready.
Stars: ✭ 165 (+251.06%)
Mutual labels:  slurm
robot-email-template
Email template for Robot Framework test results
Stars: ✭ 19 (-59.57%)
Mutual labels:  email-template
SlurmClusterManager.jl
julia package for running code on slurm clusters
Stars: ✭ 27 (-42.55%)
Mutual labels:  slurm
responsive-html-email-templates
Collection of Free responsive HTML templates for Startups
Stars: ✭ 187 (+297.87%)
Mutual labels:  email-template
RazorTemplating
Razor Templating Engine to render Razor Views(.cshtml files) to String in Console, Web, Service, Desktop workloads in .NET Core 3+
Stars: ✭ 216 (+359.57%)
Mutual labels:  email-template
mail-template
💌 This package is a easy to use mail template collection for Laravel 5.x.
Stars: ✭ 18 (-61.7%)
Mutual labels:  email-template
dnde
Drag and drop react email editor
Stars: ✭ 31 (-34.04%)
Mutual labels:  email-template
rss-to-email
Generate HTML emails from your RSS feeds.
Stars: ✭ 92 (+95.74%)
Mutual labels:  email-template
slurmR
slurmR: A Lightweight Wrapper for Slurm
Stars: ✭ 43 (-8.51%)
Mutual labels:  slurm
rslurm
Submit R code to a Slurm cluster
Stars: ✭ 40 (-14.89%)
Mutual labels:  slurm
awflow
Reproducible research and reusable acyclic workflows in Python. Execute code on HPC systems as if you executed them on your personal computer!
Stars: ✭ 15 (-68.09%)
Mutual labels:  slurm
mjml-server
MJML wrapped in Express for use over HTTP
Stars: ✭ 31 (-34.04%)
Mutual labels:  email-template
express mailer
An easy way to send yourself or your team emails about what happens in your rails application
Stars: ✭ 20 (-57.45%)
Mutual labels:  email-template
easy-email
React.js Drag-and-Drop Email Editor based on MJML. Transform structured JSON data into major email clients compatible HTML. Written in Typescript and supported both in browser and Node.js.
Stars: ✭ 449 (+855.32%)
Mutual labels:  email-template
email-template-generator
Simple and useful web app to generate e-mails for any reason you want!
Stars: ✭ 51 (+8.51%)
Mutual labels:  email-template
pechkin
📮 «Печкин» помогает быстро начать вёрстку писем
Stars: ✭ 18 (-61.7%)
Mutual labels:  email-template
task-spooler
A scheduler for GPU/CPU tasks
Stars: ✭ 77 (+63.83%)
Mutual labels:  slurm
awesome-emails
List of tools, articles and videos about email design and development
Stars: ✭ 19 (-59.57%)
Mutual labels:  email-template

Slurm-Mail

GitHub license GitHub stars GitHub forks GitHub issues GitHub Workflow Status GitHub Workflow Status

Author: Neil Munday (neil at mundayweb.com)

Repository: https://github.com/neilmunday/slurm-mail

Contents

  1. Introduction
  2. Requirements
  3. RPM Installation
  4. Source Installation
  5. Configuration
  6. Upgrading from version 2.x to 3.x
  7. SMTP Settings
  8. Customising E-mails
  9. Validating E-mails
  10. Including Job Output in E-mails
  11. Contributors

Introduction

E-mail notifications from Slurm are rather brief and all the information is contained in the subject of the e-mail - the body is empty.

Slurm-Mail aims to address this by providing a drop in replacement for Slurm's e-mails to give users much more information about their jobs via HTML e-mails which contain the following information:

  • Start/End
  • Job name
  • Partition
  • Work dir
  • Elapsed time
  • Exit code
  • Std out file path
  • Std err file path
  • No. of nodes used
  • Node list
  • Requested memory per node
  • Maximum memory usage per node
  • CPU efficiency
  • Wallclock
  • Wallclock accuracy

E-mails can be easily customised to your needs using the provided templates (see below).

You can also opt to include a number of lines from the end of the job's output files in the job completion e-mails (see below).

Requirements

  • Python 3
  • Slurm 20, 21 or 22
  • A working e-mail server

RPM Installation

Note: pre-built RPMs for RHEL7, RHEL8, SLES 15 and OpenSUSE 15 compatible operating systems are available at Slurm-Mail releases.

To create a Slurm-Mail RPM for your OS download the Slurm-Mail tar archive and then run:

rpmbuild -tb slurm-mail-3.4.tar.gz

The Slurm-Mail RPM will install to /opt/slurm-mail and will also create the required cron job for Slurm-Mail to function as well as providing a logrotate configuration for handling Slurm-Mail's log files.

Take note of where rpmbuild created the generated RPM and then install with your package manager (e.g. dnf, yum, zypper).

Source Installation

Download the latest release of Slurm-Mail and unpack it to a directory of your choosing on the server(s) running the Slurm controller daemon slurmctld, e.g. /opt/slurm-mail

tar xfz slurm-mail-3.4.tar.gz

Create the spool and log directories for Slurm-Mail on your Slurm controller(s):

mkdir -p /var/spool/slurm-mail /var/log/slurm-mail
chown slurm. /var/spool/slurm-mail /var/log/slurm-mail
chmod 0700 /var/spool/slurm-mail /var/log/slurm-mail

Create a cron job to run slurm-send-mail.py periodically to send HTML e-mails to users. As Slurm-Mail uses sacct to gather additional job information and may perform additional processing, the sending of e-mails was split into a separate application to prevent adding any overhead to slurmctld.

Example cron job, e.g./etc/cron.d/slurm-mail:

*    *    *    *    *    root    /opt/slurm-mail/bin/slurm-send-mail.py

Set-up logrotate:

cp /opt/slurm-mail/logrotate.d/slurm-mail /etc/logrotate.d/

Configuration

Edit /opt/slurm-mail/conf.d/slurm-mail.conf to suit your needs. For example, check that the location of sacct is correct. If you are installing from source check that the log and spool directories are set to your desired values.

Change the value of MailProg in your slurm.conf file to /opt/slurm-mail/bin/slurm-spool-mail.py. By default the Slurm config file will be located at /etc/slurm/slurm.conf.

Restart slurmctld:

systemctl restart slurmctld

Slurm-Mail will now log e-mail requests from Slurm users to the Slurm-Mail spool directory.

Upgrading from version 2.x to 3.x

Version 3.0 onwards uses a new location for the e-mail templates. Therefore for versions prior to this, please run the following commands:

cd /opt/slurm-mail/conf.d
mkdir templates
mv ./*.tpl templates/

After moving the templates please merge any of the changes from the latest 3.x release with your local copies.

SMTP Settings

By default Slurm-Mail will send e-mails to a mail server running on the same host as Slurm-Mail is installed on, i.e. localhost.

You can edit the smtp configuration options in conf.d/slurm-mail.conf. For example, to send e-mails via Gmail's SMTP server set the following settings:

smtpServer = smtp.gmail.com
smtpPort = 587
smtpUseTls = yes
smtpUserName = [email protected]
smtpPassword = your_gmail_password

NOTE: As this file will contain your Gmail password make sure that it has the correct owner, group and file access permissions.

For SMTP servers that use SSL rather than starttls please set smtpUseSsl = yes.

Customising E-mails

Slurm-Mail uses Python's string.Template class to create the e-mails it sends. Under Slurm-Mail's conf.d/templates directory you will find the following files that you can edit to customise e-mails to your needs.

Filename Template Purpose
ended.tpl Used for jobs that have finished.
ended-array.tpl Used for jobs in an array that have finished.
ended-array_summary Used when all jobs in an array have finished.
invalid-dependency Used when a job has an invalid dependency.
job_table.tpl Used to create the job info table in e-mails.
signature.tpl Used to create the e-mail signature.
staged-out.tpl Used when a job's burst buffer stage has completed.
started.tpl Used for jobs that have started.
started-array-summary.tpl Used when the first job in an array has started.
started-array.tpl Used for the first job in an array that has started.
time.tpl Used when a job reaches a percentage of it's time limit.

You can adjust the font style, size, colours etc. by editing the Cascading Style Sheet (CSS) file conf.d/style.css used for generating the e-mails.

To change the date/time format used for job start and end times in the e-mails, change the datetimeFormat configuration option in conf.d/slurm-mail.conf. The format string used is the same as Python's datetime.strftime function.

To change the subject of the e-mails, change the emailSubject configuration option in conf.d/slurm-mail.conf. You use the following place holders in the string:

Place holder Value
$CLUSTER The name of the cluster
$JOB_ID The Slurm ID of the job
$STATE The state of the job

Validating E-mails

By default Slurm-Mail will not perform any checks on the destination e-mail address (i.e the value supplied to sbatch via --mail-user). If you would like Slurm-Mail to only send e-mails for jobs that correspond to a valid e-mail address (e.g. [email protected]) then you can set the validateEmail option in conf.d/slurm-mail.conf to true. E-mail addresses that failed this check will be logged in /var/log/slurm-mail/slurm-send-mail.log as an error.

Including Job Output in E-mails

In conf.d/slurm-mail.conf you can set the includeOutputLines to the number of lines to include from the end of each job's standard out and standard error files.

Notes:

  • if the user has decided to use the same file for both standard output and standard error then there will be only one section of job output in the job completion e-mails.
  • Job output can only be included if the process that is running slurm-send-mail.py is able to read the user's output files.

Job Arrays

Slurm-Mail will honour the behaviour of --mail-type option of sbatch for job arrays. If a user specifies --mail-type=ARRAY_TASKS then Slurm-Mail will send notification e-mails for all jobs in the array. If you want to limit the number of e-mails that will be sent in this scenario then change the arrayMaxNotifications parameter in slurm-mail.conf to a value greater than zero.

Contributors

Thank you to the following people who have contributed code improvements, features and aided the development of Slurm-Mail:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].