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

Allow for verdi --config #6074

Open
chrisjsewell opened this issue Jul 6, 2023 · 3 comments
Open

Allow for verdi --config #6074

chrisjsewell opened this issue Jul 6, 2023 · 3 comments

Comments

@chrisjsewell
Copy link
Member

chrisjsewell commented Jul 6, 2023

It should be possible to supply a YAML file to verdi at the top-level
This would be similar to how you use e.g. verdi code core.installed --config config.yaml, but the YAML would also provide the parts of the verdi path, i.e. code and core.installed.

The reasoning for the addition is that, especially with additions like Code types and potential changes like #6023, you can no longer store the "full" information about a code/profile configuration in the YAML, e.g. the core.installed and core.sqlite_dos

Such a YAML might look like then (note the command key):

command:
- profile
- setup
- core.sqlite_dos
profile: test_aiida
email: aiida@localhost
first_name: Giuseppe
last_name: Verdi
institution: Khedivial
db_path: some/path/db.sqlite
repository: /tmp/test_repository_test_aiida/
broker_protocol: amqp
broker_username: guest
broker_password: guest
broker_host: 127.0.0.1
broker_port: 5672
broker_virtual_host: ''

and you would just run verdi config --yaml config.yaml

@chrisjsewell
Copy link
Member Author

as discussed with @giovannipizzi

@sphuber
Copy link
Contributor

sphuber commented Jul 7, 2023

Since this would only really be relevant for commands that already support the --config option and especially for those commands whose subcommands are generated dynamically based on entry points, I wonder if we should add this globally, or just for those commands. For example, I wonder if it is possible to add the --config option to verdi code create and you can pass the following YAML to it:

subcommand: core.code.installed
arguments:
  computer: localhost
  filepath_executable: pw.x
  default_calc_job_plugin: quantumespresso.pw
  ...

It would then be invoked with verdi code create --config config.yml and that group command would fetch the subcommand and invoke it with the provided arguments.

@chrisjsewell
Copy link
Member Author

yep that would be cool as well 👍 However, we can capture the full information about a code, profile, etc in the YAML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants