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

Expand the mediatedDevicesConfiguration API #1688

Merged
merged 1 commit into from
Jan 12, 2022

Conversation

vladikr
Copy link
Member

@vladikr vladikr commented Jan 6, 2022

This PR is a follow up to KubeVirt's kubevirt/kubevirt#6345

This will allow expanding the existing mediatedDevicesConfiguration API to override the mediated devices configuration for a specific node.
Node-specific configuration will be applied in case all NodeSelectors match the node.

Example of the expanded API:

spec:
  configuration:
    mediatedDevicesConfiguration:
      mediatedDevicesTypes:
        - nvidia-222
        - nvidia-228
        - i915-GVTg_V5_4
      nodeMediatedDeviceTypes:
      - nodeSelector:
        someLabel1: ""
        mediatedDevicesTypes:
        - nvidia-222
      - nodeSelector:
        kubernetes.io/hostname=nodeName
        mediatedDevicesTypes:
        - nvidia-228

Release note:
-->

It is now possible to provide a node-specific configuration of the mediated devices types

@kubevirt-bot kubevirt-bot added 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. labels Jan 6, 2022
@vladikr
Copy link
Member Author

vladikr commented Jan 6, 2022

@nunnatsa @tiraboschi how can i update the KubeVirt API types?

@nunnatsa
Copy link
Collaborator

nunnatsa commented Jan 6, 2022

@vladikr - this is done in #1684

@vladikr
Copy link
Member Author

vladikr commented Jan 6, 2022

@vladikr - this is done in #1684

@nunnatsa oh, I see, thanks! I'll wait until this is in. :)

@vladikr vladikr force-pushed the mdev_auto_conf_ext branch 2 times, most recently from 7b64fda to a96623b Compare January 7, 2022 16:55
@coveralls
Copy link
Collaborator

coveralls commented Jan 7, 2022

Pull Request Test Coverage Report for Build 1686678022

  • 15 of 181 (8.29%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-2.05%) to 68.559%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/apis/hco/v1beta1/zz_generated.deepcopy.go 2 52 3.85%
pkg/apis/hco/v1beta1/zz_generated.openapi.go 0 116 0.0%
Totals Coverage Status
Change from base Build 1686631433: -2.05%
Covered Lines: 3731
Relevant Lines: 5442

💛 - Coveralls

}
}

