feat(operator): add finite PodClique phase handling - #728
shayasoolin wants to merge 20 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ase model sections Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ion criteria, and alternatives Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mpletion Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…starts:0, phase struct, cleanup wording, event table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… and KubeRay Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use spec.template.cliques[] with podSpec.restartPolicy for the all-ranks example, and spec.template.podCliqueScalingGroups[].cliqueNames for the leader-driven example. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| | `updatedReplicas` _integer_ | UpdatedReplicas is the number of Pods that have been updated and are at the desired revision of the PodClique. | 0 | | | ||
| | `scheduleGatedReplicas` _integer_ | ScheduleGatedReplicas is the number of Pods that have been created with one or more scheduling gate(s) set.<br />Sum of ReadyReplicas and ScheduleGatedReplicas will always be <= Replicas. | 0 | | | ||
| | `scheduledReplicas` _integer_ | ScheduledReplicas is the number of Pods that have been scheduled by the backend scheduler. | 0 | | | ||
| | `phase` _[JobPhase](#jobphase)_ | Phase is the terminal phase of a finite PodClique. It is empty for non-finite PodCliques and finite PodCliques that are still running. | | Enum: [Completed Failed] <br /> | |
There was a problem hiding this comment.
why not supporting it for not finite PCLQ ? "pending"/ "running"
There was a problem hiding this comment.
We defined that we'll set phases only for "job-mode" resources. If we support pending/running we should put them on any resource even in regular non-job mode, and I'm not sure there's value in doing that.
Unless you suggest to have pending/running but only for finite resources?
Can we discuss this as part of the GREP PR?
| } | ||
|
|
||
| // IsPCLQTerminal reports whether a PodClique has reached a finite terminal phase. | ||
| func IsPCLQTerminal(pclq *grovecorev1alpha1.PodClique) bool { |
There was a problem hiding this comment.
nit: rename to IsPCLQTerminated
| return ctrlcommon.ContinueReconcile() | ||
| } | ||
|
|
||
| func isTerminalPod(pod *corev1.Pod) bool { |
There was a problem hiding this comment.
nit: rename to isPodTerminated
| var warnings []string | ||
|
|
||
| if !utils.IsEmptyStringType(spec.RestartPolicy) { | ||
| warnings = append(warnings, "restartPolicy will be ignored, it will be set to Always") |
There was a problem hiding this comment.
this is actually breaking, cause we supported any value before that and now it will return an error "OnFailure" for example
Summary
Related to #285.
This PR introduces the first implementation slice for finite/job-style PodCliques. A PodClique is treated as finite when its pod template uses
restartPolicy: Never.The branch is currently stacked on the GREP branch from #696, so until #696 is merged this PR also includes the proposal/documentation commits in its diff.
The implementation scope is intentionally limited to the PCLQ level:
PodClique.status.phasewithCompleted/FailedCompletedwhen all pods succeedFailedwhen any pod failsAPI / Validation
JobPhaseand optionalstatus.phasetoPodClique.restartPolicy: Neverfor finite PCLQs.Always.restartPolicy: OnFailure.autoScalingConfigfor finite PCLQs.Controller Behavior
restartPolicyif needed.pod.status.phasechanges.Tests
Completed, terminal pods retainedFailed, terminal pods retained, active pods deleted and not recreatedVerification