Skip to content

Conversation

sjpb
Copy link
Collaborator

@sjpb sjpb commented Sep 24, 2021

Most of the autoscaling setup can be done either before running runtime.yml, or using the openhpc_config variable to pass in additional slurm.conf parameters.

This PR adds an option extra_nodes to the group/partition definitions in openhpc_partitions to allow additional nodes definitions to be added into the slurm.conf node/partition definitions. As well as autoscaling/state=CLOUD nodes these could actually be used to add non-role-controlled normal nodes into a cluster using this role.

It also modifies the docs, as I realised they were a bit messy/confusing in places.

There are some subtleties which needed changes to the slurm.conf templating:

  • "matching" inventory groups "<cluster_name>_<group_name>" won't exist if a group/partition contains only extra_nodes nodes.
  • the NodeName=DEFAULT approach can't be used as we don't want cpu information to "fall through" to subsequent partitions which might not define all the current threads_per_core etc variables. I found existing code to group nodenames, so it uses that instead (renamed to avoid total confusion) to keep node definitions concise. As a bonus this will make the config MUCH shorter in the usual case of sequential nodenames, which will help slurmctld performance and startup time for large clusters.
  • given the above changes the opportunity was taken to make the templating of node definitions clearer - generally this templating has been really hard to follow so hopefully this helps.

sjpb added 30 commits September 8, 2021 13:12
@sjpb
Copy link
Collaborator Author

sjpb commented Oct 14, 2021

Note test13 for openhpc_config was not actually getting run, and verification for it needed fixing. Done in this PR as we also need openhpc_config for autoscaling.

@sjpb sjpb marked this pull request as ready for review October 14, 2021 11:53
@sjpb sjpb requested review from jovial and JohnGarbutt October 14, 2021 11:54
Copy link
Contributor

@jovial jovial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, change seems pretty reasonable. Templating in slurm.conf is pretty hairy, but then again it was before this change. Had a couple of little questions.

Copy link
Contributor

@jovial jovial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, change seems pretty reasonable. Just that niggle about openhpc_config really.

@sjpb
Copy link
Collaborator Author

sjpb commented Nov 11, 2021

centos:8.2.2004, test4 failed in CI but worked ok on local molecule. Rerunning ...

@sjpb
Copy link
Collaborator Author

sjpb commented Nov 11, 2021

Passed on 2nd attempt, ready for re-review @jovial.

Co-authored-by: jovial <will@stackhpc.com>
@sjpb
Copy link
Collaborator Author

sjpb commented Nov 11, 2021

Passed tests on 2nd attempt

@sjpb
Copy link
Collaborator Author

sjpb commented Nov 29, 2021

@jovial can you rereview please? Think this is ready to go.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like its backwards incompatible? Could we keep old and new easily enough?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is the filter name is massively confusing when used in the templating which also used group_hosts as a variable containing the list of hosts in that group. I can't see why backward compat is required as I can't see a use-case for another playbook using this filter.

register: slurm_config
- assert:
that: "item in slurm_config.stdout"
that: "item in slurm_config.stdout_lines | map('replace', ' ', '')"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding brackets here?, I am unclear on the ordering here, I think its:
"item in (slurm_config.stdout_lines | map('replace', ' ', ''))"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 505661e - testing...

# Need to specify IPs as even with State=DOWN, if slurmctld can't lookup a host it just excludes it from the config entirely
# Can't add to /etc/hosts via ansible due to Docker limitations on modifying /etc/hosts
- NodeName: fake-x,fake-y
NodeAddr: 0.42.42.0,0.42.42.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use internal IPs here? like 10.42.42.0?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also affect cloud nodes that do not exist?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnGarbutt does 9b04782 clarify why I'm using invalid IPs rather than internal ones?

It doesn't affect cloud nodes which don't exist as they will have been listed in the config as State=CLOUD, not State=DOWN. The former specifically means slurmctld knows it doesn't know how to contact them until they're "resumed".

@sjpb sjpb merged commit a0d6f53 into master Jan 20, 2022
@sjpb sjpb deleted the feature/autoscale branch January 20, 2022 15:27
@sjpb sjpb mentioned this pull request Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants