-
Notifications
You must be signed in to change notification settings - Fork 720
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
mcs: make scheduling server support checker and scheduler http interface #7131
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Skipping CI for Draft Pull Request. |
Signed-off-by: lhy1024 <admin@liudos.us>
3f25d52
to
6719a08
Compare
Codecov Report
@@ Coverage Diff @@
## master #7131 +/- ##
==========================================
+ Coverage 74.58% 74.60% +0.01%
==========================================
Files 441 441
Lines 47292 47365 +73
==========================================
+ Hits 35275 35336 +61
+ Misses 8940 8936 -4
- Partials 3077 3093 +16
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -120,12 +119,15 @@ func NewService(srv *scheserver.Service) *Service { | |||
func (s *Service) RegisterSchedulersRouter() { | |||
router := s.root.Group("schedulers") | |||
router.GET("", getSchedulers) | |||
router.GET("/diagnostic/:name", getDiagnosticResult) |
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.
We don't need it for now.
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.
why? It can pass tests
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.
This feature is not widely used, to reduce the problem, I think we can hold it instead of expose it.
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.
I think it's best to keep forwarding, one reason is that it will make matching rules simple, and another reason is to avoid us missing an interface or creating incompatibility issues
@@ -120,12 +119,15 @@ func NewService(srv *scheserver.Service) *Service { | |||
func (s *Service) RegisterSchedulersRouter() { | |||
router := s.root.Group("schedulers") | |||
router.GET("", getSchedulers) | |||
router.GET("/diagnostic/:name", getDiagnosticResult) | |||
router.POST("/:name", pauseOrResumeScheduler) |
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.
Shall we split it into two APIs?
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.
No, we only support one-to-one forwarding at this time.
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.
What I mean is since we use the new framework for scheduling service, we should make it more standard. The previous one is not good enough, so we should make it more clear.
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.
If we want to achieve one-to-two forwarding, i.e. post scheduler/{name}
is at the api server and forwards to post scheduler/{name}/pause
and post scheduler/{name}/resume
, we may need to add a check for body to the match rule.
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.
We should make the new API more clear.
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.
If you don't want to change it and since it is only used by forwarding now, I'm ok with the current status. But in the future, it's better to separate these actions.
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.
ok, I will add TODO about it.
@@ -159,10 +159,17 @@ func (suite *apiTestSuite) TestAPIForward() { | |||
pauseArgs, err := json.Marshal(input) | |||
suite.NoError(err) | |||
err = testutil.CheckPostJSON(testDialClient, fmt.Sprintf("%s/%s", urlPrefix, "checker/merge"), pauseArgs, | |||
testutil.StatusOK(re), testutil.WithoutHeader(re, apiutil.PDRedirectorHeader)) |
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.
Why change it?
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.
Because we should allow to redirect pause/resume checker
/merge |
@lhy1024: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 2fad820
|
@lhy1024: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
56451c9
to
d19578d
Compare
/merge |
@lhy1024: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: d19578d
|
What problem does this PR solve?
Issue Number: Ref #5839
What is changed and how does it work?
It can be reviewed after #7090 and #7169
Check List
Tests
Release note