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

Handling jinja-style fields in yaml files when using --config #6294

Closed
GeigerJ2 opened this issue Feb 22, 2024 · 3 comments
Closed

Handling jinja-style fields in yaml files when using --config #6294

GeigerJ2 opened this issue Feb 22, 2024 · 3 comments
Labels
type/feature request status undecided

Comments

@GeigerJ2
Copy link
Contributor

For easy setting up of computers and codes, there currently exist aiida-code-registry and aiida-resource-registry. In the former repo, configuration files are explicit/specific, with most values already set (apart from things like username). While in the latter repo, fields are often kept more general, and instead jinja variables are used, e.g. for Quantum Espresso:

label: '{{ code_binary_name }}-{{ version }}'

This is done to keep these fields dynamic, so they can then be filled in manually/graphically in aiidalab (if I understand correctly, the main focus of the repo so far).

Now, as we are planning to replace aiida-code-registry, and make aiida-resource-registry the main hub for computer and code configuration files, they should also be compatible with aiida-core. Currently, with the provided files, verdi fails due to the metadata section, and sets the jinja variable expressions as the literal fields, e.g. labelling the computer {{ label }} (ofc, to resolve the latter, one could just do a simple search-and-replace).

Now, to make aiida-resource-registry easier compatible with aiida-core we could differentiate inside the repo between files intended to be used in aiidalab and aiida-core, and just update and move the files from aiida-code-registry there (will create issues/PRs in the respective places, as well).

Or, additionally, which might be a neat feature, add in aiida-core the functionality that when jinja variables are found, the user is prompted for input only on these items. Like this, fully specified files are still read in automatically by verdi, while one is only prompted for fields such as label that cannot be generalized (or could they? :3) - that is, without each person having to manually search-and-replace them in the yaml files. Also, forgetting to replace fields wouldn't lead to things like codes labelled {{ label }} in the database.

In the short term, this seems like a small issue, but in the long term we could almost fully automate the setup of computers/codes by using the registry, such that new users basically don't have to take care of anything during their setup and configuration, as long as the files already exist in the registry (see also this PR), possibly removing another entry hurdle.

Pinging @mbercx and @unkcpz here to add their thoughts, as I brought it up to both of you.

@GeigerJ2 GeigerJ2 added the type/feature request status undecided label Feb 22, 2024
@sphuber
Copy link
Contributor

sphuber commented Feb 22, 2024

Related (and possible duplicate) issues:

#5949
#4680

@GeigerJ2
Copy link
Contributor Author

Ah, good catch! I'll close this issue in favor of #4680.

@unkcpz
Copy link
Member

unkcpz commented Feb 22, 2024

Also this one in team-compass aiidateam/team-compass#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature request status undecided
Projects
None yet
Development

No branches or pull requests

3 participants