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

✨ vGPU implementation #3025

Merged
merged 21 commits into from
Jul 10, 2024
Merged

Conversation

birksl
Copy link
Contributor

@birksl birksl commented May 24, 2024

Builds on the changes in #2272

What this PR does / why we need it:
Support adding vGPUs to VMs

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1972

Copy link

linux-foundation-easycla bot commented May 24, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 24, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @birksl!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-vsphere 🎉. 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/cluster-api-provider-vsphere 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
Copy link
Contributor

Hi @birksl. 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 k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 24, 2024
@birksl
Copy link
Contributor Author

birksl commented May 24, 2024

/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 24, 2024
Makefile Outdated Show resolved Hide resolved
docs/gpu-vgpu.md Outdated Show resolved Hide resolved
apis/v1beta1/types.go Outdated Show resolved Hide resolved
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 30, 2024
apis/v1beta1/types.go Outdated Show resolved Hide resolved
@chrischdi
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 May 31, 2024
@birksl
Copy link
Contributor Author

birksl commented May 31, 2024

/retest

internal/webhooks/vspheremachinetemplate.go Outdated Show resolved Hide resolved
pkg/services/govmomi/pci/device.go Outdated Show resolved Hide resolved
pkg/services/govmomi/pci/device.go Outdated Show resolved Hide resolved
internal/webhooks/vspheremachine_test.go Outdated Show resolved Hide resolved
internal/webhooks/vspheremachine.go Outdated Show resolved Hide resolved
docs/gpu-vgpu.md Outdated Show resolved Hide resolved
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

Sorry for the long round-trip between reviews.

Another round of nits then I think this is good!

cc @neolit123 maybe this is interesting for you.

@birksl
Copy link
Contributor Author

birksl commented Jun 20, 2024

Thanks for the guidance. I learnt a lot :)

apis/v1beta1/types.go Outdated Show resolved Hide resolved
apis/v1beta1/types.go Outdated Show resolved Hide resolved
docs/gpu-vgpu.md Outdated Show resolved Hide resolved
internal/webhooks/vspheremachine.go Outdated Show resolved Hide resolved
internal/webhooks/vspheremachine_test.go Show resolved Hide resolved
pkg/services/govmomi/vcenter/clone.go Outdated Show resolved Hide resolved
pkg/services/govmomi/pci/device.go Show resolved Hide resolved
@neolit123
Copy link
Member

don't forget to squash all commits before the final merge.

@birksl
Copy link
Contributor Author

birksl commented Jun 20, 2024

/retest

Copy link
Contributor

@lubronzhan lubronzhan left a comment

Choose a reason for hiding this comment

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

lgtm

@sbueringer sbueringer added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jun 21, 2024
@sbueringer
Copy link
Member

don't forget to squash all commits before the final merge.

Not needed. We can just use tide to squash (we improved our release notes tool a while ago, so it can handle squash commits now)

@neolit123
Copy link
Member

don't forget to squash all commits before the final merge.

Not needed. We can just use tide to squash (we improved our release notes tool a while ago, so it can handle squash commits now)

probably the blow scenario will never happen, but note that squash nukes gpg signatures, so some contributor might decide to create a problem.

@chrischdi
Copy link
Member

/lgtm

Thanks @neolit123 for also taking a look!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 21, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 431e3c4e236991e0ecf51615460596202a7aeb32

@sbueringer sbueringer added this to the v1.11 milestone Jul 10, 2024
@@ -251,13 +251,24 @@ type PCIDeviceSpec struct {
// DeviceID is the device ID of a virtual machine's PCI, in integer.
// Defaults to the eponymous property value in the template from which the
// virtual machine is cloned.
// Mutually exclusive with VGPUProfile as VGPUProfile and DeviceID + VendorID
// are two independent ways to define PCI devices.
// +kubebuilder:validation:Required
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// +kubebuilder:validation:Required
// +optional

Same for VendorID & VGPUProfile

(Note: this won't change the CRD YAML as "omitempty" already made the fields optional in the generated YAML)

Comment on lines +58 to +59
$ make dev-flavors
go run ./packaging/flavorgen --output-dir /home/user/.cluster-api/overrides/infrastructure-vsphere/v0.0.0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$ make dev-flavors
go run ./packaging/flavorgen --output-dir /home/user/.cluster-api/overrides/infrastructure-vsphere/v0.0.0
$ make release-flavors

We dropped the dev-flavors target in the meantime

go run ./packaging/flavorgen --output-dir /home/user/.cluster-api/overrides/infrastructure-vsphere/v0.0.0
```

Edit the generated Cluster template (`cluster-template.yaml`) to set the values for the `pciDevices` array. Here we are editing the VSphereMachineTemplate object for the worker nodes. This will create a worker node with a single NVIDIA 16GB vGPU device attached to the VM.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Edit the generated Cluster template (`cluster-template.yaml`) to set the values for the `pciDevices` array. Here we are editing the VSphereMachineTemplate object for the worker nodes. This will create a worker node with a single NVIDIA 16GB vGPU device attached to the VM.
Edit the generated Cluster template (e.g. `out/cluster-template.yaml`) to set the values for the `pciDevices` array. Here we are editing the VSphereMachineTemplate object for the worker nodes. This will create a worker node with a single NVIDIA 16GB vGPU device attached to the VM.

@sbueringer
Copy link
Member

sbueringer commented Jul 10, 2024

@birksl Thank you very much!

Sorry for the delay. I'll create a PR (#3101) to fix my findings. I don't want to delay merging this PR further.

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2024
@k8s-ci-robot k8s-ci-robot merged commit 9207847 into kubernetes-sigs:main Jul 10, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vGPU support
7 participants