aiida-core icon indicating copy to clipboard operation
aiida-core copied to clipboard

Simplify the interface of `verdi computer setup`

Open sphuber opened this issue 3 years ago • 9 comments

The setup of a Computer through verdi computer setup can be a bit overwhelming as it asks to fill out all the attributes that it can store. The same goes for verdi computer configure. For most usecases, options like the Kerberos settings are not really needed. Would it be possible to simplify the interface such that the interactive command by default only shows a subset of required fields, such as the username, hostname etc. and omit the more advanced features. The latter should of course still be changeable some other way for users that need it. This might make the setting up of computers and codes less daunting perhaps. This followed from a discussion with @louisponet

sphuber avatar Jun 10 '21 11:06 sphuber

I agree that setting up the computers and codes is often a hurdle for beginning users and it would be great if it could be simplified. Two first points to discuss here are:

  1. If we have sensible defaults for some of the setup/configure inputs, when should these be set automatically? Now this is only done in case the --non-interactive option is specified, but beginning users are often unaware of this possibility. Should this only be documented better, or should we adapt how the interactive command works? I.e. if a user only runs verdi computer setup or verdi computer configure core.ssh, should we not request inputs for some settings? Should the behaviour be different when the user already provides some settings, either through CLI options or a YAML file and the --config option?
  2. For each of the commands, which inputs are "required", "optional, should be requested" (because the defaults are often incorrect) and "optional, should not be requested" (because the defaults are mostly correct). I've quickly sorted the inputs for the verdi computer setup and verdi computer configure core.ssh commands among these three options below based on my experience, but this can of course still be up for discussion.

verdi computer setup

Required

  -L, --label LABEL               Unique, human-readable label for this
                                  computer.  [required]
  -H, --hostname HOSTNAME         The fully qualified hostname of the computer
                                  (e.g. daint.cscs.ch). Use "localhost" when
                                  setting up the computer that AiiDA is
                                  running on.  [required]
  -T, --transport PLUGIN          A transport plugin (as listed in `verdi
                                  plugin list aiida.transports`).  [required]
  -S, --scheduler PLUGIN          A scheduler plugin (as listed in `verdi
                                  plugin list aiida.schedulers`).  [required]

Optional, should be requested

  -w, --work-dir TEXT             The absolute path of the directory on the
                                  computer where AiiDA will run the
                                  calculations (often a "scratch"
                                  directory).The {username} string will be
                                  replaced by your username on the remote
                                  computer.
  -m, --mpirun-command MPIRUNCOMMANDSTRING
                                  The mpirun command needed on the cluster to
                                  run parallel MPI programs. The
                                  {tot_num_mpiprocs} string will be replaced
                                  by the total number of cpus. See the
                                  scheduler docs for further scheduler-
                                  dependent template variables.
  --prepend-text TEXT             Bash commands that should be prepended to
                                  the executable call in all submit scripts
                                  for this computer.
  --append-text TEXT              Bash commands that should be appended to the
                                  executable call in all submit scripts for
                                  this computer.

Optional, should not be requested

  -D, --description DESCRIPTION   A human-readable description of this
                                  computer.
  --shebang SHEBANGLINE           Specify the first line of the submission
                                  script for this computer (only the bash
                                  shell is supported).
  --mpiprocs-per-machine INTEGER  The default number of MPI processes that
                                  should be executed per machine (node), if
                                  not otherwise specified.Use 0 to specify no
                                  default value.
  --default-memory-per-machine INTEGER
                                  The default amount of RAM (kB) that should
                                  be allocated per machine (node), if not
                                  otherwise specified.
  --use-double-quotes / --not-use-double-quotes
                                  Whether the command line arguments before
                                  and after the executable in the submission
                                  script should be escaped with single or
                                  double quotes.

verdi computer configure core.ssh

Required

  --username TEXT                 Login user name on the remote machine.

Optional, should be requested

  --key-filename FILE             Absolute path to your private SSH key. Leave
                                  empty to use the path set in the SSH config.

Optional, should not be requested

  -u, --user USER                 Email address of the user.
  -P, --port INTEGER              Port number.
  --look-for-keys / --no-look-for-keys
                                  Automatically look for private keys in the
                                  ~/.ssh folder.
  --timeout INTEGER               Time in seconds to wait for connection
                                  before giving up. Leave empty to use default
                                  value.
  --allow-agent / --no-allow-agent
                                  Switch to allow or disallow using an SSH
                                  agent.
  --proxy-jump TEXT               SSH proxy jump for tunneling through other
                                  SSH hosts. Use a comma-separated list of
                                  hosts of the form [user@]host[:port]. If
                                  user or port are not specified for a host,
                                  the user & port values from the target host
                                  are used. This option must be provided
                                  explicitly and is not parsed from the SSH
                                  config file when left empty.
  --proxy-command TEXT            SSH proxy command for tunneling through a
                                  proxy server. For tunneling through another
                                  SSH host, consider using the "SSH proxy
                                  jump" option instead! Leave empty to parse
                                  the proxy command from the SSH config file.
  --compress / --no-compress      Turn file transfer compression on or off.
  --load-system-host-keys / --no-load-system-host-keys
                                  Load system host keys from default SSH
                                  location.
  --gss-auth BOOLEAN              Enable when using GSS kerberos token to
                                  connect.
  --gss-kex BOOLEAN               GSS kex for kerberos, if not configured in
                                  SSH config file.
  --gss-deleg-creds BOOLEAN       GSS deleg_creds for kerberos, if not
                                  configured in SSH config file.
  --gss-host TEXT                 GSS host for kerberos, if not configured in
                                  SSH config file.
  --key-policy [RejectPolicy|WarningPolicy|AutoAddPolicy]
                                  SSH key policy if host is not known.
  --use-login-shell / --no-use-login-shell
                                  Not using a login shell can help suppress
                                  potential spurious text output that can
                                  prevent AiiDA from parsing the output of
                                  commands, but may result in some startup
                                  files (.profile) not being sourced.
  --safe-interval FLOAT           Minimum time interval in seconds between
                                  opening new connections.

mbercx avatar Jan 25 '23 09:01 mbercx