stackhpc / ansible-role-openhpc

Ansible role for OpenHPC
Apache License 2.0
45 stars 15 forks source link

Fix login-only nodes in configless mode #83

Closed sjpb closed 3 years ago

sjpb commented 3 years ago

In configless mode compute nodes have an environment var set to tell slurmd what the the slurmctld host is. Login-only nodes don't have this so slurm commands can't work.

There are three possible approaches (docs):

  1. Use DNS SRV records to provide the slurmctld host name - not under control of this role, so can rule that out.
  2. Template the config onto the login nodes - could do that, but then login images aren't "fixed" and have multiple possible sources-of-truth for cluster config when resizing etc, so don't like that.
  3. Run slurmd on the login nodes - this is the docs suggestion when 1) isn't possible.

This PR implements 3). I don't particularly like the implementation but here's why it is the best I could come up with:

  1. The current "runtime"-node package list (in e.g. vars/ohpc-2) already includes packages for slurmd.
  2. We need ohpc_slurm_services = slurmd so that slurmd gets configured. This could be done simply by setting openhpc_enable.batch=True.
  3. The slurm.conf needs a NodeName entry for each login-only node. Entries don't need any other information and don't need to be included in any partition.
  4. Due to the openhpc_slurm_partitions design its very hard to extract the set of batch nodes which aren't listed in any partition. (This set is the login-only nodes). Therefore a new openhpc_enable.login flag is added to explicitly identify such nodes, rather than setting .batch = True.
  5. As openhpc_enable is a role var it doesn't end up in hostvars so there's no way to find the .login nodes from within the templating. Hence, runtime.yml has to set a fact openhpc_login_only to get this info into hostvars (I considered calling this openhpc_enable_login but thought the similarity to openhpc_enable.login would actually be confusing not helpful).