func toKvNodeMediatedDevicesConfiguration(hcoNodeMdevTypesConf []hcov1beta1.NodeMediatedDeviceTypesConfig) []kubevirtcorev1.NodeMediatedDeviceTypesConfig {
if len(hcoNodeMdevTypesConf) > 0 {
nodeMdevTypesConf := make([]kubevirtcorev1.NodeMediatedDeviceTypesConfig, 0, len(hcoNodeMdevTypesConf))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we know the final length of the slice, we can maybe make it woth the known size and set the converted values with using the original index instead of using append?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, it's only 2 elements.. what's wrong with append? it's pretty valid in go.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a legit golang code. But I think that append is mostly for dynamic size slices, and in cases like this, I prefer direct assignment by the slice index. But that me and I won't block the PR for that (-:

Copy link
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Can you also run deepcopy and openapi gen? If not, I can help with it.

@vladikr
Copy link
Member Author

vladikr commented Jan 7, 2022

Thanks for the PR. Can you also run deepcopy and openapi gen? If not, I can help with it.

I'm happy to do it, I just don't know how... maybe you can point me to what should I run?

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 7, 2022

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-gcp

In response to this:

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 9, 2022

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-gcp

In response to this:

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp

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.

@vladikr
Copy link
Member Author

vladikr commented Jan 10, 2022

/retest

@vladikr
Copy link
Member Author

vladikr commented Jan 11, 2022

@nunnatsa I'm not sure why some of the e2e-image tests are failing. Could you please point me to what should I look at to debug this?

@nunnatsa
Copy link
Collaborator

/rebase

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 12, 2022

hco-e2e-upgrade-prev-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws
okd-hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-index-gcp
hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-image-index-gcp, ci/prow/hco-e2e-upgrade-prev-index-sno-aws, ci/prow/okd-hco-e2e-upgrade-index-gcp

In response to this:

hco-e2e-upgrade-prev-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws
okd-hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-index-gcp
hco-e2e-image-index-azure, hco-e2e-image-index-aws lanes succeeded.
/override ci/prow/hco-e2e-image-index-gcp

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.

…ration.

Signed-off-by: Vladik Romanovsky <vromanso@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Jan 12, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@nunnatsa
Copy link
Collaborator

/retest

1 similar comment
@nunnatsa
Copy link
Collaborator

/retest

@nunnatsa
Copy link
Collaborator

/test hco-e2e-image-index-azure

@kubevirt-bot
Copy link
Contributor

@nunnatsa: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test build-hco-test-utils-image
  • /test pull-hyperconverged-cluster-operator-e2e-k8s-1.21

Use /test all to run the following jobs that were automatically triggered:

  • pull-hyperconverged-cluster-operator-e2e-k8s-1.21

In response to this:

/test hco-e2e-image-index-azure

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.

@nunnatsa
Copy link
Collaborator

/override-bot

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 12, 2022

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp
hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-azure
hco-e2e-upgrade-prev-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-gcp, ci/prow/hco-e2e-upgrade-index-azure, ci/prow/hco-e2e-upgrade-prev-index-sno-aws

In response to this:

hco-e2e-kv-smoke-azure lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-gcp
hco-e2e-upgrade-index-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-azure
hco-e2e-upgrade-prev-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws

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.

@hco-bot
Copy link
Collaborator

hco-bot commented Jan 12, 2022

okd-hco-e2e-upgrade-index-gcp lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/okd-hco-e2e-upgrade-index-aws

In response to this:

okd-hco-e2e-upgrade-index-gcp lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-index-aws

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.

@openshift-ci
Copy link

openshift-ci bot commented Jan 12, 2022

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

Test name Commit Details Required Rerun command
ci/prow/hco-e2e-image-index-gcp 1fe35ce link true /test hco-e2e-image-index-gcp
ci/prow/hco-e2e-kv-smoke-gcp 1fe35ce link true /test hco-e2e-kv-smoke-gcp
ci/prow/okd-hco-e2e-upgrade-index-aws 1fe35ce link true /test okd-hco-e2e-upgrade-index-aws
ci/prow/hco-e2e-upgrade-prev-index-sno-aws 1fe35ce link false /test hco-e2e-upgrade-prev-index-sno-aws
ci/prow/hco-e2e-image-index-sno-aws 1fe35ce link false /test hco-e2e-image-index-sno-aws
ci/prow/hco-e2e-image-index-azure 1fe35ce link true /test hco-e2e-image-index-azure

Full PR test history. Your PR dashboard.

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.

@nunnatsa
Copy link
Collaborator

/override-bot

@nunnatsa
Copy link
Collaborator

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-azure
/override ci/prow/hco-e2e-image-index-gcp

@kubevirt-bot
Copy link
Contributor

@nunnatsa: Overrode contexts on behalf of nunnatsa: ci/prow/hco-e2e-image-index-azure, ci/prow/hco-e2e-image-index-gcp

In response to this:

hco-e2e-image-index-aws lane succeeded.
/override ci/prow/hco-e2e-image-index-azure
/override ci/prow/hco-e2e-image-index-gcp

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.

@nunnatsa
Copy link
Collaborator

hco-e2e-image-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-aws

hco-e2e-upgrade-prev-index-sno-azure succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws

@kubevirt-bot
Copy link
Contributor

@nunnatsa: Overrode contexts on behalf of nunnatsa: ci/prow/hco-e2e-image-index-sno-aws, ci/prow/hco-e2e-upgrade-prev-index-sno-aws

In response to this:

hco-e2e-image-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-image-index-sno-aws

hco-e2e-upgrade-prev-index-sno-azure succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws

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.

@nunnatsa
Copy link
Collaborator

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2022
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

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 Jan 12, 2022
@kubevirt-bot kubevirt-bot merged commit 2686666 into kubevirt:main Jan 12, 2022
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. 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