Skip to content

Commit

Permalink
remove DummySubmitCheck from config and remove logic that used it (#219
Browse files Browse the repository at this point in the history
…) (#3910)

Co-authored-by: Eleanor Pratt <[email protected]>
  • Loading branch information
eleanorpratt and Eleanor Pratt committed Sep 5, 2024
1 parent 9815369 commit 0e7307c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 29 deletions.
1 change: 0 additions & 1 deletion config/scheduler/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ databaseFetchSize: 1000
pulsarSendTimeout: 5s
internedStringsCacheSize: 100000
queueRefreshPeriod: 10s
disableSubmitCheck: false
metrics:
port: 9000
jobStateMetricsResetInterval: 12h
Expand Down
2 changes: 0 additions & 2 deletions internal/scheduler/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
23 changes: 8 additions & 15 deletions internal/scheduler/schedulerapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 0 additions & 11 deletions internal/scheduler/submitcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e7307c

Please sign in to comment.