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

Simple scheduler #4

Merged
merged 10 commits into from
Jul 25, 2024
Merged

Conversation

adrianchiris
Copy link
Collaborator

@adrianchiris adrianchiris commented Jul 23, 2024

This PR (eventually) implements the scheduler controller with a simple scheduling logic that will be modified
as we progress with implementation.

please refer to individual commits for more information.
recommendation is to review commit by commit.

current state after this PR: one can deploy the operator, create NodeMaintenance objects which will transition from Uninitialized state to Pending and finally to Scheduled.

@coveralls
Copy link

coveralls commented Jul 23, 2024

Pull Request Test Coverage Report for Build 10092907433

Details

  • 309 of 369 (83.74%) changed or added relevant lines in 10 files are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+44.7%) to 48.286%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/k8sutils/k8sutils.go 34 36 94.44%
internal/scheduler/default_scheduler.go 39 41 95.12%
internal/controller/nodemaintenance_controller.go 26 31 83.87%
cmd/maintenance-manager/main.go 0 12 0.0%
internal/controller/nodemaintenancescheduler_controller.go 160 199 80.4%
Files with Coverage Reduction New Missed Lines %
internal/controller/maintenanceoperatorconfig_controller.go 6 0.0%
Totals Coverage Status
Change from base Build 10071979440: 44.7%
Covered Lines: 338
Relevant Lines: 700

💛 - Coveralls

Copy link
Collaborator

@ykulazhenkov ykulazhenkov left a comment

Choose a reason for hiding this comment

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

Great job! The PR looks good. I added few small comments

internal/scheduler/default_scheduler.go Outdated Show resolved Hide resolved
return 1
})

// compact entries pointing to the same Node
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I understood the logic correctly, in the compacted list we want to keep only one entry for a specific node (the entry which has more priority). Right? Can you add a bit more details to the comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes will add more context.

this logic will change as we progress with implementation to be more elaborate. however, i believe current logic can carry use quite well.

internal/controller/nodemaintenancescheduler_controller.go Outdated Show resolved Hide resolved
internal/scheduler/default_scheduler.go Show resolved Hide resolved
Implement basic controller that reconciles periodically
and does nothing ATM

Signed-off-by: adrianc <[email protected]>
- Update golangci yml file to not fail on autogenerated files
- Regenerate api to update license with NVIDIA
- remove kube-rbac-proxy from manager in kustomize configs

Signed-off-by: adrianc <[email protected]>
- add function to print canonical form of NodeMaintenance
  this will be later used in controller implementation.

Signed-off-by: adrianc <[email protected]>
- k8sutils contains utility functions related to k8s.
  ATM maintly to manipulate objects
- utils contains general utility functions
- testutils contains common function for tests
  which will be used in subsequent commits

Signed-off-by: adrianc <[email protected]>
- Implement basic logic to transition NodeMaintenance obj
to pending state
- Add basic controler test for the logic

This is the minimal set of changes to be able to kick in
the scheduler controller implemented in subsequent commit

Signed-off-by: adrianc <[email protected]>
- Scheduler interface definition
- default scheduler implementation
- tests

Signed-off-by: adrianc <[email protected]>
nodemaintenance scheduller controller reconciles
NodeMaintenance objects in Pending state, transitioning
their state to Scheduled according to reommendation returned
by the Scheduler.

Signed-off-by: adrianc <[email protected]>
Signed-off-by: adrianc <[email protected]>
@ykulazhenkov ykulazhenkov self-requested a review July 25, 2024 12:48
Copy link
Collaborator

@ykulazhenkov ykulazhenkov left a comment

Choose a reason for hiding this comment

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

Thx, for addressing my comments. LGTM

@ykulazhenkov ykulazhenkov merged commit 3705ff1 into Mellanox:main Jul 25, 2024
8 checks passed
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