From 0e7307cb9f3101a0d2e3b6a5f74de8c0b6e3fdc1 Mon Sep 17 00:00:00 2001 From: Eleanor Pratt <101330560+eleanorpratt@users.noreply.github.com> Date: Thu, 5 Sep 2024 17:44:59 +0100 Subject: [PATCH] remove DummySubmitCheck from config and remove logic that used it (#219) (#3910) Co-authored-by: Eleanor Pratt --- config/scheduler/config.yaml | 1 - .../scheduler/configuration/configuration.go | 2 -- internal/scheduler/schedulerapp.go | 23 +++++++------------ internal/scheduler/submitcheck.go | 11 --------- 4 files changed, 8 insertions(+), 29 deletions(-) diff --git a/config/scheduler/config.yaml b/config/scheduler/config.yaml index 75936ce42a3..39332be36a4 100644 --- a/config/scheduler/config.yaml +++ b/config/scheduler/config.yaml @@ -6,7 +6,6 @@ databaseFetchSize: 1000 pulsarSendTimeout: 5s internedStringsCacheSize: 100000 queueRefreshPeriod: 10s -disableSubmitCheck: false metrics: port: 9000 jobStateMetricsResetInterval: 12h diff --git a/internal/scheduler/configuration/configuration.go b/internal/scheduler/configuration/configuration.go index b5563e865d0..36c1a0142c6 100644 --- a/internal/scheduler/configuration/configuration.go +++ b/internal/scheduler/configuration/configuration.go @@ -57,8 +57,6 @@ type Configuration struct { DatabaseFetchSize int `validate:"required"` // Frequency at which queues will be fetched from the API QueueRefreshPeriod time.Duration `validate:"required"` - // If true then submit checks will be skipped - DisableSubmitCheck bool } func (c Configuration) Validate() error { diff --git a/internal/scheduler/schedulerapp.go b/internal/scheduler/schedulerapp.go index 288d7694b07..e205a32f719 100644 --- a/internal/scheduler/schedulerapp.go +++ b/internal/scheduler/schedulerapp.go @@ -221,21 +221,14 @@ func Run(config schedulerconfig.Configuration) error { // //////////////////////////////////////////////////////////////////////// ctx.Infof("setting up scheduling loop") - var submitChecker SubmitScheduleChecker - if !config.DisableSubmitCheck { - submitCheckerImpl := NewSubmitChecker( - config.Scheduling, - executorRepository, - resourceListFactory, - ) - services = append(services, func() error { - return submitCheckerImpl.Run(ctx) - }) - submitChecker = submitCheckerImpl - } else { - ctx.Infof("DisableSubmitCheckis true, will use a dummy submit check") - submitChecker = &DummySubmitChecker{} - } + submitChecker := NewSubmitChecker( + config.Scheduling, + executorRepository, + resourceListFactory, + ) + services = append(services, func() error { + return submitChecker.Run(ctx) + }) stringInterner := stringinterner.New(config.InternedStringsCacheSize) schedulingAlgo, err := NewFairSchedulingAlgo( diff --git a/internal/scheduler/submitcheck.go b/internal/scheduler/submitcheck.go index a8b0b478538..519416b2612 100644 --- a/internal/scheduler/submitcheck.go +++ b/internal/scheduler/submitcheck.go @@ -41,17 +41,6 @@ type SubmitScheduleChecker interface { Check(ctx *armadacontext.Context, jobs []*jobdb.Job) (map[string]schedulingResult, error) } -// DummySubmitChecker is a SubmitScheduleChecker that allows every job -type DummySubmitChecker struct{} - -func (srv *DummySubmitChecker) Check(_ *armadacontext.Context, jobs []*jobdb.Job) (map[string]schedulingResult, error) { - results := make(map[string]schedulingResult, len(jobs)) - for _, job := range jobs { - results[job.Id()] = schedulingResult{isSchedulable: true} - } - return results, nil -} - type SubmitChecker struct { schedulingConfig configuration.SchedulingConfig executorRepository database.ExecutorRepository