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

[Feature] Add a Filter plugin to ensure that non-GPU pods are not sch… #788

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Zeel-Patel
Copy link

@Zeel-Patel Zeel-Patel commented Aug 1, 2024

…eduled on GPU nodes

This plugin is widely being used at Uber and thought can be useful for open source community.

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 1, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @Zeel-Patel!

It looks like this is your first PR to kubernetes-sigs/scheduler-plugins 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/scheduler-plugins has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 1, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @Zeel-Patel. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Zeel-Patel
Once this PR has been reviewed and has the lgtm label, please assign huang-wei for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 1, 2024
Copy link

netlify bot commented Aug 1, 2024

Deploy Preview for kubernetes-sigs-scheduler-plugins canceled.

Name Link
🔨 Latest commit e90d648
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-scheduler-plugins/deploys/66ab75bc3df1320008b23a0b

Comment on lines +21 to +25
//devicePluginContainerImage is the nvidia provided kubernetes device plugin image.
devicePluginContainerImage = "nvcr.io/nvidia/k8s-device-plugin"

// ResourceNvidiaGPU is nvidia GPU resource
ResourceNvidiaGPU = "nvidia.com/gpu"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should move both of those values so they can be changed via configuration file. Some clusters may also have more than one gpu resource on the node, so it would be great if we could provide a list of gpu resources.

Copy link
Member

Choose a reason for hiding this comment

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

+1, Using configuration files is better than hard-coding. Maybe we don't need to limit ourselves to GPU resources, can we extend it to different resources?

@PiotrProkop
Copy link
Contributor

Overall I think this could be a generic plugin that filters out pod not requesting some specific resource from nodes advertising those resources with except for device-plugin of dra-plugin(in the future).

@googs1025
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 1, 2024
@k8s-ci-robot
Copy link
Contributor

@Zeel-Patel: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-scheduler-plugins-verify e90d648 link true /test pull-scheduler-plugins-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@@ -0,0 +1,129 @@
package gpumanagementfilter
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a KEP document?

Copy link
Author

Choose a reason for hiding this comment

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

Sure, let me write a KEP doc first

@googs1025
Copy link
Member

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 1, 2024
@Zeel-Patel
Copy link
Author

Overall I think this could be a generic plugin that filters out pod not requesting some specific resource from nodes advertising those resources with except for device-plugin of dra-plugin(in the future).

@PiotrProkop sure, can you provide more info on what you mean by
except fordevice-pluginofdra-plugin(in the future).

@PiotrProkop
Copy link
Contributor

Overall I think this could be a generic plugin that filters out pod not requesting some specific resource from nodes advertising those resources with except for device-plugin of dra-plugin(in the future).

@PiotrProkop sure, can you provide more info on what you mean by except fordevice-pluginofdra-plugin(in the future).

Same idea what this func does:

func containsNvidiaDevicePluginImage(containerList []v1.Container) bool {
	for _, containerItem := range containerList {
		if strings.Contains(containerItem.Image, devicePluginContainerImage) {
			return true
		}
	}
	return false
}

make this filter plugin not fail device-plugins that provides given resource for other pods :)

@ffromani
Copy link
Contributor

ffromani commented Aug 6, 2024

/cc

+1 for having a design document/KEP
I'm interested in this topic

@ffromani
Copy link
Contributor

ffromani commented Aug 6, 2024

Overall I think this could be a generic plugin that filters out pod not requesting some specific resource from nodes advertising those resources with except for device-plugin of dra-plugin(in the future).

strong agree. It seems there is a easy (and safe?) generalization path for this filter plugin. We can have allowlist/denylist in the plugin.
But I wonder if the same functionality can be achieved using existing scheduling tools. On top of my head: taints/tolerations? What extra value a filter plugin will bring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants