Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default values for <obtain_from_environment> with [DEFAULT] section #184

Open
ddietz89 opened this issue Oct 1, 2024 · 2 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@ddietz89
Copy link
Contributor

ddietz89 commented Oct 1, 2024

If the reconcile fails here

def _reconcile_with_shell_environment_variables(self):

Could we grab a default value from a [DEFAULT] section in the config?

For example:

[DEFAULT]
nodes = 123

[Replacements]
job_name = GFDL_AVEC_c768L127nh
batch_queue = batch
nodes = <obtain_from_environment>
cluster = c6

The DEFAULT section currently works, however, only if the line is completely omitted. If you leave the variable unset, the harness code complains during reconciliation. Some logic could pull the value from the defaults if variable is unset in the environment (possibly continue throwing an error if there are other issues).

@ddietz89 ddietz89 added the enhancement New feature or request label Oct 1, 2024
@ddietz89 ddietz89 self-assigned this Oct 1, 2024
@hagertnl
Copy link
Contributor

hagertnl commented Oct 3, 2024

Also, improve the messaging when an obtain_from_environment is not found. For example ERROR: This test requires the environment variable RGT_NODES to be set., vs something more like ConfigParser error: nodes = <obtain_from_environment> is not found

@hagertnl
Copy link
Contributor

Should this actually be accomplished in the machine.ini file, rather than the test's .ini file? Because of #183 , we can now define arbitrary environment variables globally, including default values for things like RGT_NODES or other variables. These are overridden by whatever is set by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants