Advanced configuration
MiGA allows flexible execution using a number of techniques, mainly setting project metadata flags, dataset metadata flags, and through the daemon configuration.
These are some examples of advanced behaviors that can be configured in MiGA

Controlling many daemons at once

The MiGA CLI includes support for mass-controlled daemons when several MiGA projects are in the same folder using the miga lair command.
The MiGA Lair will find all the MiGA projects in a folder (or subfolders) and control all the corresponding daemons together:
1
# Check the current status of all the daemons
2
miga lair list -p /path/to/folder
3
4
# Terminate all the daemons at once
5
miga lair terminate -p /path/to/folder
6
7
# Launch and daemonize a process to keep all daemons running
8
miga lair start -p /path/to/folder
9
10
# See more options
11
miga lair -h
Copied!

Sending an email when the project is ready

If your project runs for a long time and you want to be notified by email when it's ready, you can use project hooks:
1
# First cd to the project folder
2
cd /path/to/project
3
4
# And open the MiGA Console
5
miga c
Copied!
In the MiGA Console:
1
# Set the hook "on_preprocessing_ready" to
2
# execute a shell command ("run_cmd") consisting of
3
# sending an email with the project path ("{{project}}")
4
MiGA::Project.load('.').tap do |p|
5
p.metadata[:on_preprocessing_ready] = [
6
['run_cmd', 'echo \'Project ready: {{project}}\' | sendmail [email protected]']
7
]
8
end.save
9
quit
Copied!
Make sure to change /path/to/project to the project path and [email protected] to the email where you want to receive the notification. Also, note that depending on your sendmail configuration you might get that email in the spam folder (or flat-out rejected), so make sure to test sendmail first.
Last modified 7mo ago