yangwwei commented on a change in pull request #252:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/252#discussion_r611136707
##########
File path: pkg/cache/task.go
##########
@@ -265,6 +265,12 @@ func (task *Task) handleSubmitTaskEvent(event *fsm.Event) {
events.GetRecorder().Eventf(task.pod, v1.EventTypeNormal, "Scheduling",
"%s is queued and waiting for allocation", task.alias)
+ // if this task is belong to the gang member, then post a message to
indicate the pod will being scheduled as gang member
Review comment:
Suggest changing the text to the following:
```
// if this task belongs to a task group, that means the app has gang
scheduling enabled
// in this case, post an event to indicate the task is being gang scheduled
```
##########
File path: pkg/cache/task_test.go
##########
@@ -28,13 +29,21 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
apis "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/client-go/tools/record"
"github.com/apache/incubator-yunikorn-core/pkg/common"
"github.com/apache/incubator-yunikorn-k8shim/pkg/client"
+ "github.com/apache/incubator-yunikorn-k8shim/pkg/common/constants"
"github.com/apache/incubator-yunikorn-k8shim/pkg/common/events"
+ "github.com/apache/incubator-yunikorn-k8shim/pkg/conf"
"github.com/apache/incubator-yunikorn-scheduler-interface/lib/go/si"
)
+// type recorderTime struct {
+// time int64
+// lock *sync.RWMutex
+// }
+
Review comment:
if this is not used, pls remove them
##########
File path: pkg/cache/task.go
##########
@@ -265,6 +265,12 @@ func (task *Task) handleSubmitTaskEvent(event *fsm.Event) {
events.GetRecorder().Eventf(task.pod, v1.EventTypeNormal, "Scheduling",
"%s is queued and waiting for allocation", task.alias)
+ // if this task is belong to the gang member, then post a message to
indicate the pod will being scheduled as gang member
+ if !task.placeholder && task.taskGroupName != "" {
+ events.GetRecorder().Eventf(task.pod,
+ v1.EventTypeNormal, "GangScheduling",
+ "Pod belongs to the taskGroup %s, it will being
scheduled as a gang member", task.taskGroupName)
Review comment:
Suggest changing the message to:
"Pod belongs to the taskGroup %s, it will be scheduled as a gang member"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]