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

work suspension: emit event for work dispatch status #5332

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

a7i
Copy link
Contributor

@a7i a7i commented Aug 9, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:

As requested by @chaunceyjiang here

Which issue(s) this PR fixes:
Part of #5217

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


It's definitely a noisy one (from e2e):

❯ kubectl get events -n karmada-es-member1 -w | grep Dispatch
3s          Normal    WorkDispatching          work/deploy-5tss401-798f586f4f      Work dispatching is in a suspended state.
20m         Normal    WorkDispatching          work/deploy-6vf8r-5b589484f8        Work is being dispatched to member clusters.
14m         Normal    WorkDispatching          work/deploy-bxwzd-595fbff7bf        Work is being dispatched to member clusters.
6m45s       Normal    WorkDispatching          work/deploy-hkfc501-69b5894fb5      Work dispatching is in a suspended state.
14m         Normal    WorkDispatching          work/deploy-l266x01-76fc7f9ff5      Work dispatching is in a suspended state.
6m45s       Normal    WorkDispatching          work/deploy-rzncw-6744c9cc5b        Work is being dispatched to member clusters.
3s          Normal    WorkDispatching          work/deploy-s7q9t-59b55698          Work is being dispatched to member clusters.
20m         Normal    WorkDispatching          work/deploy-w88m601-bd85567b7       Work dispatching is in a suspended state.
20m         Normal    WorkDispatching          work/karmadatest-2sln4-5796f9f496   Work is being dispatched to member clusters.
14m         Normal    WorkDispatching          work/karmadatest-4wvgj-6d65df87bc   Work is being dispatched to member clusters.
6s          Normal    WorkDispatching          work/karmadatest-5gkzs-67fff9c44f   Work is being dispatched to member clusters.
8s          Normal    WorkDispatching          work/karmadatest-7ghrk-547498c494   Work is being dispatched to member clusters.
8s          Normal    WorkDispatching          work/karmadatest-7hzl7-f9ffdb889    Work is being dispatched to member clusters.
20m         Normal    WorkDispatching          work/karmadatest-9c8xx-66c4bc484c   Work is being dispatched to member clusters.
8s          Normal    WorkDispatching          work/karmadatest-9nktb-6c954f5cc7   Work is being dispatched to member clusters.
20m         Normal    WorkDispatching          work/karmadatest-bz5nj-54d5b9489b   Work is being dispatched to member clusters.
14m         Normal    WorkDispatching          work/karmadatest-d4qs5-8479459b8    Work is being dispatched to member clusters.
6m50s       Normal    WorkDispatching          work/karmadatest-dh6r6-db77df5c     Work is being dispatched to member clusters.
6m48s       Normal    WorkDispatching          work/karmadatest-dmgpv-b7f786685    Work is being dispatched to member clusters.
6m50s       Normal    WorkDispatching          work/karmadatest-gp2x7-76c5676f97   Work is being dispatched to member clusters.
15m         Normal    WorkDispatching          work/karmadatest-gwjdj-5bbb868769   Work is being dispatched to member clusters.
14m         Normal    WorkDispatching          work/karmadatest-lkhg2-598cdfd8f    Work is being dispatched to member clusters.
6m50s       Normal    WorkDispatching          work/karmadatest-lpr9c-565d7d6685   Work is being dispatched to member clusters.
6m50s       Normal    WorkDispatching          work/karmadatest-mtt5n-5cfd995d87   Work is being dispatched to member clusters.
6m50s       Normal    WorkDispatching          work/karmadatest-nxmpt-757fbffcc8   Work is being dispatched to member clusters.
6m48s       Normal    WorkDispatching          work/karmadatest-nxvlk-5d78758d4b   Work is being dispatched to member clusters.
14m         Normal    WorkDispatching          work/karmadatest-p5xsf-5458cc87dc   Work is being dispatched to member clusters.
20m         Normal    WorkDispatching          work/karmadatest-ptptm-ccd695964    Work is being dispatched to member clusters.
20m         Normal    WorkDispatching          work/karmadatest-q2m4d-6bb7b6d845   Work is being dispatched to member clusters.
20m         Normal    WorkDispatching          work/karmadatest-qvk7q-78cdb59c5    Work is being dispatched to member clusters.
8s          Normal    WorkDispatching          work/karmadatest-qxpqr-6f47d77f5f   Work is being dispatched to member clusters.
14m         Normal    WorkDispatching          work/karmadatest-s28qq-7fbd957b9d   Work is being dispatched to member clusters.
20m         Normal    WorkDispatching          work/karmadatest-sk6xl-8dff558d7    Work is being dispatched to member clusters.
6m50s       Normal    WorkDispatching          work/karmadatest-spvwt-7c8c6d855    Work is being dispatched to member clusters.
15m         Normal    WorkDispatching          work/karmadatest-tn6j2-6899866b67   Work is being dispatched to member clusters.
8s          Normal    WorkDispatching          work/karmadatest-tsnsr-74cdf9bc5    Work is being dispatched to member clusters.
14m         Normal    WorkDispatching          work/karmadatest-v7h8b-6c5574d9c6   Work is being dispatched to member clusters.
20m         Normal    WorkDispatching          work/karmadatest-vbgdk-6975fcd8dc   Work is being dispatched to member clusters.
6m48s       Normal    WorkDispatching          work/karmadatest-vl9zw-6b4995dbfc   Work is being dispatched to member clusters.
14m         Normal    WorkDispatching          work/karmadatest-vlt2j-cd7d4794f    Work is being dispatched to member clusters.
8s          Normal    WorkDispatching          work/karmadatest-wvwx6-65dbdcbc47   Work is being dispatched to member clusters.
6s          Normal    WorkDispatching          work/karmadatest-zfncq-7bc9d98d85   Work is being dispatched to member clusters.
8s          Normal    WorkDispatching          work/karmadatest-zt954-5c648687bc   Work is being dispatched to member clusters.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 9, 2024
@a7i a7i changed the title Work suspend event work suspension: emit event for work dispatch status Aug 9, 2024
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 9, 2024
@a7i
Copy link
Contributor Author

