ufs-community / uwtools

Workflow tools for use with applications with UFS and beyond
GNU Lesser General Public License v2.1
11 stars 24 forks source link

UW-269 Extend set_config.py tool to "export" variables. #272

Closed NaureenBharwaniNOAA closed 10 months ago

NaureenBharwaniNOAA commented 1 year ago

Description

We will need to interface between a new YAML-configured App, and the j-jobs/ex-scripts (collectively referred to as run scripts) currently written mostly in bash. We will need to be able run a command line tool in bash that "exports" the variables in a given section of our YAML or INI file.

These sections will need to be "flat" and we will want to ensure we have namespace protection. Run scripts will need access to variables from multiple sections of an experiment config file, but it is an NCO restriction that we shouldn't export all variables for an experiment at run time. That's a good practice in general to ensure namespace protection.

So, here we will want a tool that exports all the key/value pairs in given sections to the shell in which it is invoked. An interface that looks something like is sufficient.

export_variables.py -c /path/to/experiment.yaml --sections run_fcst workflow user

What it does, then is loads the config, finds those sections, and ensures that the variables are available in the shell.

This need not necessarily be an extension of the set_config tool.

Requirements

Acceptance Criteria

Contractual Requirements

4.5.6. Support the design, development and deployment of a Unified Workflow (UWF) for the UFS, associated tools, and documentation for multiple cloud and on-premise HPC environments, as well as delivering the UWF integration plan.

Due - Support activities, existing Confluence page and user manual updates reflecting community needs, as approved by EPT. - Online and MS Word Report via email

PRS:

christinaholtNOAA commented 10 months ago

Fixed by PR #280