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

remove: nodechecks function as it is not being used #683

Merged
merged 1 commit into from
Nov 14, 2023
Merged
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
49 changes: 1 addition & 48 deletions pkg/controller/queuejob/queuejob_controller_ex.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (

"github.com/eapache/go-resiliency/retrier"
"github.com/hashicorp/go-multierror"
dto "github.com/prometheus/client_model/go"

arbv1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
clientset "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/client/clientset/versioned"
Expand Down Expand Up @@ -706,7 +705,7 @@ func (qjm *XController) getProposedPreemptions(requestingJob *arbv1.AppWrapper,
func (qjm *XController) getDispatchedAppWrappers(restConfig *rest.Config) (map[string]*clusterstateapi.Resource, map[string]*arbv1.AppWrapper) {
awrRetVal := make(map[string]*clusterstateapi.Resource)
awsRetVal := make(map[string]*arbv1.AppWrapper)
// Setup and break down an informer to get a list of appwrappers bofore controllerinitialization completes
// Setup and break down an informer to get a list of appwrappers before controllerinitialization completes
appWrapperClient, err := clientset.NewForConfig(restConfig)
if err != nil {
klog.Errorf("[getDispatchedAppWrappers] Failure creating client for initialization informer err=%#v", err)
Expand Down Expand Up @@ -922,52 +921,6 @@ func (qjm *XController) chooseAgent(ctx context.Context, qj *arbv1.AppWrapper) s
return ""
}

func (qjm *XController) nodeChecks(histograms map[string]*dto.Metric, aw *arbv1.AppWrapper) bool {
ok := true
allPods := qjm.GetAggregatedResourcesPerGenericItem(aw)

// Check only GPUs at this time
var podsToCheck []*clusterstateapi.Resource

for _, pod := range allPods {
if pod.GPU > 0 {
podsToCheck = append(podsToCheck, pod)
}
}

gpuHistogram := histograms["gpu"]

if gpuHistogram != nil {
buckets := gpuHistogram.Histogram.Bucket
// Go through pods needing checking
for _, gpuPod := range podsToCheck {

// Go through each bucket of the histogram to find a valid bucket
bucketFound := false
for _, bucket := range buckets {
ub := bucket.UpperBound
if ub == nil {
klog.Errorf("Unable to get upperbound of histogram bucket.")
continue
}
c := bucket.GetCumulativeCount()
var fGPU float64 = float64(gpuPod.GPU)
if fGPU < *ub && c > 1 {
// Found a valid node
bucketFound = true
break
}
}
if !bucketFound {
ok = false
break
}
}
}

return ok
}

// Thread to find queue-job(QJ) for next schedule
func (qjm *XController) ScheduleNext(qj *arbv1.AppWrapper) {
ctx := context.Background()
Expand Down