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

Revert "Add checks of dedicatedCPUPlacement to validation webhook" #9169

Conversation

lyarwood
Copy link
Member

@lyarwood lyarwood commented Feb 3, 2023

/area instancetype
/cc @opokornyy
/cc @davidvossel

What this PR does / why we need it:

This reverts commit 48a2ade.

Thanks to e7898af [1][2] we now apply defaults to a copy of the VirtualMachineInstanceSpec before running the associated validations in the VirtualMachine validation webhook. This actually resolves the original issue with enabling dedicatedCPUPlacement from instance types [3] as it ensures any guest visible memory is expressed as resources requests before we attempt to validate.

As such we can drop the blocking validations from the instance type webhooks and allow dedicatedCPUPlacement to be set once again.

[1] #9103
[2] #9102
[3] #8867

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 #

Special notes for your reviewer:

With this commit reverted in a test environment the following examples work once again:

$ ./cluster-up/kubectl.sh apply -f - << EOF
apiVersion: instancetype.kubevirt.io/v1alpha2
kind: VirtualMachineClusterInstancetype
metadata:
 name: dedicatedcpuplacement
spec:
 cpu:
  dedicatedCPUPlacement: true
  guest: 1
 memory: 
  guest: 128Mi
EOF
selecting docker as container runtime
virtualmachineclusterinstancetype.instancetype.kubevirt.io/dedicatedcpuplacement created
$ ./cluster-up/kubectl.sh apply -f - << EOF
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  labels:
    kubevirt.io/vm: vm-cirros
  name: vm-cirros
spec:
  instancetype:
    name: dedicatedcpuplacement
  running: true
  template:
    spec:
      domain:
        devices: {}
      terminationGracePeriodSeconds: 0
      volumes:
      - containerDisk:
          image: registry:5000/kubevirt/cirros-container-disk-demo:devel
        name: containerdisk
EOF
selecting docker as container runtime
virtualmachine.kubevirt.io/vm-cirros configured

Release note:

The `dedicatedCPUPlacement` attribute is once again supported within the `VirtualMachineInstancetype` and `VirtualMachineClusterInstancetype` CRDs after a recent bugfix improved `VirtualMachine` validations, ensuring defaults are applied before any attempt to validate.

This reverts commit 48a2ade.

Thanks to e7898af [1][2] we now apply
defaults to a copy of the VirtualMachineInstanceSpec before running the
associated validations in the VirtualMachine validation webhook. This
actually resolves the original issue with enabling dedicatedCPUPlacement
from instance types [3] as it ensures any guest visible memory is
expressed as resources requests before we attempt to validate.

As such we can drop the blocking validations from the instance type
webhooks and allow `dedicatedCPUPlacement` to be set once again.

[1] kubevirt#9103
[2] kubevirt#9102
[3] kubevirt#8867

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
@kubevirt-bot kubevirt-bot added area/instancetype release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/L labels Feb 3, 2023
lyarwood added a commit to lyarwood/common-instancetypes that referenced this pull request Feb 3, 2023
WIP until kubevirt/kubevirt#9169 lands allowing
functest to pass again.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

/lgtm

@0xFelix
Copy link
Member

0xFelix commented Feb 8, 2023

/retest

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2023
@lyarwood
Copy link
Member Author

lyarwood commented Feb 9, 2023

/cherry-pick release-0.59

@kubevirt-bot
Copy link
Contributor

@lyarwood: once the present PR merges, I will cherry-pick it on top of release-0.59 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.59

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/test-infra repository.

Copy link
Member

@davidvossel davidvossel left a comment

Choose a reason for hiding this comment

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

in general this makes sense. Can we get some test coverage of dedicated cpu placement with instance types now? That feature is complex enough that I'd like to ensure it is both working and continues to work as expected with instance types moving forward

Following on from the revert of 48a2ade
this change introduces a simple functional test to assert that an
instance type providing dedicatedCPUPlacement is accepted *and* the use
of said instance type results in a valid VirtualMachine and running
VirtualMachineInstance.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 9, 2023
@lyarwood
Copy link
Member Author

lyarwood commented Feb 9, 2023

in general this makes sense. Can we get some test coverage of dedicated cpu placement with instance types now? That feature is complex enough that I'd like to ensure it is both working and continues to work as expected with instance types moving forward

ACK added in the commit below, thanks @davidvossel !

fa66a7a

@lyarwood
Copy link
Member Author

/retest-required

https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_kubevirt/9169/pull-kubevirt-e2e-k8s-1.25-sig-compute/1623751431183929344

Tests Suite: [crit:medium][vendor:cnv-qe@redhat.com][level:component][sig-compute] Instancetype and Preferences instance type with dedicatedCPUPlacement enabled should be accepted and result in running VirtualMachineInstance | 26s
-- | --

Looks like that is passing in the compute lanes FWIW.

@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Feb 10, 2023

@lyarwood: 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-kubevirt-fossa fa66a7a link false /test pull-kubevirt-fossa

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/test-infra repository. I understand the commands that are listed here.

Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2023
@lyarwood
Copy link
Member Author

/retest-required

Copy link
Member

@davidvossel davidvossel left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidvossel

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2023
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot
Copy link
Contributor

@lyarwood: new pull request created: #9234

In response to this:

/cherry-pick release-0.59

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/test-infra repository.

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. area/instancetype dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants