Skip to content

Commit

Permalink
apps, playsicb
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Nov 15, 2024
1 parent eb55152 commit e4e6b64
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 42 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ You may find these easier to start with than writing a suite from scratch.

## Data Retrieve First

* Demo a very simple pattern where we ensure data has been collected
before analysing it.
Demo a very simple pattern where we ensure data has been collected
before analysing it.

## Five Day Collector

* Collect data for a period, then analyse it.
Collect data for a period, then analyse it.

## Meta Workflow

* Demonstrates how `cylc play -t` can allow you to store separate flows in
one workflow.
Demonstrates how `cylc play -t` can allow you to store separate flows in
one workflow.

## Optional Outputs

Designed to show how optional outputs could support a workflow making choices.
7 changes: 7 additions & 0 deletions apps_showcase/bin/gnome-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-unix:path=/run/user/${UID}/bus}"
notify-send "Cylc Workflow ${1}" \
"${CYLC_WORKFLOW_ID}, ${1}. \nMessage Sent by event handler." \
--icon face-sad \
--app-name "Cylc - Workflow Stalled"
43 changes: 43 additions & 0 deletions apps_showcase/flow.cylc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[meta]
description = """
Showcase of interesting apps.
"""

[scheduler]
[[events]]
stall handlers = gnome-message stall

[scheduling]
[[graph]]
R1 = """
gnome_message
"""

[runtime]
[[gnome_message]]
script = """
export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-unix:path=/run/user/${UID}/bus}"
notify-send "Hello World" \
"Here's any old message." \
--icon face-smile \
--app-name "Cylc Notify Demo"
exit 1
"""
err-script = """
export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-unix:path=/run/user/${UID}/bus}"
notify-send "Cylc Task Failed" \
"${CYLC_WORKFLOW_ID}//${CYLC_TASK_ID}\nMessage sent by error script." \
--icon face-sad \
--app-name "Cylc Notify Demo"
"""
[[[meta]]]
description = """
Send a message to Gnome.
Probably only works on --host=localhost.
Hint - list of icons...
find /usr/share/icons/* -name "*.png"
"""
Empty file added apps_showcase/rose-suite.conf
Empty file.
69 changes: 69 additions & 0 deletions plausible/flow.cylc
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!jinja2
[meta]
description = This is a workflow created by a script..
created on = 2024-11-11T13:7

[task parameters]
assimilation_job = 1..12
forecast_job = 1..12
pp_job = 1..6

[scheduler]
allow implicit tasks = True
cycle point format = %Y

[scheduling]
initial cycle point = 1971
[[graph]]
R1 = install_cold & get_archive_data => start_cycle
P1Y = """
FORECAST[-P1Y]:succeed-all => start_cycle =>
ASSIMILATION:succeed-all => _skip2 => FORECAST
"""
P5Y = """
FORECAST[-P4Y]:succeed-all => skip3
FORECAST[-P3Y]:succeed-all => skip3
FORECAST[-P2Y]:succeed-all => skip3
FORECAST[-P1Y]:succeed-all => skip3
FORECAST:succeed-all => skip3
skip3 => POSTPROC:finish-all => archive => mousekeep
"""


[runtime]
[[root]]
script = """
echo "Hello World!"
max=$(((RANDOM % 20) + 1))
sleepy=$(((max + 10) - (RANDOM % max)))
printf "This script will sleep for %d\n" "$sleepy"
cylc message -- "INFO:Sleep $sleepy"
sleep "$sleepy"
echo "The script has finished sleeping"
"""
[[HOUSEKEEPING]]
[[BIG_SLURMJOB]]
[[WEE_SLURMJOB]]
[[ASSIMILATION]]
[[FORECAST]]
[[POSTPROC]]
[[FLOWCONTROL]]

[[install_cold, get_archive_data, mousekeep, archive]]
inherit = HOUSEKEEPING, WEE_SLURMJOB

[[assimilation<assimilation_job>]]
inherit = ASSIMILATION, WEE_SLURMJOB

[[forecast<forecast_job>]]
inherit = FORECAST, BIG_SLURMJOB

[[pp<pp_job>]]
inherit = POSTPROC

[[mousekeep]]
inherit = HOUSEKEEPING

[[start_cycle, skip3, _skip2]]
inherit = FLOWCONTROL
script = true
45 changes: 8 additions & 37 deletions simplest/flow.cylc
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
#!jinja2

{% from 'cylc.flow' import LOG %}
{% do LOG.info('Tim\'s Simplest Workflow\n -----------------------') %}
{% do LOG.warn('This workflow runs for about an hour and cycles somewhat rapidly - it may stress the host.') %}

[meta]
title = "Simplest Workfløw"
description = """
Should give you just enough to get going
## CLI args
* `-S 'CYCLE="<isodatetime recurrence>"'` allows you to set the cycling.
default is "PT1H"
"""
written for cylc version = 7.x
test with cylc version = 7.8.11

[scheduler]
UTC mode = True
Expand All @@ -24,30 +11,14 @@
# initial cycle point is NOT optional
initial cycle point = 19831213T0600Z

# final cycle point is entirely optional
<<<<<<< HEAD
# Default value makes the workflow run for about 1 hour:
final cycle point = 19840412T1200Z
=======
final cycle point = 19831214T0600Z
>>>>>>> ac30974 (fi)

[[graph]]
{{ CYCLE|default("PT1H", true) }} = Quokka => Numbat => Wambenger

R1 = cold_start
P1D = task

[runtime]
[[MARSUPIALS]]
script= sleep {{ SLEEP | default(3, true) }}

[[Quokka]]
inherit=MARSUPIALS
script = sleep 15

[[Numbat]]
inherit=MARSUPIALS

[[Wambenger]]
inherit=MARSUPIALS


[[cold_start]]
script = """
"""
[[task]]
script = """
"""

0 comments on commit e4e6b64

Please sign in to comment.