-
Notifications
You must be signed in to change notification settings - Fork 1
Developer Guide
Emma Hogan edited this page Jan 14, 2025
·
33 revisions
- Wiki: Detailed Working Practices: Coding requirements provides more information.
- Wiki: Detailed Working Practices: Testing requirements provides more information.
- Wiki: Detailed Working Practices: Documentation requirements provides more information.
- When using Rose's File Creation Mode, do not use braces around any environmental variables used. For example, use
[file:$MY_ENV_VAR]rather than[file:${MY_ENV_VAR}], issue #201 provides more information. - Use $ROSE_DATA (e.g.
~/cylc-run/CMEW/runN/share/data/) and $ROSE_DATAC (e.g.~/cylc-run/CMEW/runN/share/cycle/<cycle>/) in preference to extending Cylc's Job Script Environment Variable$CYLC_WORKFLOW_SHARE_DIR(e.g.~/cylc-run/CMEW/runN/share/). - If an app requires four or fewer commands, encapsulate them in the
rose-app.conffile, withset -euo pipefailas the first command, to ensure the job fails if any of the commands fail. For more than four commands, add the commands to a well-named bash script inapp/*/bin. - Use the following flow diagram to determine where an environment variable should be defined:
---
title: Where should my environment variable be defined?
---
flowchart TB
question_multiple1{"
Is the environmental
variable used by multiple
tasks?
"}
question_multiple2{"
Is the environmental
variable used by multiple
tasks?
"}
question_override{"
Should it be possible to
override the environmental
variable, either by the user
or for testing purposes?
"}
output_global_override["
Define the environmental
variable in the
'rose-suite.conf' file
"]
output_app_override["
Define the environmental
variable in the 'env'
section in the
'rose-app.conf' file
"]
output_global["
Define the environmental
variable in the
'root:environment' section
in the 'flow.cylc' file
"]
output_app["
Define the environmental
variable in the
'(taskname):environment'
section in the
'flow.cylc' file
"]
question_override --Yes--> question_multiple1 --Yes--> output_global_override
question_multiple1 --No--> output_app_override
question_override --No--> question_multiple2 --Yes--> output_global
question_multiple2 --No--> output_app