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

WIP: TPU Provisioner: Node pool hash comparison #967

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nstogner
Copy link
Collaborator

@nstogner nstogner commented Feb 6, 2025

Issue:

Today the provisioner just checks if a node pool with the expected name exists for a given workload. If the workload is quickly recreated with a different node selector it is possible that the provisioner will not delete the old node pool in time and it will not think it needs to create a new one since the old one exists.

Fix:

This PR introduces new logic into the provisioner to check that the existing node pool matches the desired node pool via a hash comparison. Hash is calculated at node pool creation time and stored as a node pool label for later comparison.

func nodePoolSelectiveHash(np *containerv1beta1.NodePool) (string, error) {
h := fnv.New32a()
npToHash := &containerv1beta1.NodePool{
Config: &containerv1beta1.NodeConfig{
Copy link
Contributor

@SidneyShen SidneyShen Feb 11, 2025

Choose a reason for hiding this comment

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

Didn't include ReservationAffinity: reservation, that means there will be no case of flipping between reservation and on-demand (at least in the near term), which are treated as same tier today.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch

@nstogner nstogner force-pushed the tpu-provisioner-add-nodepool-match-check branch from 06681b9 to ddff710 Compare February 21, 2025 21:55
@nstogner nstogner requested a review from echiugoog as a code owner February 21, 2025 21:55
@nstogner nstogner force-pushed the tpu-provisioner-add-nodepool-match-check branch from ddff710 to 64973ac Compare February 21, 2025 21:58
@nstogner
Copy link
Collaborator Author

Updated to include an interface for interacting with GKE NodePool API in order to add some tests.

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.

2 participants