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

koordlet: tc plugin for netqos #1920

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lucming
Copy link
Contributor

@lucming lucming commented Feb 23, 2024

Ⅰ. Describe what this PR does

A plugin for netqos, and based on tc.
other discussion: #1764

btw, there may be some duplicate defination with pr #1843 .

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign hormes after the PR has been reviewed.
You can assign the PR to them by writing /assign @hormes in a comment when ready.

The full list of commands accepted by this bot can be found 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

@zwzhang0107
Copy link
Contributor

it will be great if you can add some implement details in doc about tc plugin https://github.com/koordinator-sh/koordinator/blob/main/docs/proposals/koordlet/20231208-support-netqos.md#internal-plugins

@lucming
Copy link
Contributor Author

lucming commented Feb 27, 2024

it will be great if you can add some implement details in doc about tc plugin https://github.com/koordinator-sh/koordinator/blob/main/docs/proposals/koordlet/20231208-support-netqos.md#internal-plugins

write in this pr?

@lucming lucming force-pushed the netqos-tc branch 3 times, most recently from 278d46a to 4f2060b Compare March 5, 2024 07:26
@zwzhang0107
Copy link
Contributor

it will be great if you can add some implement details in doc about tc plugin https://github.com/koordinator-sh/koordinator/blob/main/docs/proposals/koordlet/20231208-support-netqos.md#internal-plugins

write in this pr?

another one with only proposal is better

@lucming lucming force-pushed the netqos-tc branch 2 times, most recently from 03257aa to 96ae4e0 Compare March 15, 2024 07:14
@lucming
Copy link
Contributor Author

lucming commented Mar 15, 2024

it will be great if you can add some implement details in doc about tc plugin https://github.com/koordinator-sh/koordinator/blob/main/docs/proposals/koordlet/20231208-support-netqos.md#internal-plugins

write in this pr?

another one with only proposal is better

done. and this is proposal pr: #1954

pkg/koordlet/runtimehooks/config.go Outdated Show resolved Hide resolved
pkg/koordlet/runtimehooks/hooks/tc/tc.go Outdated Show resolved Hide resolved
apis/extension/netqos_tc.go Outdated Show resolved Hide resolved
pkg/koordlet/runtimehooks/hooks/tc/iptables.go Outdated Show resolved Hide resolved
pkg/koordlet/util/system/common_linux.go Outdated Show resolved Hide resolved
pkg/koordlet/runtimehooks/hooks/tc/tc_linux.go Outdated Show resolved Hide resolved
pkg/koordlet/runtimehooks/hooks/tc/iptables.go Outdated Show resolved Hide resolved
@zwzhang0107
Copy link
Contributor

image

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 28.92460% with 575 lines in your changes are missing coverage. Please review.

Project coverage is 67.78%. Comparing base (44d8d1b) to head (769d712).

Files Patch % Lines
pkg/koordlet/runtimehooks/hooks/tc/tc_linux.go 25.67% 347 Missing and 9 partials ⚠️
pkg/koordlet/runtimehooks/hooks/tc/rule.go 14.11% 72 Missing and 1 partial ⚠️
pkg/koordlet/runtimehooks/hooks/tc/netqos_tc.go 0.00% 41 Missing ⚠️
pkg/koordlet/runtimehooks/hooks/tc/iptables.go 27.08% 34 Missing and 1 partial ⚠️
pkg/koordlet/runtimehooks/hooks/tc/ipset.go 33.33% 19 Missing and 1 partial ⚠️
pkg/koordlet/runtimehooks/protocol/pod_context.go 0.00% 10 Missing and 1 partial ⚠️
pkg/koordlet/resourceexecutor/reader.go 0.00% 10 Missing ⚠️
pkg/koordlet/runtimehooks/hooks/tc/helper.go 87.09% 7 Missing and 1 partial ⚠️
pkg/koordlet/runtimehooks/reconciler/reconciler.go 0.00% 8 Missing ⚠️
pkg/koordlet/runtimehooks/protocol/protocol.go 0.00% 6 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1920      +/-   ##
==========================================
- Coverage   68.57%   67.78%   -0.80%     
==========================================
  Files         430      436       +6     
  Lines       39383    40192     +809     
==========================================
+ Hits        27007    27244     +237     
- Misses      10037    10594     +557     
- Partials     2339     2354      +15     
Flag Coverage Δ
unittests 67.78% <28.92%> (-0.80%) ⬇️

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.

@lucming lucming force-pushed the netqos-tc branch 4 times, most recently from 347bd58 to 12deec2 Compare March 29, 2024 03:51
@lucming lucming force-pushed the netqos-tc branch 2 times, most recently from 05a8197 to 85a32a3 Compare May 5, 2024 15:45
@zwzhang0107
Copy link
Contributor

go mod tidy?

newRule.enable = false
}

p.rule.Update(&newRule)
Copy link
Contributor

Choose a reason for hiding this comment

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

check whether rule is updated with reflect.DeepEqual

}

return apierror.NewAggregate([]error{
p.ensureFilter(filterKey(strconv.Itoa(SYSTEM_CLASS_MINOR_ID)), genFilterCmd("add", SYSTEM_CLASS_PRIO, SYSTEM_CLASS_MINOR_ID),
Copy link
Contributor

Choose a reason for hiding this comment

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

could add/change be seperated? so we don't need add if already exist.

Copy link
Contributor

Choose a reason for hiding this comment

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

// TODO

}
needLimitAtPodLevel := ing != 0 || egress != 0

if pod.Pod.DeletionTimestamp != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

pod may be already deleted before we catch the deleteTimestamp

maybe we should list all rules and delete those danglings.


minorHex := ""
key := string(uid)
for i := 0; i < 5; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can use other hash algo to avoid the conflicts.

}

func (p *tcPlugin) DestoryIpset() error {
klog.V(5).Infof("start to delete ipset rules crated by tc plugin.")
Copy link

Choose a reason for hiding this comment

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

crated -> created

}

func (p *tcPlugin) DelIptables() error {
klog.V(5).Infof("start to delete iptables rules crated by tc plugin.")
Copy link

Choose a reason for hiding this comment

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

crated -> created

@lucming lucming force-pushed the netqos-tc branch 2 times, most recently from e08de79 to 72148e2 Compare May 19, 2024 07:33
@zwzhang0107
Copy link
Contributor

code needs rebase
make lint?

@lucming lucming force-pushed the netqos-tc branch 3 times, most recently from 9a764c5 to eb5f2af Compare May 21, 2024 06:26
Signed-off-by: lucming <2876757716@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants