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

Provide cli for modifying existing profiles #4243

Open
ltalirz opened this issue Jul 10, 2020 · 2 comments
Open

Provide cli for modifying existing profiles #4243

ltalirz opened this issue Jul 10, 2020 · 2 comments

Comments

@ltalirz
Copy link
Member

ltalirz commented Jul 10, 2020

Both verdi setup and verdi quicksetup are currently limited to creating new profiles.

There is no interface for modifying the settings of an existing profile (other than editing the config.json file directly, but such an interface has been requested at least twice during the 2020 July tutorial.

I think we should consider introducing such an API, with a clear statement on the scope: it only changes the setting and does nothing to "migrate" the profile data behind.
I.e. it is almost the same as editing the config.json file by hand, except it may do some additional validation on inputs (e.g. does the path to the new file repo exist, ...).

Copying the list of settings from the verdi setup help for context:

  --profile PROFILE               The name of the new profile.  [required]
  --email EMAIL                   Email address associated with the data you
                                  generate. The email address is exported
                                  along with the data, when sharing it.
                                  [required]

  --first-name NONEMPTYSTRING     First name of the user.  [required]
  --last-name NONEMPTYSTRING      Last name of the user.  [required]
  --institution NONEMPTYSTRING    Institution of the user.  [required]
  --db-engine [postgresql_psycopg2]
                                  Engine to use to connect to the database.
  --db-backend [django|sqlalchemy]
                                  Database backend to use.
  --db-host HOSTNAME              Database server host. Leave empty for "peer"
                                  authentication.

  --db-port INTEGER               Database server port.
  --db-name NONEMPTYSTRING        Name of the database to create.  [required]
  --db-username NONEMPTYSTRING    Name of the database user to create.
                                  [required]

  --db-password TEXT              Password of the database user.  [required]
  --repository DIRECTORY          Absolute path to the file repository.

pinging @sphuber @giovannipizzi

P.S. A viable alternative to this may be the switch to the yaml format for the configuration file, making it easier to edit by hand and suggesting to do so in the documentation.

@ltalirz ltalirz added the type/feature request status undecided label Jul 10, 2020
@sphuber
Copy link
Contributor

sphuber commented Jul 10, 2020

I see the point of the feature, but I think the behavior you propose is actually dangerous and counter productive. If users want to change something, they most likely want everything to work as expected afterwards. If this is not guaranteed, but all the command does is just update the config.json, why do we need a command for this? If users are anyway expected to understand the inner workings of AiiDA to make these kinds of changes work, why not just let them manually update the config file? Its location is not hidden after all, it is shown in multiple places.

@ltalirz
Copy link
Member Author

ltalirz commented Jul 10, 2020

I did mention editing the configuration file as an alternative, in particular after we've switched to the yaml format which then allows to add comments etc.
I think this is a viable alternative - it just means there will be no validation of inputs, which can be a downside compared to having a dedicated API.

Whatever we decide, I do think we will need a (little) bit of documentation on how to do this.

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

3 participants