# Varying rose app behaviour by cycle point

**URL:** <https://cylc.discourse.group/t/varying-rose-app-behaviour-by-cycle-point/373>\
**Category:** Rose Support\
**Created:** [August 31, 2021, 4:27pm UTC](https://cylc.discourse.group/t/varying-rose-app-behaviour-by-cycle-point/373 "2021-08-31T16:27:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![edmundh](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/edmundh/32/70_2.png) [@edmundh](https://cylc.discourse.group/u/edmundh)\
**Post date:** [August 31, 2021, 4:27pm UTC](https://cylc.discourse.group/t/varying-rose-app-behaviour-by-cycle-point/373/1 "2021-08-31T16:27:40Z")

</div>

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](https://cylc.github.io/cylc-doc/stable/html/suite-design-guide/general-principles.html#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

---

<div class="post-metadata">

**Author:** ![wxtim](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/wxtim/32/151_2.png) [@wxtim](https://cylc.discourse.group/u/wxtim)\
**Post date:** [August 31, 2021, 8:01pm UTC](https://cylc.discourse.group/t/varying-rose-app-behaviour-by-cycle-point/373/2 "2021-08-31T20:01:14Z")

</div>

**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:

```ini
[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:

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

```

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

---

<div class="post-metadata">

**Author:** ![edmundh](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/edmundh/32/70_2.png) [@edmundh](https://cylc.discourse.group/u/edmundh)\
**Post date:** [August 31, 2021, 8:03pm UTC](https://cylc.discourse.group/t/varying-rose-app-behaviour-by-cycle-point/373/3 "2021-08-31T20:03:42Z")

</div>

Genius - thanks Tim - yes, perfect!

---

<div class="post-metadata">

**Author:** ![wxtim](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/wxtim/32/151_2.png) [@wxtim](https://cylc.discourse.group/u/wxtim)\
**Post date:** [September 1, 2021, 7:37am UTC](https://cylc.discourse.group/t/varying-rose-app-behaviour-by-cycle-point/373/4 "2021-09-01T07:37:18Z")

</div>

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

```auto
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]

---

<div class="post-metadata">

**Author:** ![wxtim](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/wxtim/32/151_2.png) [@wxtim](https://cylc.discourse.group/u/wxtim)\
**Post date:** [September 1, 2021, 7:44am UTC](https://cylc.discourse.group/t/varying-rose-app-behaviour-by-cycle-point/373/5 "2021-09-01T07:44:44Z")

</div>

[My toy example](https://github.com/wxtim/workflows/tree/master/rose-task-opts-a-cycle-point)
