-
Notifications
You must be signed in to change notification settings - Fork 27
How to run configurations with Multirun
Multirun with IDEA can be a powerful tool to run multirun jobs. This page gives some description of use cases that can be created using Multirun and build-in IDEA feature called "Before launch tasks".
You can add before launch tasks for any configuration using Edit Run Configuration form (Run -> Edit Configurations... -> choose whatever your configuration is).
In the run configuration edit form you can find a "Before launch" section on bottom of the form. You can add Run Another Configuration, that would be run before the Run configuration you're editing.
NOTE: For PyCharm, PHPStorm, WebStorm and other IDEA-based IDEs, there might be no option 'Run Another Configuration' by default. Installing Multirun of version 0.7 or later should fix this problem.
There are a few use cases you can implement using Multirun and Before launch tasks. Let us have tasks A, B, C and D...
If you need to run task A, and then task B after task A is done, this can be done only using Before launch task: just edit configuration B and add A as before launch task using Run Another Configuration option.
Once again, this can be done with only Before Launch tasks. Just edit run configuration for C, and add A and B as before launch tasks using Run Another Configuration option.
If you need to start tasks A and B in the same moment and after they are done start the task C, this can be done in next simple way:
- create multirun configuration AB with tasks A and B
- edit configuration C and add configuration AB as before launch task
This is the case when you want to run tasks A and B in parallel, and after they are done start and run tasks C and D in parallel:
- create multirun configuration AB with tasks A and B
- create multirun configuration CD with tasks C and D
- add configuration AB as before launch task for configuration CD