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

Add sidecar containers to resource requests computation #2099

Merged
merged 9 commits into from May 7, 2024

Conversation

IrvingMg
Copy link
Contributor

@IrvingMg IrvingMg commented Apr 29, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Includes SidecarContainers in the computation of total resource requests of a pod.

Which issue(s) this PR fixes:

Fixes #2068

Special notes for your reviewer:

The new formula to calculate the total was extracted from KEP-753.

Does this PR introduce a user-facing change?

Fix the resource requests computation taking into account sidecar containers.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. labels Apr 29, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 29, 2024
Copy link

netlify bot commented Apr 29, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 053c150
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/663a31e1bd605100082ca63e

@alculquicondor
Copy link
Contributor

Please add a release note.

@gabesaba
Copy link
Contributor

How urgent is this? Is it acceptable to wait until kubernetes/kubernetes#124537 is fixed, and use that library? @alculquicondor

pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange_test.go Outdated Show resolved Hide resolved
@alculquicondor
Copy link
Contributor

No, we cannot wait. That change will only be available in a released module when all of v1.31 is released, which will be ~3 months from now.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 30, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 2, 2024
Copy link
Contributor

@gabesaba gabesaba left a comment

Choose a reason for hiding this comment

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

overall lgtm, just a few nits. thanks for addressing the comments.

pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange_test.go Show resolved Hide resolved
pkg/util/limitrange/limitrange_test.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

unit tests look solid :)

pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
@IrvingMg
Copy link
Contributor Author

IrvingMg commented May 7, 2024

/test pull-kueue-test-integration-main

pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Show resolved Hide resolved
@gabesaba
Copy link
Contributor

gabesaba commented May 7, 2024

lgtm

Copy link
Contributor

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: df9454efb9a3ffa1eafdb3d2d48d9edc8dc9219d

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, IrvingMg

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 May 7, 2024
@alculquicondor
Copy link
Contributor

/cherry-pick release-0.6

@k8s-infra-cherrypick-robot

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

In response to this:

/cherry-pick release-0.6

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 merged commit 57de1cd into kubernetes-sigs:main May 7, 2024
14 of 15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.7 milestone May 7, 2024
@k8s-infra-cherrypick-robot

@alculquicondor: #2099 failed to apply on top of branch "release-0.6":

Applying: Add sidecar containers to resource requests computation
Applying: Refactor init containers resource computation
Applying: Refactor tests cases using Container wrapper
Using index info to reconstruct a base tree...
M	pkg/util/testing/wrappers.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/util/testing/wrappers.go
CONFLICT (content): Merge conflict in pkg/util/testing/wrappers.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 Refactor tests cases using Container wrapper
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-0.6

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.

@tenzen-y
Copy link
Member

tenzen-y commented May 7, 2024

@IrvingMg Could you open a PR manually?

k8s-ci-robot pushed a commit that referenced this pull request May 8, 2024
…quests computation (#2159)

* Add sidecar containers to resource requests computation

* Refactor init containers resource computation

* Refactor tests cases using Container wrapper

* Update test cases

* Refactor sidecar condition

* Update tests

* Update formula to compute resource requests

* Make init containers resource computation linear

* Update init containers resource computation
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", 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 Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for sidecar containers
7 participants