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

[LoginNodes] Update API to support multiple login node pools #6395

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

cjmakin
Copy link
Contributor

@cjmakin cjmakin commented Aug 14, 2024

Description of changes

This change modifies the server and client API models and controllers to return list of pool statuses in the loginNodes section of describe-cluster. The login node pool name was also added to each pool status.

In addition, this change adds the pool name to describe-cluster-instances output.

  • Updated smithy models to generate python server models.
  • Copied changes from generated models to /cli/src/pcluster/api/models.
  • Updated client models
  • Updated cluster_operations_controller so that the login_nodes field of describe-cluster response contains a list of PoolStatus.
  • Updated cluster_instances_controller to include login node pool name.
  • Added pool_name property to InstanceInfo in aws_resources.

Example describe-cluster:

  "clusterName": "mult-pools-1",
    .
    .
    .
  "clusterStatus": "CREATE_COMPLETE",
  "scheduler": {
    "type": "slurm"
  },
  "loginNodes": [
    {
      "status": "active",
      "poolName": "pool1",
      "address": "mult-p-multp-eMr9BYRKZVDa-e5bb34f40b24f51d.elb.us-east-2.amazonaws.com",
      "scheme": "internet-facing",
      "healthyNodes": 1,
      "unhealthyNodes": 0
    },
    {
      "status": "active",
      "poolName": "pool2",
      "address": "mult-p-multp-PaQ7GgC27sic-aba10c890247b36b.elb.us-east-2.amazonaws.com",
      "scheme": "internet-facing",
      "healthyNodes": 1,
      "unhealthyNodes": 0
    }
  ]
}

Example describe-cluster-instances:

"instances": [
    {
      "launchTime": "2024-08-13T13:17:28.000Z",
      "instanceId": "i-0df02e911cc19b534",
      "poolName": "pool1",
      "publicIpAddress": "3.148.106.168",
      "instanceType": "t2.small",
      "state": "running",
      "nodeType": "LoginNode",
      "privateIpAddress": "10.0.0.196"
    },
]

Tests

  • Manually tested modified commands
  • Updated test_cluster_operations_controller.py unit test
  • Updated and ran test_cli_commands integration test

References

  • Link to impacted open issues.
  • Link to related PRs in other packages (i.e. cookbook, node).
  • Link to documentation useful to understand the changes.

Checklist

  • Make sure you are pointing to the right branch.
  • If you're creating a patch for a branch other than develop add the branch name as prefix in the PR title (e.g. [release-3.6]).
  • 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.

@cjmakin cjmakin requested a review from hgreebe August 14, 2024 22:02
@cjmakin cjmakin requested review from a team as code owners August 14, 2024 22:02
@cjmakin cjmakin changed the title [LoginNodes] Update API server models to support multiple pools [LoginNodes] Update API models to support multiple pools Aug 15, 2024
@cjmakin cjmakin changed the title [LoginNodes] Update API models to support multiple pools [LoginNodes] Update API to support multiple login node pools Aug 15, 2024
mocker.patch(
"pcluster.models.login_nodes_status.LoginNodesStatus.get_login_nodes_pool_available",
return_value=login_nodes_pool_available,
)
mocker.patch("pcluster.models.login_nodes_status.PoolStatus.get_status", return_value=status)
if scheme:
Copy link
Contributor

Choose a reason for hiding this comment

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

How come we are not doing these checks anymore?

Copy link
Contributor Author

@cjmakin cjmakin Aug 15, 2024

Choose a reason for hiding this comment

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

I moved this portion to this function, and changed it to mock the function return values of specific objects. That way we can test different values for pool1 and pool2 in the response content

@cjmakin cjmakin added the skip-changelog-update Disables the check that enforces changelog updates in PRs label Aug 16, 2024
@cjmakin cjmakin merged commit 8641f35 into aws:develop Aug 16, 2024
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog-update Disables the check that enforces changelog updates in PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants