Open agoscinski opened 1 month ago
The inconsistency is essentially due to us having to keep backwards-compatibility. Historically the commands were as follows:
verdi setup # Setup a profile (Storage was not pluginnable, so was hard-coded to `core.psql_dos`)
verdi quicksetup # Called through to `verdi setup` after auto-creating PSQL user+database
verdi computer setup
verdi code setup
When we recently made storage backends pluginnable, we needed a new command to set up a profile with any of the storage plugins. This became verdi profile setup
. So now verdi setup
has been replaced by veri profile setup core.psql_dos
and verdi setup
should be deprecated.
The idea is to add the functionality of verdi quicksetup
of automatically creating PSQL user+database to verdi presto
that can be enabled with a flag. Once implemented, verdi quicksetup
should be deprecated as well.
The user then has
verdi profile setup # Setup profile with any storage plugin
verdi presto # Full automatic setup of `core.sqlite_dos` or `core.psql_dos` profile with/without RMQ
Originally, there was 1 code class, Code
, but this was essentially working as two different types, called a "remote" and "local" code. Here "remote" meant a code that was simply an executable available on the target Computer
and "local" meant you have a folder with the code on the local file system that contained the binary (and optionally other supporting files). Besides the names remote/local being notoriously confusing, having a single class/command deal with two different types was difficult to maintain and extend.
The Code
class was deprecated and refactored into InstalledCode
and PortableCode
to replace the "remote" and "local" versions, respectively. Later the ContainerizedCode
was added. These needed a command to setup these codes. Since verdi code setup
was taken and could not be changed in order to not break backwards compatibility, the new command was named verdi code create
. The verdi code setup
command is deprecated.
There is not too much history here. I agree that verdi user configure
to both create new and update existing users is very unintuitive. I would personally rename this to
verdi user create
verdi user update
These are the typical verbs used in CRUD (create,read,update,delete) applications. The word "configure" is a bit uncommon.
I mostly like your suggestion for the command names but would make a few changes. Overall I think using create
as the main verb over setup
makes sense thinking of CRUD apps:
verdi group create # create new group
verdi profile create # This is fine but would have to deprecate `verdi profile setup` that was just added
verdi user create # create new user
verdi user update # update existing users
verdi code create # create new code (dynamic based on code plugin)
verdi computer create # create new computer
verdi computer configure # create new auth info (dynamic based on transport plugin
So essentially I would just change the user commands.
If we were to accept this proposal, we would just have to deprecate verdi computer setup
, verdi profile setup
and verdi user configure
. The latter is not a problem, but the former two are more impactful. Especially verdi computer setup is used a lot. And
verdi profile setupwas added only just the last release, so it feels a bit silly to deprecate already. But then again, when we argue that this will make the entire CLI more consistent and easy to use, it could be justified. Moreover, none of this would actually be breaking as we can deprecate the old commands. The change of
verdi user configure` would not be bad at all as it is used very little by users I suspect.
This arises from the discussion in issue https://github.com/aiidateam/aiida-core/issues/4981 since this covers more than just the
verdi computer setup
command I made a separate issue to it.Motivation
To make new instances of objects, set parameters, update parameters the verdi commands
verdi [profile|user|code|computer|group]
use different command names which is very confusing for new users (at least for me). I can see some reasons for the different naming, but there so strong inconsistencies that result in a bad user experience.Current work in progress
With the changes in PR https://github.com/aiidateam/aiida-core/pull/6198 we can merge
verdi computer setup
andconfigure
to one command ashttps://github.com/aiidateam/aiida-core/issues/4981#issuecomment-2136995240
So with these changes the state would be (correct me if I am wrong)
Further suggestions
Since users still want to change computer parameters (see discussion https://github.com/aiidateam/team-compass/issues/12), there would be still some command that allows updating the parameters of the computer
This would clash with the
verdi user configure
that is used for the creation and an update of the parameters, so maybe we also split upverdi user configure
intoverdi user create
andverdi user configure
Furthermore, there isverdi code setup
that seems redundant to me toverdi code create
In addition, if we go with the naming ofcreate
thenverdi profile setup
would be renamed toverdi profile create
.So the final suggestion would be