Skip to content

Instantly share code, notes, and snippets.

@kinow
Last active March 24, 2020 11:10
Show Gist options
  • Save kinow/8058c943732861a22c0269e2cdee943c to your computer and use it in GitHub Desktop.
Save kinow/8058c943732861a22c0269e2cdee943c to your computer and use it in GitHub Desktop.
Experiments running cyclic workflows with Cylc Flow and with StackStorm st2

Running a simple cyclic workflow with Cylc Flow and with StackStorm st2

First we need a simple workflow.

[scheduling]
    initial cycle point = 20130808T00
    final cycle point = 20130809T00
    [[graph]]
        R1 = "prep => foo"
        PT12H = "foo[-PT12H] => foo => bar"

[runtime]
  [[root]]
      script="sleep 2"

This is a Cylc Flow workflow. Compatible with versions 7 and 8 (not released ATOW). It has three tasks: prep, foo, and bar.

The first time it runs (R1) the workflow will start action prep, that will trigger foo.

Then the workflow definition also specifies that every 12 hours (PT12H) the previous foo (foo[-PT12H]) task will trigger the next foo, that will trigger the bar task.

Cylc Flow

Visualizing the workflow is easier.

five

image

It will start running immediately when the user calls cylc run --no-detach five, or when it is started via the GUI (cylc gui five).

It will execute the first task, then the next, then the next, and so it goes. In a cyclic way. Each task has the same command (script) that simply sleeps for 2 seconds.

When it reaches the end, it will stop.

StackStorm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment