Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Order gang scheduled jobs based on time of arrival #464

Merged
merged 3 commits into from
Nov 5, 2018
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion pkg/scheduler/plugins/gang/gang.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ func (gp *gangPlugin) OnSessionOpen(ssn *framework.Session) {
}

if !lReady && !rReady {
if lv.UID < rv.UID {
if lv.PodGroup.GetCreationTimestamp().Time.Equal(rv.PodGroup.GetCreationTimestamp().Time) {
Copy link
Contributor

@k82cn k82cn Nov 1, 2018

Choose a reason for hiding this comment

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

hm... we need to add a new field into JobInfo, the creation-timestamp is from PodGroup or PDB. And we will check jobInfo's creation time here. We need to support PDB as tf-operator is using it, we will remove it at least after 0.4 release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something along these lines ? (3f0dfd8)

if lv.UID < rv.UID {
return -1;
}
} else if lv.PodGroup.GetCreationTimestamp().Time.Before(rv.PodGroup.GetCreationTimestamp().Time) {
return -1
}
return 1
Expand Down