a7i commented Aug 9, 2024

/hold until #5317 is merged

@karmada-bot karmada-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 9, 2024
@a7i a7i force-pushed the work-suspend-event branch from 735c7dd to e8d861f Compare August 9, 2024 03:04
@XiShanYongYe-Chang
Copy link
Member

Hi @a7i, we can continue this pr.

Apart from the documentation, this should be the last pr. Can you think of any other tasks that need to be done?

@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.

Project coverage is 28.51%. Comparing base (37488bd) to head (8f707f3).

Files Patch % Lines
pkg/controllers/execution/execution_controller.go 44.44% 3 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5332      +/-   ##
==========================================
- Coverage   28.53%   28.51%   -0.03%     
==========================================
  Files         632      632              
  Lines       43856    43862       +6     
==========================================
- Hits        12515    12506       -9     
- Misses      30443    30451       +8     
- Partials      898      905       +7     
Flag Coverage Δ
unittests 28.51% <44.44%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Amir Alavi <[email protected]>

fix lint

fix lint
@a7i a7i force-pushed the work-suspend-event branch from e8d861f to 8f707f3 Compare August 9, 2024 10:15
@a7i
Copy link
Contributor Author

a7i commented Aug 9, 2024

Hi @a7i, we can continue this pr.

Apart from the documentation, this should be the last pr. Can you think of any other tasks that need to be done?

I would like to add a bit more e2e tests (will try to add more unit tests but requires some setup). I can work on the documentation soon and e2e soon.

Also, I don't know how trivial this would be, but ideally we can have a metric for work status (with tag value for dispatching vs suspend dispatching), unless it's already there.

@a7i
Copy link
Contributor Author

a7i commented Aug 9, 2024

Just rebased the PR, I ran golangci-lint locally and it applied a couple of minor fixes. Let me know if you want that reverted.

@XiShanYongYe-Chang
Copy link
Member

Thanks @a7i

/cc @chaunceyjiang

@XiShanYongYe-Chang
Copy link
Member

Also, I don't know how trivial this would be, but ideally we can have a metric for work status (with tag value for dispatching vs suspend dispatching), unless it's already there.

How do you think? @chaunceyjiang @RainbowMango

@RainbowMango
Copy link
Member

Also, I don't know how trivial this would be, but ideally we can have a metric for work status (with tag value for dispatching vs suspend dispatching), unless it's already there.

How do you think? @chaunceyjiang @RainbowMango

It is concerning if we are talking about introducing a metric that tells every work status. You know the amount of work object might be huge, if the work name contains in the metric(like by a tag/lable), the metric record would become very large, and always can not be consumed.

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm
/assign @XiShanYongYe-Chang

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2024
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Thanks~
/lgtm

@XiShanYongYe-Chang
Copy link
Member

/hold cancel

@karmada-bot karmada-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 12, 2024
Copy link
Member

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

Thanks~

/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chaunceyjiang

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2024
@karmada-bot karmada-bot merged commit b5b065d into karmada-io:master Aug 12, 2024
12 checks passed
@a7i a7i deleted the work-suspend-event branch August 12, 2024 12:32
@RainbowMango RainbowMango added this to the v1.11 milestone Aug 31, 2024
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants