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

fix(sysadvisor): fix failed to find regions and pools #63

Merged
merged 1 commit into from
May 17, 2023

Conversation

cheney-lin
Copy link
Member

What type of PR is this?

Bug fixes

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Patch coverage: 64.44% and project coverage change: -0.08 ⚠️

Comparison is base (21d86d9) 51.30% compared to head (86888c7) 51.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
- Coverage   51.30%   51.22%   -0.08%     
==========================================
  Files         318      325       +7     
  Lines       32418    33052     +634     
==========================================
+ Hits        16632    16932     +300     
- Misses      13840    14129     +289     
- Partials     1946     1991      +45     
Flag Coverage Δ
unittest 51.22% <64.44%> (-0.08%) ⬇️

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

Impacted Files Coverage Δ
pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy.go 38.32% <0.00%> (-0.03%) ⬇️
...ourcemanager/fetcher/kubelet/topology/interface.go 0.00% <0.00%> (ø)
...nt/sysadvisor/plugin/qosaware/reporter/reporter.go 39.00% <0.00%> (-37.55%) ⬇️
pkg/client/control/cnr.go 37.80% <0.00%> (-1.94%) ⬇️
pkg/config/agent/global/base.go 100.00% <ø> (ø)
pkg/util/general/error.go 0.00% <0.00%> (ø)
...ysadvisor/plugin/qosaware/server/cpu/cpu_server.go 54.26% <3.44%> (-1.40%) ⬇️
.../agent/resourcemanager/reporter/cnr/cnrreporter.go 61.20% <27.58%> (-3.06%) ⬇️
...t/resourcemanager/fetcher/kubelet/kubeletplugin.go 33.92% <33.33%> (-32.74%) ⬇️
pkg/agent/resourcemanager/reporter/converter.go 33.33% <33.33%> (ø)
... and 32 more

... and 12 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cheney-lin cheney-lin force-pushed the dev/fix_get_region branch from 0105f93 to 7caf854 Compare May 15, 2023 06:39
@cheney-lin cheney-lin added the workflow/draft draft: no need to review label May 15, 2023
@cheney-lin cheney-lin force-pushed the dev/fix_get_region branch from 7caf854 to dbb5f53 Compare May 16, 2023 05:45
@cheney-lin cheney-lin changed the title fix(sysadvisor): fix failed to find regions fix(sysadvisor): fix failed to find regions and pools May 16, 2023
@cheney-lin cheney-lin added bug Something isn't working workflow/need-review review: test succeeded, need to review and removed workflow/draft draft: no need to review labels May 16, 2023
@cheney-lin cheney-lin added this to the v0.2 milestone May 16, 2023
sun-yuliang
sun-yuliang previously approved these changes May 16, 2023
@cheney-lin cheney-lin added workflow/merge-ready merge-ready: code is ready and can be merged and removed workflow/need-review review: test succeeded, need to review labels May 16, 2023
@cheney-lin cheney-lin force-pushed the dev/fix_get_region branch 2 times, most recently from ab2e519 to 9f8b0ee Compare May 16, 2023 10:54

func (cra *cpuResourceAdvisor) getContainerRegions(ci *types.ContainerInfo) ([]region.QoSRegion, error) {
regions := cra.getRegionsByRegionNames(ci.RegionNames)
if len(regions) > 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

when will getRegionsByRegionNames returns nil, but getRegionsByPodUID has data?

Copy link
Member Author

Choose a reason for hiding this comment

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

When a new container(sidecar as example) allocated, its regionNames are empty, so getRegionsByRegionNames will returns nil. But its main continer has already assigned to specified region, so getRegionsByPodUID returns the regions of main container

Copy link
Collaborator

Choose a reason for hiding this comment

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

okay, got it, maybe we'd better add those above as comments to clarify

Copy link
Member Author

Choose a reason for hiding this comment

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

done

1. The region names of containers belonging to the same pod
should be the same, so we have to get region by podUID.
2. The regionNames in poolInfo should not be cleaned up when updatePoolInfo.

Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
@cheney-lin cheney-lin force-pushed the dev/fix_get_region branch from c4e351b to 86888c7 Compare May 17, 2023 05:26
@waynepeking348 waynepeking348 merged commit 2ffafb0 into kubewharf:main May 17, 2023
@cheney-lin cheney-lin deleted the dev/fix_get_region branch September 13, 2023 06:31
luomingmeng pushed a commit to luomingmeng/katalyst-core that referenced this pull request Oct 11, 2024
1. The region names of containers belonging to the same pod
should be the same, so we have to get region by podUID.
2. The regionNames in poolInfo should not be cleaned up when updatePoolInfo.

Signed-off-by: linzhecheng <linzhecheng@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workflow/merge-ready merge-ready: code is ready and can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants