Varying rose app behaviour by cycle point

Hiya - I have a couple of tasks which will be run in both R1 and “normal” dependency cycles.

  • In one case task configuration is likely to be identical
  • In the other, the task configuration is likely to change a little

For straight cylc tasks/scripts, I can see that it would likely be sensible for me to follow the Varying Behaviour By Cycle Point example in the suite design guide.

I’m less clear about what approach is sensible when the tasks are rose apps.

At the moment I’m thinking of just duplicating these:

  • suite.rc [run_time][[my_app_cold] pointing to app/my_app_cold/[...]
  • suite.rc [run_time][[my_app] pointing to app/my_app/[...]

But is there a cleverer, DRY-er way, e.g. using inheritance as above?

Ask as while I can see that (especially in “different task config” case) I may not be able to escape duplicating the ~largely-similar-but-slightly-different configuration interfaces (rose-app.conf, rose-meta.conf), I’d like to be able to avoid duplicating other aspects (e.g. identical my_script.py present in both my_app/bin/ and my_app_cold/bin/ ,

Thanks!
Edmund

Answer checked using Cylc 7. (I can’t see any reason it won’t work at Cylc 8)

If I’ve understood the question correctly you might consider using optional configs:

[runtime]
    [[FAMILY_SETTINGS]]
    [[task_cold]]
        inherit = FAMILY_SETTINGS
        script = rose task-run --opt=cold --app-key=task
    [[task]]
        inherit = FAMILY_SETTINGS
        script = rose task-run

In your the workflow folder:

|-- app
|   `-- myapp
|       |-- opt
|       |   `-- rose-app-cold.conf
|       `-- rose-app.conf

Then change any settings you want different in the rose-app-cold.conf.

1 Like

Genius - thanks Tim - yes, perfect!

1 Like

I missed a bit - you will also need to give the app key if you change the name of the cylc task:

rose task-run --opt cold --app-key myapp

[to help anyone who looks at this in future I retrospectively added this to my original answer]

1 Like

My toy example

1 Like