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

Add queue controller about state #512

Merged
merged 1 commit into from
Dec 6, 2019
Merged

Conversation

sivanzcw
Copy link
Contributor

@sivanzcw sivanzcw commented Nov 6, 2019

  • Add queue action and events

  • Add filter function for command watch in job controller, only list command whose target is batch.volcano.sh/v1alpha1 Job

  • Add events recorder for queue controller

  • Add command sync during queue sync

  • Change queue sync logic, sync queue according to its events and action

@volcano-sh-bot volcano-sh-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 6, 2019
@TravisBuddy
Copy link

Travis tests have failed

Hey @sivanzcw,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 36a202a0-00b1-11ea-8767-d53e6939ac53

@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 1c950e20-010b-11ea-82f1-cf3ba55cf6d0

@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: ec1c7e20-0116-11ea-82f1-cf3ba55cf6d0

@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: ae5bf880-0117-11ea-82f1-cf3ba55cf6d0

@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 17967800-0485-11ea-b305-a56282dbf54c

@sivanzcw
Copy link
Contributor Author

/retest

@volcano-sh-bot
Copy link
Contributor

@sivanzcw: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes/test-infra repository.

// of the queue will be set as `Closing`, while if there is no podgroup under the queue,
// the status of queue will be set as `Stopped`.
queueStatus.State = queue.Spec.State
if len(queueStatus.State) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why still update state here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For condition of podgroups under the queue will affect the state of the queue, it may determine whether the queue is in the Closed state or the Closing state, when desired state of queue is Closed. So during synchronizing queue, we need to refresh the true state of queue. True state of queue is state in status. state in spec only defines the desired state of queue. The code still follows the logic that state of spec and condition of podgroup under the queue determine the true state of queue, so here to get the true state of the queue according to the state of spec.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the queue's state should be update by each State, and queue.Satatus.State should only copy it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated it

case *busv1alpha1.Command:
cmd := obj.(*busv1alpha1.Command)
if cmd.TargetObject != nil &&
cmd.TargetObject.APIVersion == schedulingv1alpha2.SchemeGroupVersion.String() &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's create QueueKind in apis package and use DeepEqual here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the TargetObject is an instantiated object that contains the name and uid of queue reference, it is difficult to use the DeepEqual function to compare it with a constant with QueueKind type. A filter function is provided to replace the filtering action here.

@volcano-sh-bot volcano-sh-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 19, 2019
@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: cb2d09b0-0abb-11ea-adc5-254fad528e65

@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 2b5ed2b0-0ae3-11ea-adc5-254fad528e65

@TravisBuddy
Copy link

Hey @sivanzcw,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: d7b576e0-175e-11ea-b5b2-a33d2660b61c

@k82cn
Copy link
Member

k82cn commented Dec 6, 2019

/lgtm
/approve

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2019
@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: k82cn, sivanzcw

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 6, 2019
@k82cn
Copy link
Member

k82cn commented Dec 6, 2019

we need add command line to open/close queue for this :)

@volcano-sh-bot volcano-sh-bot merged commit fa074bc into volcano-sh:master Dec 6, 2019
@sivanzcw
Copy link
Contributor Author

sivanzcw commented Dec 6, 2019

add it #590

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants