Skip to content

Conversation

@jdeamicis
Copy link
Contributor

@jdeamicis jdeamicis commented Jun 16, 2023

Description of changes

  • Avoid duplication of nodes in ClusterManager._find_active_nodes() when nodes belong to multiple Slurm partitions.
  • This is relevant only in cases when the Slurm partition configuration is edited and PC-managed nodes are added to multiple custom partitions.
  • Small extention to the SlurmNode class constructor to allow specifying the slurm_nodes attribute at object creation.

Tests

  • Added unit test to verify that overlapping partitions do not lead to duplication of nodes in the group returned by
    ClusterManager._find_active_nodes().
  • Adapted existing tests to new logic.

References

Checklist

  • Make sure you are pointing to the right branch and add a label in the PR title (i.e. 2.x vs 3.x)
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

Please review the guidelines for contributing and Pull Request Instructions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jdeamicis jdeamicis added the 3.x label Jun 16, 2023
@jdeamicis jdeamicis requested review from a team as code owners June 16, 2023 22:00
@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Merging #538 (008f6d1) into develop (e200281) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop     #538   +/-   ##
========================================
  Coverage    87.88%   87.88%           
========================================
  Files           16       16           
  Lines         2427     2427           
========================================
  Hits          2133     2133           
  Misses         294      294           
Flag Coverage Δ
unittests 87.88% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/slurm_plugin/clustermgtd.py 92.48% <100.00%> (ø)

davprat
davprat previously approved these changes Jun 16, 2023
Copy link
Contributor

@davprat davprat left a comment

Choose a reason for hiding this comment

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

lgtm.

This is relevant only in cases when the Slurm partition configuration
is edited and PC-managed nodes are added to multiple custom partitions.

Add unit test to verify that overlapping partitions do not lead to
duplication of nodes in the group returned by
ClusterManager._find_active_nodes().

Adapt existing unit tests to the changes.

Signed-off-by: Jacopo De Amicis <jdamicis@amazon.it>
@jdeamicis jdeamicis force-pushed the fix/devel/fix_nodelists_multiple_partitions branch from be72632 to 63b3220 Compare June 19, 2023 08:16
This preserves the insertion order of nodes in the list of active nodes and
removed the need to sort nodelists manually to compare them in unit tests.

Signed-off-by: Jacopo De Amicis <jdamicis@amazon.it>
@jdeamicis jdeamicis force-pushed the fix/devel/fix_nodelists_multiple_partitions branch from 5953042 to 310a456 Compare June 19, 2023 14:29
This removed the need to extend the constructor of SlurmPartition to pass
the list of SlurmNode objects `slurm_nodes`, removing the risk of wrong
implementations in the future.

Include additional cases to test_find_active_nodes().

Signed-off-by: Jacopo De Amicis <jdamicis@amazon.it>
@jdeamicis jdeamicis force-pushed the fix/devel/fix_nodelists_multiple_partitions branch from c1cd661 to 008f6d1 Compare June 19, 2023 15:17
@jdeamicis jdeamicis merged commit ddf0e0c into aws:develop Jun 19, 2023
@jdeamicis jdeamicis deleted the fix/devel/fix_nodelists_multiple_partitions branch June 19, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants