Skip to content

Commit 398f1b8

Browse files
authored
remove legacy cache (#600)
1 parent 486aefe commit 398f1b8

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

Diff for: pkg/controller/clusterstate/cache/cache.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import (
4747
"k8s.io/klog/v2"
4848

4949
"github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/controller/clusterstate/api"
50-
"k8s.io/apimachinery/pkg/util/wait"
5150
)
5251

5352
//New returns a Cache implementation.
@@ -98,10 +97,10 @@ func newClusterStateCache(config *rest.Config) *ClusterStateCache {
9897

9998
func (sc *ClusterStateCache) Run(stopCh <-chan struct{}) {
10099
klog.V(8).Infof("Cluster State Cache started.")
101-
go sc.nodeInformer.Informer().Run(stopCh)
100+
//go sc.nodeInformer.Informer().Run(stopCh)
102101

103102
// Update cache
104-
go wait.Until(sc.updateCache, 0, stopCh)
103+
//go wait.Until(sc.updateCache, 0, stopCh)
105104

106105
}
107106

Diff for: pkg/controller/queuejob/queuejob_controller_ex.go

+10-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"time"
3232

3333
"github.com/eapache/go-resiliency/retrier"
34-
"github.com/gogo/protobuf/proto"
3534
"github.com/hashicorp/go-multierror"
3635
qmutils "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/quotaplugins/util"
3736

@@ -71,7 +70,6 @@ import (
7170
"github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/controller/queuejobdispatch"
7271

7372
clusterstateapi "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/controller/clusterstate/api"
74-
clusterstatecache "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/controller/clusterstate/cache"
7573
)
7674

7775
// XController the AppWrapper Controller type
@@ -110,7 +108,7 @@ type XController struct {
110108

111109
//TODO: Do we need this local cache?
112110
// our own local cache, used for computing total amount of resources
113-
cache clusterstatecache.Cache
111+
//cache clusterstatecache.Cache
114112

115113
// is dispatcher or deployer?
116114
isDispatcher bool
@@ -207,8 +205,8 @@ func NewJobController(config *rest.Config, serverOption *options.ServerOption) *
207205
initQueue: cache.NewFIFO(GetQueueJobKey),
208206
updateQueue: cache.NewFIFO(GetQueueJobKey),
209207
qjqueue: NewSchedulingQueue(),
210-
//TODO: do we still need cache to be initialized?
211-
cache: clusterstatecache.New(config),
208+
//cache is turned-off, issue: https://github.com/project-codeflare/multi-cluster-app-dispatcher/issues/588
209+
//cache: clusterstatecache.New(config),
212210
schedulingAW: nil,
213211
}
214212
//TODO: work on enabling metrics adapter for correct MCAD mode
@@ -1157,12 +1155,12 @@ func (qjm *XController) ScheduleNext(qj *arbv1.AppWrapper) {
11571155
// Assume preemption will remove low priroity AWs in the system, optimistically dispatch such AWs
11581156

11591157
if aggqj.LessEqual(resources) {
1160-
//TODO: should we turn-off histograms?
1161-
unallocatedHistogramMap := qjm.cache.GetUnallocatedHistograms()
1162-
if !qjm.nodeChecks(unallocatedHistogramMap, qj) {
1163-
klog.Infof("[ScheduleNext] [Agent Mode] Optimistic dispatch for AW '%s/%s' requesting aggregated resources %v histogram for point in-time fragmented resources are available in the cluster %s",
1164-
qj.Name, qj.Namespace, qjm.GetAggregatedResources(qj), proto.MarshalTextString(unallocatedHistogramMap["gpu"]))
1165-
}
1158+
//cache is turned-off, refer issue: https://github.com/project-codeflare/multi-cluster-app-dispatcher/issues/588
1159+
// unallocatedHistogramMap := qjm.cache.GetUnallocatedHistograms()
1160+
// if !qjm.nodeChecks(unallocatedHistogramMap, qj) {
1161+
// klog.Infof("[ScheduleNext] [Agent Mode] Optimistic dispatch for AW '%s/%s' requesting aggregated resources %v histogram for point in-time fragmented resources are available in the cluster %s",
1162+
// qj.Name, qj.Namespace, qjm.GetAggregatedResources(qj), proto.MarshalTextString(unallocatedHistogramMap["gpu"]))
1163+
// }
11661164
// Now evaluate quota
11671165
fits := true
11681166
klog.Infof("[ScheduleNext] [Agent Mode] available resourse successful check for '%s/%s' at %s activeQ=%t Unsched=%t &qj=%p Version=%s Status=%+v.",
@@ -1464,7 +1462,7 @@ func (cc *XController) Run(stopCh <-chan struct{}) {
14641462

14651463
cache.WaitForCacheSync(stopCh, cc.appWrapperSynced)
14661464

1467-
//TODO: do we still need to run cache every second?
1465+
//cache is turned off, issue: https://github.com/project-codeflare/multi-cluster-app-dispatcher/issues/588
14681466
// update snapshot of ClientStateCache every second
14691467
//cc.cache.Run(stopCh)
14701468

0 commit comments

Comments
 (0)