Is it possible to mark a key in flow.cylc as “required” so that if it is not provided with a value, an error is raised during cylc validate/install?
The reason I need this is that while writing portable workflows, I want to mark some site-specific settings (like platform or certain environment variables) as “required.” This way, they must be overwritten by the site include file.
Thank you in advance for your help and suggestions!
This may be neater, especially if you don’t want to add the Rose dependency or the checks are simple and you only have a few variables, but could quickly become a pain if you have lots of variables.
#site.cylc
{% set platform_name = "actual_name" %}
#!jinja2
# flow.cylc
{% set platform_name = "default" %}
%%include site.cylc
{{ assert(platform_name != "default", "Platform Name should be overridden") }}
# ...
[runtime]
[[task]]
platform = {{platform_name}}
> cylc validate
Jinja2Error: Jinja2 Assertion Error: Platform Name should be overridden
...
Use Rose
Rose allows you to create a file alongside your workflow containing configuration items: