i did try your instance initially without 'get-configāing it, e.g., i always, register, validate, ā¦, get-config, etcā¦
the validation fails for meā¦
Ah, yes. I tested the validate command before changing the suite and it worked. But now it fails due to Jinja not finding the variables defined in the suite.rc file (the error is similar to referencing a variable before it is declared in Python).
So you will always have to define the variables in your cylc sub-commands that need to parse the suite.rc file, like submit, validate, get-config, etc.
I have not used much Rose, besides reading the documentation and doing a few code reviews for the new code, but I think one of the features of Rose is to allow you to save your variables so you donāt have to keep repeating them in your command line.
But others can confirm if thatās the case, or if there are other workarounds.
Note too that functionalities of Rose are being incorporated in Cylc 8, either directly in the code or as plug-ins.
does not differentiate the cases of using {{myVar1}} vs. {%set myVar1=myVar1 %}.
I think your previous example is a valid suite.rc. The generated echo command is valid, but does not print anything.
And the Jinja statements you used were valid. They were declaring variables, but not outputting anything.
@kinow pretty much nailed it, but I can add a couple of comments.
It helps to think of Jinja2 as a preprocessor that generates the final suite.rc file that the Cylc scheduler loads. The Jinja2 {% ... %} syntax is for statements that set and manipulate Jinja2 variables but donāt print anything to your suite.rc file. The {{ ... }} syntax is the print statement, which writes text out to your suite.rc file (which @kinow is calling the template āoutputā).
If your suite.rc contains Jinja2 variables that have to take their values from command line inputs, then you will have to supply those inputs on every command line that parses the suite.rc file (including cylc validate) otherwise the command will fail due to referencing undefined variables. However, you can set defaults to be used if you donāt supply values on the command line:
{{ VAR | default("blah") }}
Yes, rose suite-run takes Jinja2 variables defined in the rose-suite.conf file and writes the variable definitions to the suite.rc at install time. However, that functionality has been migrated into Cylc 8, so donāt bother with it now unless you are already using rose suite-run with Cylc 7.