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

feat(apis): add completed state to podgroup&queue #66

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/apis/scheduling/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ const (

// These are the valid phase of podGroups.
const (
// PodPending means the pod group has been accepted by the system, but scheduler can not allocate
// PodGroupPending means the pod group has been accepted by the system, but scheduler can not allocate
// enough resources to it.
PodGroupPending PodGroupPhase = "Pending"

// PodRunning means `spec.minMember` pods of PodGroups has been in running phase.
// PodGroupRunning means `spec.minMember` pods of PodGroup has been in running phase.
PodGroupRunning PodGroupPhase = "Running"

// PodGroupUnknown means part of `spec.minMember` pods are running but the other part can not
Expand All @@ -51,6 +51,9 @@ const (
// PodGroupInqueue means controllers can start to create pods,
// is a new state between PodGroupPending and PodGroupRunning
PodGroupInqueue PodGroupPhase = "Inqueue"

// PodGroupCompleted means all the pods of PodGroup are completed
PodGroupCompleted PodGroupPhase = "Completed"
Copy link
Member

@k82cn k82cn Mar 26, 2022

Choose a reason for hiding this comment

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

How about some Pods are completred but others are failed? Are we going to distinguish succeed & failure?

Copy link
Member Author

Choose a reason for hiding this comment

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

My idea is not distinguish succeed & failure pods. In most common scenary, if successful + failed pods == total replicas, we set the PodGroup to Completed.

)

type PodGroupConditionType string
Expand Down Expand Up @@ -273,6 +276,8 @@ type QueueStatus struct {
Running int32
// The number of `Inqueue` PodGroup in this queue.
Inqueue int32
// The number of `Completed` PodGroup in this queue.
Completed int32

// Reservation is the profile of resource reservation for queue
Reservation Reservation `json:"reservation,omitempty" protobuf:"bytes,6,opt,name=reservation"`
Expand Down
9 changes: 7 additions & 2 deletions pkg/apis/scheduling/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const (

// These are the valid phase of podGroups.
const (
// PodPending means the pod group has been accepted by the system, but scheduler can not allocate
// PodGroupPending means the pod group has been accepted by the system, but scheduler can not allocate
// enough resources to it.
PodGroupPending PodGroupPhase = "Pending"

// PodRunning means `spec.minMember` pods of PodGroups has been in running phase.
// PodGroupRunning means `spec.minMember` pods of PodGroup has been in running phase.
PodGroupRunning PodGroupPhase = "Running"

// PodGroupUnknown means part of `spec.minMember` pods are running but the other part can not
Expand All @@ -54,6 +54,9 @@ const (
// PodGroupInqueue means controllers can start to create pods,
// is a new state between PodGroupPending and PodGroupRunning
PodGroupInqueue PodGroupPhase = "Inqueue"

// PodGroupCompleted means all the pods of PodGroup are completed
PodGroupCompleted PodGroupPhase = "Completed"
)

type PodGroupConditionType string
Expand Down Expand Up @@ -289,6 +292,8 @@ type QueueStatus struct {
Running int32 `json:"running,omitempty" protobuf:"bytes,4,opt,name=running"`
// The number of `Inqueue` PodGroup in this queue.
Inqueue int32 `json:"inqueue,omitempty" protobuf:"bytes,5,opt,name=inqueue"`
// The number of `Completed` PodGroup in this queue.
Completed int32 `json:"completed,omitempty" protobuf:"bytes,7,opt,name=completed"`

// Reservation is the profile of resource reservation for queue
Reservation Reservation `json:"reservation,omitempty" protobuf:"bytes,6,opt,name=reservation"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/scheduling/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.