-
Notifications
You must be signed in to change notification settings - Fork 134
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
Initialise New Scheduler #2050
Initialise New Scheduler #2050
Conversation
…generic-legacy-scheduler
…generic-legacy-scheduler
…ma/queue-repository
Codecov ReportBase: 47.55% // Head: 47.87% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2050 +/- ##
==========================================
+ Coverage 47.55% 47.87% +0.32%
==========================================
Files 212 218 +6
Lines 28809 29230 +421
==========================================
+ Hits 13699 13995 +296
- Misses 14122 14247 +125
Partials 988 988
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
if err != nil { | ||
return errors.Wrapf(err, "Failed to migrate scheduler database") | ||
} | ||
taken := time.Now().Sub(start) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use time.Since
instead.
"github.com/armadaproject/armada/internal/common/armadaerrors" | ||
) | ||
|
||
var CustomHooks = []viper.DecoderConfigOption{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validation! So nice.
internal/scheduler/schedulerapp.go
Outdated
defer grpcServer.GracefulStop() | ||
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", config.Grpc.Port)) | ||
if err != nil { | ||
return errors.WithMessage(err, "Error setting up grpc server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return errors.WithMessage(err, "Error setting up grpc server") | |
return errors.WithMessage(err, "failed to setup grpc server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit. But ut's recommended to start error messages with lower-case letters since thet're often strung together like "message 1: message 2` etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for other parts of this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal/scheduler/schedulerapp.go
Outdated
} | ||
return NewKubernetesLeaderController(LeaderConfig{}, clientSet.CoordinationV1()), nil | ||
default: | ||
return nil, errors.New(fmt.Sprintf("%s is not a value leader mode", config.Mode)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use errors.Errorf
.
Code Necessary to Intialise new scheduler and start the scheduling cycle. Main changes in the this PR:
QueueRepository
that is just backed by the existing Redis code.schedulerapp
for this)