| 1 |
#!Jinja2 |
| 2 |
|
| 3 |
{% |
| 4 |
set DATES = [ |
| 5 |
'2000-01-01T00:00Z', |
| 6 |
'2000-01-01T06:00Z', |
| 7 |
'2000-03-05T12:00Z', |
| 8 |
'2000-05-28T13:36Z', |
| 9 |
'2001-01-05T23:24', |
| 10 |
'2002-04-30T04:20', |
| 11 |
] |
| 12 |
%} |
| 13 |
|
| 14 |
[meta] |
| 15 |
title = Irregular cycling example |
| 16 |
description = """ |
| 17 |
A workflow that runs a group of tasks on arbitrary dates |
| 18 |
with inter-cycle dependencies between those dates. |
| 19 |
""" |
| 20 |
|
| 21 |
[scheduling] |
| 22 |
initial cycle point = 2000 |
| 23 |
[[graph]] |
| 24 |
# define the tasks you want to run on startup |
| 25 |
R1 = install |
| 26 |
|
| 27 |
# run this graph every year |
| 28 |
P1Y = """ |
| 29 |
install[^] => prep |
| 30 |
""" |
| 31 |
|
| 32 |
{# loop over the list of dates #} |
| 33 |
{% for date in DATES %} |
| 34 |
# schedule the tasks to run at each date |
| 35 |
R1/{{ date }} = """ |
| 36 |
# make "run_model" depend on the "prep" task from the same year |
| 37 |
prep[{{ date | strftime('%Y') }}] => run_model => plot |
| 38 |
|
| 39 |
{# include this for all but the first date #} |
| 40 |
{% if not loop.first %} |
| 41 |
# make the run_model task depend on its previous instance |
| 42 |
run_model[ {{ loop.previtem }} ] => run_model |
| 43 |
{% endif %} |
| 44 |
""" |
| 45 |
{% endfor %} |
| 46 |
|
| 47 |
[runtime] |
| 48 |
[[install]] |
| 49 |
[[prep]] |
| 50 |
[[run_model]] |
| 51 |
[[plot]] |