| 1 |
Cylc is good at orchestrating tasks to a schedule, e.g: |
| 2 |
|
| 3 |
* ``PT1H`` - every hour |
| 4 |
* ``P1D`` - every day |
| 5 |
* ``P1M`` - every month |
| 6 |
* ``PT1H ! (T00, T12)`` - every hour, except midnight and midday. |
| 7 |
|
| 8 |
But sometimes the things you want to run don't have a schedule. |
| 9 |
|
| 10 |
This example uses ``cylc ext-trigger`` to establish a pattern where Cylc waits |
| 11 |
for an external signal and starts a new cycle every time a signal is received. |
| 12 |
|
| 13 |
The signal can carry data using the ext-trigger ID, this example sets the ID |
| 14 |
as a file path containing some data that we want to make available to the tasks |
| 15 |
that run in the cycle it triggers. |
| 16 |
|
| 17 |
To use this example, first start the workflow as normal:: |
| 18 |
|
| 19 |
cylc vip event-driven-cycling |
| 20 |
|
| 21 |
Then, when you're ready, kick off a new cycle, specifying any |
| 22 |
environment variables you want to configure this cycle with:: |
| 23 |
|
| 24 |
./bin/trigger <workflow-id> WORLD=earth |
| 25 |
|
| 26 |
Replacing ``<workflow-id>`` with the ID you installed this workflow as. |
| 27 |
|
| 28 |
.. admonition:: Example - CI/CD |
| 29 |
:class: hint |
| 30 |
|
| 31 |
This pattern is good for CI/CD type workflows where you're waiting on |
| 32 |
external events. This pattern is especially powerful when used with |
| 33 |
sub-workflows where it provides a solution to two-dimensional cycling |
| 34 |
problems. |
| 35 |
|
| 36 |
.. admonition:: Example - Polar satellite data processing |
| 37 |
:class: hint |
| 38 |
|
| 39 |
Polar satellites pass overhead at irregular intervals. This makes it tricky |
| 40 |
to schedule data processing because you don't know when the satellite will |
| 41 |
pass over the receiver station. With the event driven cycling approach you |
| 42 |
could start a new cycle every time data arrives. |
| 43 |
|
| 44 |
.. note:: |
| 45 |
|
| 46 |
* The number of parallel cycles can be adjusted by changing the |
| 47 |
:cylc:conf:`[scheduling]runahead limit`. |
| 48 |
* To avoid hitting the runahead limit, ensure that failures are handled in |
| 49 |
the graph. |