Skip to content

Enhance MCAD Logs and fix naming consistency #645

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

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
152 changes: 76 additions & 76 deletions pkg/controller/queuejob/queuejob_controller_ex.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pkg/controller/queuejob/scheduling_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (p *PriorityQueue) MoveToActiveQueueIfExists(aw *qjobv1.AppWrapper) error {
p.unschedulableQ.Delete(aw)
err := p.activeQ.AddIfNotPresent(aw)
if err != nil {
klog.Errorf("[MoveToActiveQueueIfExists] Error adding AW %v to the scheduling queue: %v\n", aw.Name, err)
klog.Errorf("[MoveToActiveQueueIfExists] Error adding AW %s/%s to the scheduling queue: %v\n", aw.Namespace, aw.Name, err)
}
p.cond.Broadcast()
return err
Expand All @@ -176,10 +176,10 @@ func (p *PriorityQueue) Add(qj *qjobv1.AppWrapper) error {
defer p.lock.Unlock()
err := p.activeQ.Add(qj)
if err != nil {
klog.Errorf("Error adding QJ %v to the scheduling queue: %v", qj.Name, err)
klog.Errorf("Error adding QJ %s/%s to the scheduling queue: %v", qj.Namespace, qj.Name, err)
} else {
if p.unschedulableQ.Get(qj) != nil {
klog.Errorf("Error: QJ %v is already in the unschedulable queue.", qj.Name)
klog.Errorf("Error: QJ %s/%s is already in the unschedulable queue.", qj.Namespace, qj.Name)
p.unschedulableQ.Delete(qj)
}
p.cond.Broadcast()
Expand All @@ -201,7 +201,7 @@ func (p *PriorityQueue) AddIfNotPresent(qj *qjobv1.AppWrapper) error {
}
err := p.activeQ.Add(qj)
if err != nil {
klog.Errorf("Error adding pod %v to the scheduling queue: %v", qj.Name, err)
klog.Errorf("Error adding pod %s/%s to the scheduling queue: %v", qj.Namespace, qj.Name, err)
} else {
p.cond.Broadcast()
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/queuejobdispatch/queuejobagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (cc *JobClusterAgent) addQueueJob(obj interface{}) {
klog.Errorf("obj is not AppWrapper")
return
}
klog.V(10).Infof("[TTime]: %s Adding New Job: %s to EventQ\n", time.Now().String(), qj.Name)
klog.V(10).Infof("[TTime]: %s Adding New Job: %s/%s to EventQ\n", time.Now().String(), qj.Namespace, qj.Name)
cc.agentEventQueue.Add(qj)
}

Expand All @@ -139,7 +139,7 @@ func (cc *JobClusterAgent) updateQueueJob(oldObj, newObj interface{}) {
klog.Errorf("newObj is not AppWrapper")
return
}
klog.V(10).Infof("[TTime]: %s Adding Update Job: %s to EventQ\n", time.Now().String(), newQJ.Name)
klog.V(10).Infof("[TTime]: %s Adding Update Job: %s/%s to EventQ\n", time.Now().String(), newQJ.Namespace, newQJ.Name)
cc.agentEventQueue.Add(newQJ)
}

Expand All @@ -149,7 +149,7 @@ func (cc *JobClusterAgent) deleteQueueJob(obj interface{}) {
klog.Errorf("obj is not AppWrapper")
return
}
klog.V(10).Infof("[TTime]: %s Adding Delete Job: %s to EventQ\n", time.Now().String(), qj.Name)
klog.V(10).Infof("[TTime]: %s Adding Delete Job: %s/%s to EventQ\n", time.Now().String(), qj.Namespace, qj.Name)
cc.agentEventQueue.Add(qj)
}

Expand All @@ -160,7 +160,7 @@ func (qa *JobClusterAgent) Run(stopCh <-chan struct{}) {

func (qa *JobClusterAgent) DeleteJob(ctx context.Context, cqj *arbv1.AppWrapper) {
qj_temp := cqj.DeepCopy()
klog.V(2).Infof("[Dispatcher: Agent] Request deletion of XQJ %s to Agent %s\n", qj_temp.Name, qa.AgentId)
klog.V(2).Infof("[Dispatcher: Agent] Request deletion of XQJ %s/%s to Agent %s\n", qj_temp.Namespace, qj_temp.Name, qa.AgentId)
qa.queuejobclients.WorkloadV1beta1().AppWrappers(qj_temp.Namespace).Delete(ctx, qj_temp.Name, metav1.DeleteOptions{})
}

Expand All @@ -182,7 +182,7 @@ func (qa *JobClusterAgent) CreateJob(ctx context.Context, cqj *arbv1.AppWrapper)
}
agent_qj.Labels["IsDispatched"] = "true"

klog.V(2).Infof("[Dispatcher: Agent] Create XQJ: %s (Status: %+v) in Agent %s\n", agent_qj.Name, agent_qj.Status, qa.AgentId)
klog.V(2).Infof("[Dispatcher: Agent] Create XQJ: %s/%s (Status: %+v) in Agent %s\n", agent_qj.Namespace, agent_qj.Name, agent_qj.Status, qa.AgentId)
qa.queuejobclients.WorkloadV1beta1().AppWrappers(agent_qj.Namespace).Create(ctx, agent_qj, metav1.CreateOptions{})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (gr *GenericResources) SyncQueueJob(aw *arbv1.AppWrapper, awr *arbv1.AppWra
if pErr := recover(); pErr != nil {
klog.Errorf("[SyncQueueJob] Panic occurred: %v, stacktrace: %s", pErr, string(debug.Stack()))
}
klog.V(4).Infof("Finished syncing AppWrapper job resource %s (%v)", aw.Name, time.Now().Sub(startTime))
klog.V(4).Infof("Finished syncing AppWrapper job resource %s/%s (%v)", aw.Namespace, aw.Name, time.Now().Sub(startTime))
}()

namespaced := true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ func (qm *QuotaManager) Release(aw *arbv1.AppWrapper) bool {
// Handle uninitialized quota manager
if qm.quotaManagerBackend == nil {
klog.Errorf("[Release] No quota manager backend exists, Quota release %s/%s fails quota by default.",
aw.Name, aw.Namespace)
aw.Namespace, aw.Name)
return false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (qstm *QuotaSubtreeManager) addQST(obj interface{}) {
qstm.qstMap[qst.Namespace+"/"+qst.Name] = qst
qstm.setQuotasubtreeChanged()
qstm.qstMutex.Unlock()
klog.V(4).Infof("[addQST] Add complete for: %s/%s", qst.Name, qst.Namespace)
klog.V(4).Infof("[addQST] Add complete for: %s/%s", qst.Namespace, qst.Name)
}

func (qstm *QuotaSubtreeManager) updateQST(oldObj, newObj interface{}) {
Expand Down Expand Up @@ -65,7 +65,7 @@ func (qstm *QuotaSubtreeManager) updateQST(oldObj, newObj interface{}) {
qstm.setQuotasubtreeChanged()
qstm.qstMutex.Unlock()
}
klog.V(4).Infof("[updateQST] Update complete for: %s/%s", newQST.Name, newQST.Namespace)
klog.V(4).Infof("[updateQST] Update complete for: %s/%s", newQST.Namespace, newQST.Name)
}

func (qstm *QuotaSubtreeManager) deleteQST(obj interface{}) {
Expand All @@ -79,5 +79,5 @@ func (qstm *QuotaSubtreeManager) deleteQST(obj interface{}) {

delete(qstm.qstMap, string(qst.UID))
delete(qstm.qstMap, qst.Namespace+"/"+qst.Name)
klog.V(4).Infof("[deleteQST] Delete complete for: %s/%s", qst.Name, qst.Namespace)
klog.V(4).Infof("[deleteQST] Delete complete for: %s/%s", qst.Namespace, qst.Name)
}