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 condition WaitingForReplacementPods for pod groups integration #2234

Conversation

mbobrovskyi
Copy link
Contributor

@mbobrovskyi mbobrovskyi commented May 20, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Add condition WaitingForReplacementPods for pod groups integration.

Which issue(s) this PR fixes:

Fixes #2207

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Pod Integration: Add condition WaitingForReplacementPods to Workloads of pod groups with incomplete number of pods

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels May 20, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 20, 2024
@k8s-ci-robot k8s-ci-robot requested a review from mimowo May 20, 2024 09:06
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 20, 2024
Copy link

netlify bot commented May 20, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 1c2075e
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/6650da31e1e9e8000821f348
😎 Deploy Preview https://deploy-preview-2234--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mbobrovskyi mbobrovskyi force-pushed the feature/add-condition-WaitingForReplacementPods-for-pod-groups-integration branch from b3e4aec to a2dc2ad Compare May 20, 2024 09:12
@mbobrovskyi
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 20, 2024
@mbobrovskyi
Copy link
Contributor Author

/assign @trasc

Copy link
Contributor

@trasc trasc 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

pkg/controller/jobframework/interface.go Outdated Show resolved Hide resolved
pkg/controller/jobframework/reconciler.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/util/testing/wrappers.go Outdated Show resolved Hide resolved
@mbobrovskyi mbobrovskyi force-pushed the feature/add-condition-WaitingForReplacementPods-for-pod-groups-integration branch from a2dc2ad to 840ab23 Compare May 21, 2024 06:35
@mbobrovskyi
Copy link
Contributor Author

/test all

@mbobrovskyi mbobrovskyi force-pushed the feature/add-condition-WaitingForReplacementPods-for-pod-groups-integration branch 2 times, most recently from 17a5f5c to a517928 Compare May 21, 2024 10:46
@mbobrovskyi mbobrovskyi marked this pull request as ready for review May 21, 2024 10:47
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 21, 2024
@mbobrovskyi mbobrovskyi force-pushed the feature/add-condition-WaitingForReplacementPods-for-pod-groups-integration branch from a517928 to a91aa41 Compare May 21, 2024 10:56
apis/kueue/v1beta1/workload_types.go Outdated Show resolved Hide resolved
// when custom workload conditions should be updated after ensure that the workload exists.
type JobWithCustomWorkloadConditions interface {
// CustomWorkloadConditions return custom workload conditions and status changed or not.
CustomWorkloadConditions(wl *kueue.Workload) ([]metav1.Condition, bool)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we instead put it somewhere inside the implementation of FindMatchingWorkloads for the pod integration? We are already removing excess pods and doing patches to the Workload object there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that FindMatchingWorkloads already doing so much. The function name is Find... that is shouldn't update workload. So, if we can move this logic to another place, that's better in my opinion.

pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/controller/jobframework/reconciler.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
}

if replCond.Status != metav1.ConditionTrue {
replCond.Status = metav1.ConditionTrue
Copy link
Contributor

Choose a reason for hiding this comment

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

in which case do we reach this?

Copy link
Contributor Author

@mbobrovskyi mbobrovskyi May 22, 2024

Choose a reason for hiding this comment

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

After replacement finished we are setting status to false. And when replacement happening again we need to set to true and update. In this case we need to know that status updated. But also we don't need to update workload if it's no changes.

pkg/controller/jobs/pod/pod_controller.go Show resolved Hide resolved
@mbobrovskyi mbobrovskyi force-pushed the feature/add-condition-WaitingForReplacementPods-for-pod-groups-integration branch from a91aa41 to 6749db5 Compare May 22, 2024 15:58
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 22, 2024
@mbobrovskyi mbobrovskyi force-pushed the feature/add-condition-WaitingForReplacementPods-for-pod-groups-integration branch 3 times, most recently from 224492a to ddc0f4a Compare May 23, 2024 05:47
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.

I forgot to send my review yesterday :(

pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_controller.go Outdated Show resolved Hide resolved
@mbobrovskyi mbobrovskyi force-pushed the feature/add-condition-WaitingForReplacementPods-for-pod-groups-integration branch from ddc0f4a to 1c2075e Compare May 24, 2024 18:19
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 24, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d22055cf144807ed663f8aa495662b4f33171f8c

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 24, 2024
@k8s-ci-robot k8s-ci-robot merged commit fab6cfe into kubernetes-sigs:main May 24, 2024
15 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.7 milestone May 24, 2024
@mbobrovskyi mbobrovskyi deleted the feature/add-condition-WaitingForReplacementPods-for-pod-groups-integration branch May 24, 2024 18:43
@alculquicondor
Copy link
Contributor

/release-note-edit

Pod Integration: Add condition WaitingForReplacementPods to Workloads of pod groups with incomplete number of pods

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/feature Categorizes issue or PR as related to a new feature. 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add condition WaitingForReplacementPods for pod groups integration
4 participants